On Thu, 09 Apr 2009 20:48:11 +0100, Dale Amon wrote:
> This finds nothing:
...
> DEC029 = re.compile("[^&0-9A-Z/ $*,.\-:#@'=\"[<(+\^!);\\\]%_>?]")
> This works correctly:
...
> DEC029 = re.compile("[^&0-9A-Z/ $*,.\-:#@'=\"[<(+\^!)\\;\]%_>?]")
> They differ only in the positioning of the quoted backslash.
So you're telling us that two different regexs do different things? Gosh.
Thanks for the heads up!
BTW, when creating regexes, you may find it much easier if you use raw
strings to avoid needing to escape backslashes:
'\n' in a string is a newline escape. To get a literal backslash followed
by an n, you can write '\\n' or r'\n'.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list