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",\RBest Regards
guy038
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login