-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
No match highlighting when using pcre2 #2484
Comments
Your regex only matches the empty string, so no highlighting is correct. Look around only controls whether something matches. The whole point of it is that it doesn't change the offsets of the match. In other words, you're asking for something that is directly contrary to the feature you're using. |
Thanks for the explanation! Makes sense. So there is absolutely no way to get what I want with one ripgrep call? What I could do I guess, is to pipe the results through ripgrep one more time and then highlight all occurences of one and three. |
Yes. This is the way for now. There is also a ticket for adding more sophisticated boolean matching that would probably let you achieve your objective here. On mobile, or otherwise I would link it. |
For future reference: |
|
What version of ripgrep are you using?
ripgrep 13.0.0
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
How did you install ripgrep?
Arch repositories
What operating system are you using ripgrep on?
Arch linux, all packages latest
Describe your bug.
When using the pcre2 regex engine, rg does not highlight matches.
What are the steps to reproduce the behavior?
rg -p -P -e "^(?=.*one)"
with a file with content:
I would assume this to highlight the matched word one, as rg would do without the
-P
flag.The text was updated successfully, but these errors were encountered: