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
In order for catastrophic backtracking to occur there must be a character that forces backtracking to occur. E.g.
>>> re.match('(a+)+', 'a' * 64 + 'c') <_sre.SRE_Match at 0x7f9106d32430> >>> re.match('(a+)+b', 'a' * 64 + 'c') ...Spins...
The first expression has nested quantifiers, so Dlint will detect it, but since there's nothing after the nested quantifier to backtrack the match no catastrophic backtracking will occur. Similarly:
$ python -m dlint.redos -p '(a+)+' ('(a+)+', True) $ python -m dlint.redos -p '(a+)+b' ('(a+)+b', True)
We should avoid detecting the first expression because catastrophic backtracking cannot occur.
The text was updated successfully, but these errors were encountered:
49a3a7b
No branches or pull requests
In order for catastrophic backtracking to occur there must be a character that forces backtracking to occur. E.g.
The first expression has nested quantifiers, so Dlint will detect it, but since there's nothing after the nested quantifier to backtrack the match no catastrophic backtracking will occur. Similarly:
We should avoid detecting the first expression because catastrophic backtracking cannot occur.
The text was updated successfully, but these errors were encountered: