Searching two words on different lines
-
Hi,
I need to search for the word new_task and the word task_pending which is supposed to be 3 lines after new_task. How can i do this? Thanks for any help.
-
Hello, @kyle-warren and All,
Not difficult with regular expressions !
Two possibilities :
-
The first regex
(?-si)new_task(.+\R){3}.*task_pendingsearches for the range of any character between the two stringsnew_taskandtask_pending, with that exact case -
The second regex
(?-si)^.*new_task(.+\R){3}.*task_pending.*\R?searches for the complete block of4lines containing, both, the stringsnew_taskandtask_pending, with this exact case
Best Regards
guy038
-
-
Hello,@Kyle-Warren
Please follow this information,To Searching two words on different lines
You need a new version of notepad++. Looks like old versions don’t support |.
Note: egrep “CAT|TOWN” will search for lines containing CATOWN. (CAT)|(TOWN) is the proper or extension (matching 1,3,4). Strangely you wrote and which is btw (CAT.*TOWN)|(TOWN.*CAT)
I hope this information will be useful for you.
Thank you. -
Like most of @Makwana-Prahlad 's posts, this one deeply confuses me.
You need a new version of notepad++. Looks like old versions don’t support |.
Misinformation, unless by “old” you mean pre-6.0.
But why would you assume OP is using a really old version anyway – the OP didn’t say what version, but…egrep
What does that have to do with anything??
egrep “CAT|TOWN” will search for lines containing CATOWN.
What does that have to do what the OP is needing to do?
I could pick apart the rest of the posting, but it is getting tiring.
Just please, don’t spread misinformation.
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