data regex match

Fredrik Lundh fredrik at pythonware.com
Tue May 2 23:34:26 CEST 2006


Heiko Wundram wrote:

> As always, use a raw string for regular expressions. \d is being interpreted
> to mean an ascii character, and not to mean the character class you're trying
> to reference here.

\d isn't an ASCII character, but \1 is.

>>> print '(\d{2})/\1/\1\1'
(\d{2})/?/??

</F>






More information about the Python-list mailing list