raw strings in regexps

Mike mike at nospam.com
Fri Dec 8 09:54:41 EST 2006


"Gabriel Genellina" <gagsl-py at yahoo.com.ar> wrote in message 
news:mailman.1288.1165563291.32031.python-list at python.org...

...

> You have to quote metacharacters if you want to match them. The escape 
> method is useful for this:
>
> >>> re.escape('(a)')
> '\\(a\\)'

Doh! Of course! Thanks everyone.

-- Mike --





More information about the Python-list mailing list