Kaydet (Commit) de2f7082 authored tarafından Fred Drake's avatar Fred Drake

Fix regexp for attrfind; bug reported by Lars Marius Garshol

<larsga@ifi.uio.no>.
üst 77d1fce2
...@@ -30,12 +30,12 @@ endtagopen = re.compile('</[<>a-zA-Z]') ...@@ -30,12 +30,12 @@ endtagopen = re.compile('</[<>a-zA-Z]')
endbracket = re.compile('[<>]') endbracket = re.compile('[<>]')
special = re.compile('<![^<>]*>') special = re.compile('<![^<>]*>')
commentopen = re.compile('<!--') commentopen = re.compile('<!--')
commentclose = re.compile('--[ \t\n]*>') commentclose = re.compile('--[%s]*>' % string.whitespace)
tagfind = re.compile('[a-zA-Z][a-zA-Z0-9]*') tagfind = re.compile('[a-zA-Z][a-zA-Z0-9]*')
attrfind = re.compile( attrfind = re.compile(
'[ \t\n]+([a-zA-Z_][-.a-zA-Z_0-9]*)' '[ \t\n\r]+([a-zA-Z_][-.a-zA-Z_0-9]*)'
'([ \t\n]*=[ \t\n]*' + ('([%s]*=[%s]*' % (string.whitespace, string.whitespace))
r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:+*%?!\(\)_#=~]*))?') + r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:+*%?!\(\)_#=~]*))?')
# SGML parser base class -- find tags and call handler functions. # SGML parser base class -- find tags and call handler functions.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment