• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2# This was taken from http://python.org/sf/1541697
3# It's not technically a crasher.  It may not even truly be infinite,
4# however, I haven't waited a long time to see the result.  It takes
5# 100% of CPU while running this and should be fixed.
6
7import re
8starttag = re.compile(r'<[a-zA-Z][-_.:a-zA-Z0-9]*\s*('
9        r'\s*([a-zA-Z_][-:.a-zA-Z_0-9]*)(\s*=\s*'
10        r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./,:;+*%?!&$\(\)_#=~@]'
11        r'[][\-a-zA-Z0-9./,:;+*%?!&$\(\)_#=~\'"@]*(?=[\s>/<])))?'
12    r')*\s*/?\s*(?=[<>])')
13
14if __name__ == '__main__':
15    foo = '<table cellspacing="0" cellpadding="0" style="border-collapse'
16    starttag.match(foo)
17