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
python re bug #81508
Comments
the code is: |
the code is: |
When I run the regex on https://regex101.com/, after some small adjustments ("HTTP\/1\.0" and "\/head"), it mentions 'Catastrophic backtracking has been detected and the execution of your expression has been halted.' I don't know much about regex, but it seems there is some eternal loop or something. I'd suggest to try to make the regex work first on other regex compiler, before calling it a python bug. |
neither the banner contains "<style>" |
The problem is the "(?:[^\<]+|<(?!/head>))*?". If I simplify it a little I get "(?:[^\<]+)*?", which is a repeat within a repeat. There are many ways in which it could match, and if what follows fails to match (it doesn't because there's no "<style>" in the target string, as Aldwin pointed out), it'll try them all, which can take a long time. |
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: