dmtr wrote:
On Jun 17, 3:35 pm, MRAB <pyt...@mrabarnett.plus.com> 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'll find classes whose instances don't reveal all their
attributes to dir() and so forth, so it's always a good idea to
double-check the documentation.

The documentation mentions the .pattern and .flags attributes at:

    http://docs.python.org/library/re.html
    Section 7.2.4. Regular Expression Objects

(Python 2.6)
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to