Regular expression issue

Tim Chase python.list at tim.thechases.com
Sun Aug 8 19:34:46 EDT 2010


On 08/08/10 17:20, genxtech wrote:
> if re.search(search_string, in_string) != None:

While the other responses have addressed some of the big issues, 
it's also good to use

   if thing_to_test is None:

or

   if thing_to_test is not None:

instead of "== None" or "!= None".

-tkc






More information about the Python-list mailing list