How to do this in Python...
tim.one at comcast.net
Fri Jan 24 01:27:38 CET 2003
> match = re.match(pattern, string)
> if match is not None:
> # do something with match object
> Since if's can test for more than boolean values, and match is defined
> to return None when it fails to match anything, not a False value.
> Can a match object ever test as false?
is idiomatic in this context. Horrid listcomp abuse is not <wink>.
More information about the Python-list