You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a duplicate of #1064 and #1081. It's fixed on master.
From my digging, I thought that this bug wasn't a regression, but had always been there in previous versions of ripgrep. However, we've had this bug filed three times since the release of ripgrep 0.10, but never before. So something seems fishy.
FWIW, I don't think it's a regression. I found the same thing on 0.8.1, confirmed it on 0.10.0, and was going to report it until I found all the duplicates.
What version of ripgrep are you using?
What operating system are you using ripgrep on?
Arch Linux, using the Arch-official
ripgrep
package.Bug description/reproduction steps
This prints out "abcd".
echo 'abcd' | rg 'a(.*(d|ce))'
Adding a "c" makes it not match (i.e. it doesn't print out anything).
echo 'abcd' | rg 'a(.*(cd|ce))'
If this is a bug, what is the expected behavior?
I believe that both regexes should match the input, and print out a match in both cases. Testing using regex101 seems to imply this is true.
Real-world discovery background (non-minimal case that made me discover the minimal repro above):
I was trying to run
git diff --name-only master... | rg 'js/src/(.*(cpp|\.h))' --replace '$1'
.git diff --name-only master...
printed lines such as:and I wanted to extract:
(i.e. trim
js/src/
off the front, and only matchcpp
andh
files)However, adding a
\.
in front of thecpp
made nothing match.git diff --name-only master... | rg 'js/src/(.*(\.cpp|\.h))' --replace '$1'
-- prints nothing???The text was updated successfully, but these errors were encountered: