[Tutor] getting a result from an if condition

Tino Dai tinoloc at gmail.com
Thu Oct 4 17:36:45 CEST 2007

Hi Everybody,

     I'm having some problems with get an if block to work.

import re

regex=re.compile('(some expression)')

# What I'm trying to get to work
if (m=regex.search('some long string')):
      print m.groups()

- The thing that isn't working is the m=regex .... in the if line. Is this
possible in python?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071004/eb60fe8d/attachment.htm 

More information about the Tutor mailing list