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
Search is to long with regex like ^(.+|dontmatch)*$ #42394
Comments
Hi, I don't know if it's a bug or a feature, but Python I found this bug when a try to match strings like "abc"
I know that ".+" construction in not ... optimal, but Haypo |
Logged In: YES I try the same regex with Linux Regex library, and it looks See bug.c file, and type gcc -o bug bug.c && time ./bug (I Victor |
Logged In: YES The "bug" only occurs when the regex doesn't match, else Haypo |
Logged In: YES First fix: (a+|b)* can be replaced by (a|b). Other For the case (a*|b)+ ... Wait, I'm thinking on the problem This optimizatons should be done in compile() function. Haypo |
It's not a bug, it's a feature. I wrote a library |
Fair enough :) |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: