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

Repeated group does not match #1537

Closed
kerrickstaley opened this issue Apr 2, 2020 · 1 comment
Closed

Repeated group does not match #1537

kerrickstaley opened this issue Apr 2, 2020 · 1 comment

Comments

@kerrickstaley
Copy link

What version of ripgrep are you using?

ripgrep 12.0.1
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)

How did you install ripgrep?

Via Homebrew.

What operating system are you using ripgrep on?

macOS 10.14.5.

Describe your question, feature request, or bug.

Ripgrep does not match the string abc;de,fg with the regex ;(.*,){1}.

If this is a bug, what are the steps to reproduce the behavior?

This returns no lines:

echo 'abc;de,fg' > foo.txt
rg ';(.*,){1}' foo.txt

If I remove the {1} repetition on the group, I do get a match:

echo 'abc;de,fg' > foo.txt
rg ';(.*,)' foo.txt

I also get a match with PCRE:

echo 'abc;de,fg' > foo.txt
rg -P ';(.*,){1}' foo.txt

If this is a bug, what is the expected behavior?

I expect the first example to return a match.

I know this is almost certainly due to my misunderstanding Ripgrep's regex syntax, but I've been racking my brain and I can't figure out what I'm doing wrong.

@BurntSushi
Copy link
Owner

Thanks for the great bug report! Should be fixed on master.

BurntSushi added a commit that referenced this issue Apr 23, 2020
This adds a new test case for a bug (#1537) that has already been fixed.
Or more precisely, a new bug with the same root cause.

Closes #1559
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