Created
August 7, 2016 02:51
-
-
Save joekir/119ea91839646f4fed36a3419227f288 to your computer and use it in GitHub Desktop.
Catastrophic Backtrack Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some samples I collected from sites around the web on this topic. | |
^(A+)*B | |
^([a-zA-Z0-9]+\s?)*$ | |
(a+)+b | |
There seems to be a pretty common theme of | |
>>> r = re.compile('^(A+)+B$',re.DEBUG) | |
AT AT_BEGINNING | |
MAX_REPEAT 1 MAXREPEAT | |
SUBPATTERN 1 | |
MAX_REPEAT 1 MAXREPEAT | |
LITERAL 65 | |
LITERAL 66 | |
AT AT_END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment