ag Silver Searcher: what are the rules for patterns?

自闭症网瘾萝莉.ら 提交于 2019-12-03 09:43:52

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)'
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!