check if regeular expression has results

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Tue Aug 7 14:04:46 EDT 2007


Neil Cerutti a écrit :
> On 2007-08-09, shahargs at gmail.com <shahargs at gmail.com> wrote:
> 
>>Hi,
>>I'm looking for the best way to check if regular expression return
>>true (it's mean - there is a match). for example, i want "if" that
>>check if this regular expression: .*born.*to.* has a match.
>>
>>What's the way to do that simply?
> 
> 
> Newgroups are a poor substitute for the docs. For one thing,
> newsgroups sometimes contain cranky people who say, "RTFM!" The
> docs will never do that.
> 
And for completness, here are the relevant parts of TheFineManual(tm):
http://docs.python.org/lib/module-re.html
http://www.amk.ca/python/howto/regex/



More information about the Python-list mailing list