Using ascii numbers in regular expression

Chris Rebert clp2 at rebertia.com
Tue Apr 28 07:45:52 EDT 2009


On Tue, Apr 28, 2009 at 4:05 AM, jorma kala <jjkk73 at gmail.com> wrote:
> Hi,
>
> How can I use the ascii number of a character in a regular expression
> (module re) instead of the character itself?
> Thanks very much

I refer you to the chr() and ord() built-in functions, which can
certainly be used to solve your problem, though they are not
regex-specific in application.
http://docs.python.org/library/functions.html

Cheers,
Chris
-- 
http://blog.rebertia.com



More information about the Python-list mailing list