I want to find the 2892216th match using a regular expression in vim (technically any linux tool that could give the context to the 2892216th match would suffice)
Asked
Active
Viewed 84 times
0
-
3[This](http://stackoverflow.com/questions/15135430/display-only-the-nth-match-of-grep) answer has some nice ways to do it with `awk`. Since your file is so large it may be more efficient than using vim. – GWW Jun 19 '13 at 16:37
1 Answers
4
You can say 2892216/regex
in vim. Make sure that you are at the beginning of file or the count will be wrong. It is nth match from the current position.

unxnut
- 8,509
- 3
- 27
- 41
-
2Note: that if the cursor starts on a match this will be off by one. – Peter Rincker Jun 19 '13 at 18:44