Regex in if statement.

Ken D'Ambrosio ken at jots.org
Sun Mar 20 20:46:22 EDT 2011


Hey, all -- I know how to match and return stuff from a regex, but I'd
like to do an if, something like (from Perl, sorry):

if (/MatchTextHere/){DoSomething();}

How do I accomplish this in Python?

Thanks!

-Ken







More information about the Python-list mailing list