I\'m using ag
in Vim with good results for string/file search.
However, there seems to be not much documentation how patterns are constructed for ag.
<The Silver Searcher tool uses PCRE (Perl-Compatible Regular Expression) syntax. So instead of Vim's \ze
, you need to use the Perl syntax for positive lookahead: (?=pattern)
. (The corresponding lookbehind for \zs
would be (?<=pattern)
.)
I'm showing your example on the command-line, but it should be identical from within Vim:
$ ag 'Pragmatic(?= Vim)'