regex question

Rustom Mody rustompmody at
Fri Jul 29 13:52:40 EDT 2011

MRAB wrote:
> findall returns a list of tuples (what the groups captured) if there is
more than 1 group,
> or a list of strings (what the group captured) if there is 1 group, or a
list of
> strings (what the regex matched) if there are no groups.

It would be good to put this in the manual dont you think?

Also, the manual says in the 'match' section

"Note If you want to locate a match anywhere in *string*, use search()instead."

to guard against users using match when they should be using search.

Likewise it would be helpful if the manual also said (in the match,search
"If more than one match/search is required use findall"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list