Seach a word and pick the 100th result
I search a word in my notefile and i find 15000 results now I want to locate where is the 100th result in my notefile. How can i detect it ?
Terry R last edited by
may I direct you to this posting.
The question there fits what you are trying to do. Have a go using that information. If in doubt come back to us with what you have tried and also an example of the data if possible. Real data/examples are ALWAYS so much better to help out posters.
guy038 last edited by guy038
Hi, @tarik, @terry-r and All,
From any starting point, in file, the generic regex
}.*?\K\1will find the
Nth occurrence of X, where X can be, either :
A simple character
A word => The regex
A string of characters
A regular expression
For instance, the regex
}.*?\K\1would find, from current location, the
10thoccurrence of the article
Thank you for kindly answers. I don’t know where can I use this command in notepad++.
Scott Sumner last edited by
- Move your caret/cursor to the place where you want to start seeking the Nth match from
- Invoke the Find dialog by pressing ctrl+f
- Select Regular expression as the Search mode
- Put an expression such as @guy038 's in the Find what zone
- Tick the Match case checkbox if you want to…umm…only match the case of your text in the Find what
- Press Find Next button
Does that make it clear?
Thank you all!
guy038 last edited by
Thanks, Scott, for your additionnal information. Look like I was a bit tired to develop ;-))
Of course, as Scott mentioned, your can, either, perform a sensitive to case OR a insensitive to case search, with the respective generic regexes :
}.*?\K\1( Sensitive )
}.*?\K\1( Insensitive )