Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate Perl-compatible patterns to Vim regular expression syntax #11

Open
wincent opened this issue Jul 17, 2015 · 1 comment
Open

Comments

@wincent
Copy link
Owner

wincent commented Jul 17, 2015

:Ack can take fancy Perl-compatible regular expressions.

If you then run :Acks with the same pattern, Vim may not actually find anything, because its patterns are not Perl-compatible, even with the \v flag.

Doing 100% compatible translation would be impossible, as Perl regexen have features that Vim's do not, but we can handle the simple cases at least (eg. \bfoo\b could become <foo>, although we'd need to decide what to do with \bfoo).

@cpixl
Copy link
Contributor

cpixl commented Sep 30, 2015

Maybe :perldo s/\bfoo\b/bar/gi can help most of the cases (if not all cases), as it supports the s/pattern/replacement/flags syntax used in Vim. Obviously, the only drawback is that the installation must have +perl or +perl/dyn.

EDIT: Also there is eregex. Didn't have time to use it, but looks like to be promising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants