escapes in regular expressions
Dennis.Benzinger at gmx.net
Sun May 21 20:48:57 CEST 2006
James Thiele schrieb:
> I was helping a guy at work with regular expressions and found
> something I didn't expect:
'\d' is not recognized as a escape sequence by Python and therefore it
is left unchanged <http://docs.python.org/ref/strings.html> in the
string which is passed to re.match.
This is the correct version. The first backslash escapes the second one
and this version will work even if a future version of Python recognizes
\d as an escape sequence.
More information about the Python-list