-
Notifications
You must be signed in to change notification settings - Fork 193
incorrect match with repeated group #300
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
Comments
Thanks, will look into it. It will take a while as I'm currently swamped. |
I am adding a simpler regex for reproducing the same bug. The problem is probably in backtracking optimization which does not work when two repeats are nested.
|
I stumble upon a similar issue and given @sladecek’s description about nested repeat, it looks like it’s the same bug. This comment is there only as a possible help to identify the issue. If it does not it can be ignored. :) I’m trying to isolate private keys in a PEM file so finding First, I tried with Then, I tried with For the moment, I will just track this issue and check if a proposed fix for the previous expressions work for my use case and will open a different issue only if it proves to be unrelated. |
A regex with a repeated group and a lazy space character doesn't work like I expect. boost and the online regex demo tools behave as expected. Here's as simple an example as I could easily create:
regex:
(([A-Z][a-z]+ *?){1,4}) g
The intent is to match 1 to 4 capitalized words in front of a word starting with g.
https://gcc.godbolt.org/z/v6KWrasYv
CTRE fails to match multiple capitalized words, and only matches the last one.
The text was updated successfully, but these errors were encountered: