MRAB wrote:
You're almost there:
re.subn('\x61','b','')
or better yet:
re.subn(r'\x61','b','')
Wouldn't that becomes a literal \x61 instead of a as it is inside raw
string?
--
http://mail.python.org/mailman/listinfo/python-list
Lie Ryan wrote:
MRAB wrote:
You're almost there:
re.subn('\x61','b','')
or better yet:
re.subn(r'\x61','b','')
Wouldn't that becomes a literal \x61 instead of a as it is inside raw
string?
Yes. The re module will understand the \x sequence within a regular
expression.
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
--
http://mail.python.org/mailman/listinfo/python-list
Thanks very much for your reply.
What I mean is that I would like to use the ascii number in a regular
expression pattern.
For instance, if I want to substitute the occurrences of character 'a' for
the character 'b' in a string, instead of doing this:
re.subn('a','b','')
I'd like to specify
On Tue, Apr 28, 2009 at 4:58 AM, jorma kala jjk...@gmail.com wrote:
Thanks very much for your reply.
What I mean is that I would like to use the ascii number in a regular
expression pattern.
For instance, if I want to substitute the occurrences of character 'a' for
the character 'b' in a
On Tue, Apr 28, 2009 at 4:05 AM, jorma kala jjk...@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
jorma kala wrote:
Thanks very much for your reply.
What I mean is that I would like to use the ascii number in a regular
expression pattern.
For instance, if I want to substitute the occurrences of character 'a'
for the character 'b' in a string, instead of doing this: