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

"-w" does not work if pattern contains "|" #580

Closed
jpetkau opened this issue Aug 22, 2017 · 1 comment
Closed

"-w" does not work if pattern contains "|" #580

jpetkau opened this issue Aug 22, 2017 · 1 comment

Comments

@jpetkau
Copy link

jpetkau commented Aug 22, 2017

For example, the command rg -w 'aa|ee|ii|oo|uu' incorrectly matches foo and aardvark.

It appears that -w is implemented by surrounding the pattern with \b, so the above is equivalent to \baa|ee|ii|oo|uu\b, when it should be equivalent to \baa\b|\bee\b|\bii\b|\boo\b|\buu\b or \b(aa|ee|ii|oo|uu)\b.

@BurntSushi
Copy link
Owner

This is fixed in master (see #516).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants