mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix regexp for attrfind; bug reported by Lars Marius Garshol
<larsga@ifi.uio.no>.
This commit is contained in:
parent
77d1fce2f6
commit
de2f708299
1 changed files with 4 additions and 4 deletions
|
@ -30,12 +30,12 @@ endtagopen = re.compile('</[<>a-zA-Z]')
|
|||
endbracket = re.compile('[<>]')
|
||||
special = 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]*')
|
||||
attrfind = re.compile(
|
||||
'[ \t\n]+([a-zA-Z_][-.a-zA-Z_0-9]*)'
|
||||
'([ \t\n]*=[ \t\n]*'
|
||||
r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:+*%?!\(\)_#=~]*))?')
|
||||
'[ \t\n\r]+([a-zA-Z_][-.a-zA-Z_0-9]*)'
|
||||
+ ('([%s]*=[%s]*' % (string.whitespace, string.whitespace))
|
||||
+ r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:+*%?!\(\)_#=~]*))?')
|
||||
|
||||
|
||||
# SGML parser base class -- find tags and call handler functions.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue