Skip to content

Instantly share code, notes, and snippets.

@oogali
Created February 16, 2019 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oogali/f7ecc72d2dcef2e9c8b038a933b94000 to your computer and use it in GitHub Desktop.
Save oogali/f7ecc72d2dcef2e9c8b038a933b94000 to your computer and use it in GitHub Desktop.
Example of Python regular expression compiler debugging
>>> re.compile(r'(jump|off)\s+the\s+ramp', re.DEBUG)
subpattern 1
branch
literal 106
literal 117
literal 109
literal 112
or
literal 111
literal 102
literal 102
max_repeat 1 4294967295
in
category category_space
literal 116
literal 104
literal 101
max_repeat 1 4294967295
in
category category_space
literal 114
literal 97
literal 109
literal 112
<_sre.SRE_Pattern object at 0x1055051a8>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment