Using ascii numbers in regular expression

Lie Ryan lie.1296 at gmail.com
Thu Apr 30 09:43:22 EDT 2009


MRAB wrote:
> You're almost there:
> 
>     re.subn('\x61','b','aaaa')
> 
> or better yet:
> 
>     re.subn(r'\x61','b','aaaa')

Wouldn't that becomes a literal \x61 instead of "a" as it is inside raw 
string?



More information about the Python-list mailing list