|
|
str | attr_name = "[a-zA-Z_:][a-zA-Z0-9:._-]*" |
| |
|
str | unquoted = "[^\"'=<>`\\x00-\\x20]+" |
| |
|
str | single_quoted = "'[^']*'" |
| |
|
str | double_quoted = '"[^"]*"' |
| |
|
str | attr_value = "(?:" + unquoted + "|" + single_quoted + "|" + double_quoted + ")" |
| |
|
str | attribute = "(?:\\s+" + attr_name + "(?:\\s*=\\s*" + attr_value + ")?)" |
| |
|
str | open_tag = "<[A-Za-z][A-Za-z0-9\\-]*" + attribute + "*\\s*\\/?>" |
| |
|
str | close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>" |
| |
|
str | comment = "<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->" |
| |
|
str | processing = "<[?][\\s\\S]*?[?]>" |
| |
|
str | declaration = "<![A-Za-z][^>]*>" |
| |
|
str | cdata = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>" |
| |
| | HTML_TAG_RE |
| |
|
str | HTML_OPEN_CLOSE_TAG_STR = "^(?:" + open_tag + "|" + close_tag + ")" |
| |
|
| HTML_OPEN_CLOSE_TAG_RE = re.compile(HTML_OPEN_CLOSE_TAG_STR) |
| |
Regexps to match html elements