symbian-qemu-0.9.1-12/python-2.6.1/Lib/test/crashers/infinite_loop_re.py
changeset 1 2fb8b9db1c86
equal deleted inserted replaced
0:ffa851df0825 1:2fb8b9db1c86
       
     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)