data regex match

Heiko Wundram me+python at modelnine.org
Tue May 2 23:37:41 CEST 2006


Am Dienstag 02 Mai 2006 23:34 schrieb Fredrik Lundh:
> 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'

I tried that just know. Didn't know that \[a-z] weren't all interpreted as 
escape sequences... Seems like I learn something every day. ;-)

--- Heiko.



More information about the Python-list mailing list