Mark line before
-
I have marked 2 regions in my script,
I would like to find out if there is a way to mark the line before at the same time.
example:“ip_prefix”: “52.93.50.174/31”
and
“ip_prefix”: “52.93.193.200/32”,
Note this is a large file from Azure IP Ranges and Service Tags – Public Cloud
https://www.microsoft.com/en-us/download/details.aspx?id=56519 -
@roger-st-onge said in Mark line before:
way to mark the line before at the same time.
Perhaps something like this:
Find:
(?-is)"ip_prefix".*\R.*?"region"
Search mode: regular expression -
Thanks again for your help Alan :)
Solution: (?-is)“ip_prefix”.\R.?“us-east-1”|(?-is)“ip_prefix”.\R.?“ca-central-1”
Output:
-
Hello, @roger-st-onge, @alan-kilborn and All,
Instead of the regex
(?-is)"ip_prefix".*\R.*?"us-east-1"|(?-is)"ip_prefix".*\R.*?"ca-central-1"
, you could simplify by using that one :MARK
(?-is)^\h*"ip_prefix".+\R\h*"region": "(?:us-east|ca-central)-1",\R
Best Regards
guy038