[Tutor] Regular Expression Misunderstanding

John Fouhy john at fouhy.net
Fri Jul 14 12:57:38 CEST 2006


On 14/07/06, Steve Nelson <sanelson at gmail.com> wrote:
> How does one query a match object in this way?  I am learning by
> fiddling interactively.

If you're fiddling interactively, try the dir() command --

ie:

>>> m = re.match(...)
>>> dir(m)

It will tell you what attributes the match object has.

Or you can read the documentation --- a combination of both approaches
usually works quite well :-)

-- 
John.


More information about the Tutor mailing list