Skip to content

Instantly share code, notes, and snippets.

@skimbrel
Created February 14, 2014 23:29
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 skimbrel/9011738 to your computer and use it in GitHub Desktop.
Save skimbrel/9011738 to your computer and use it in GitHub Desktop.
In [1]: import re
In [2]: p = re.compile('foo.*bar')
In [3]: s = 'foo' + 'a' * 2**16 + 'bar'
In [4]: len(s)
Out[4]: 65542
In [5]: p.
p.findall p.finditer p.flags p.groupindex p.groups p.match p.pattern p.scanner p.search p.split p.sub p.subn
In [5]: p.match(s)
Out[5]: <_sre.SRE_Match at 0x104c83648>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment