API Reference for Enthought Tool Suite 3.2.0
Parse CSS identifiers. More complicated than it sounds
escape = (hex_unicode | escaped)
escaped = (Literal('\\').suppress() + Regex(u'[ -~\x80-\uffff]', re.IGNORECASE))
hex_unicode = ((Literal('\\').suppress() + Regex('[0-9a-f]{1,6}', re.IGNORECASE)) + Optional(White(exact = 1)).suppress()).setParseAction(convertToUnicode)
identifier = Combine((nmstart + ZeroOrMore(nmchar)))
nmchar = (Regex(u'[0-9A-Z-]', re.IGNORECASE) | nonascii | escape)
single character for starting an identifier.
nmstart = (Regex(u'[A-Z]', re.IGNORECASE) | nonascii | escape)
any unicode literal outside the 0-127 ascii range
nonascii = Regex(u'[^\x00-\x7f]')
| Local name | Refers to |
|---|---|
| Combine | pyparsing.Combine |
| Literal | pyparsing.Literal |
| oneOf | pyparsing.oneOf |
| Optional | pyparsing.Optional |
| re | re |
| Regex | pyparsing.Regex |
| string | string |
| White | pyparsing.White |
| Word | pyparsing.Word |
| ZeroOrMore | pyparsing.ZeroOrMore |
© Copyright 2002-2009 Enthought, Inc.