~malept/ubuntu/lucid/python2.6/dev-dependency-fix

« back to all changes in this revision

Viewing changes to Lib/test/crashers/infinite_loop_re.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-13 12:51:00 UTC
  • Revision ID: james.westby@ubuntu.com-20090213125100-uufgcb9yeqzujpqw
Tags: upstream-2.6.1
ImportĀ upstreamĀ versionĀ 2.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
7
import re
 
8
starttag = 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
 
 
14
if __name__ == '__main__':
 
15
    foo = '<table cellspacing="0" cellpadding="0" style="border-collapse'
 
16
    starttag.match(foo)