Home | Trees | Indices | Help |
|
---|
|
Support for regular expressions conformant to the XML Schema specification.
For the most part, XML regular expressions are similar to the POSIX
ones, and can be handled by the Python re
module. The
exceptions are for multi-character (\w
) and category escapes
(e.g., \p{N}
or \p{IPAExtensions}
) and the
character set subtraction capability. This module supports those by
scanning the regular expression, replacing the category escapes with
equivalent charset expressions. It further detects the subtraction syntax
and modifies the charset expression to remove the unwanted code
points.
The basic technique is to step through the characters of the regular expression, entering a recursive-descent parser when one of the translated constructs is encountered.
There is a nice set of XML regular expressions at http://www.xmlschemareference.com/examples/Ch14/regexpDemo.xsd, with a sample document at http://www.xmlschemareference.com/examples/Ch14/regexpDemo.xml
|
|||
RegularExpressionError Raised when a regular expression cannot be processed.. |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
_log = <logging.Logger object>
|
|||
_AllEsc =
|
|||
_CharClassEsc_re = re.compile(r'\\
|
|||
__package__ =
|
|
Parse a charClassEsc term. This is one of:
If the parsing fails, throws a RegularExpressionError.
|
Parse a posCharGroup term.
|
Parse a charClassExpr. These are XML regular expression classes such as
|
Attempt to match a character class expression.
|
Convert the given pattern to the format required for Python regular expressions.
|
|
_AllEsc
|
_CharClassEsc_re
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Sep 18 22:33:49 2016 | http://epydoc.sourceforge.net |