dmtr wrote:
On Jun 17, 3:35 pm, MRAB wrote:
>>> import re
>>> r = re.compile('^abc$', re.I)
>>> r.pattern
'^abc$'
>>> r.flags
2
Hey, thanks. It works.
Couldn't find it in a reference somehow.
And it's not in the inspect.getmembers(r).
Must be doing something wrong.
Occasionally you
On Jun 17, 3:35 pm, MRAB wrote:
>
> >>> import re
> >>> r = re.compile('^abc$', re.I)
> >>> r.pattern
> '^abc$'
> >>> r.flags
> 2
Hey, thanks. It works.
Couldn't find it in a reference somehow.
And it's not in the inspect.getmembers(r).
Must be doing something wrong.
-- Cheers, Dmitry
dmtr wrote:
I need to print the regexp pattern text (SRE_Pattern object ) for
debugging purposes, is there any way to do it gracefully? I've came up
with the following hack, but it is rather crude... Is there an
official way to get the regexp pattern text?
import re, pickle
r = re.compile('^abc
I need to print the regexp pattern text (SRE_Pattern object ) for
debugging purposes, is there any way to do it gracefully? I've came up
with the following hack, but it is rather crude... Is there an
official way to get the regexp pattern text?
>>> import re, pickle
>>> r = re.compile('^abc$', re.