re module is the standard regular
expression-matching interface. Regular expression (RE) patterns are
specified as strings. This module must be imported.
compile(pattern [, flags])
Compile an RE
string into a regular expression object, for later matching.
flags (combinable by bitwise
| operator) include the
following available at the top-level of the
\S perform ASCII-only matching
instead of full Unicode matching. This is only meaningful
for Unicode patterns and is ignored for byte patterns.
Note that for backward compatibility, the
re.U flag still exists (as well
as its synonym
re.UNICODE and its embedded
these are redundant in Python 3.0 since matches are
Unicode by default for strings (and Unicode matching isn’t
allowed for bytes).
\D dependent on the current
locale (default is Unicode for Python 3).
Matches to each newline, not whole string.
all characters, including
\D dependent on Unicode
character properties (new in version 2.0, and superfluous
in Python 3).
Ignores whitespace in the pattern, outside character sets.
match(pattern, string [, flags])
If zero or more characters at start of
string match the ...