Simple regex with whitespaces
jstroud at mbi.ucla.edu
Mon Sep 11 23:38:54 CEST 2006
Paul McGuire wrote:
> <mathieu.malaterre at gmail.com> wrote in message
> news:1157945804.805624.32620 at p79g2000cwp.googlegroups.com...
>> I cannot figure out a way to find a regular expression that would
>>match one and only one of these two strings:
>>Any suggestion ? Thanks a bunch !
> A pyparsing approach is not as terse as regexp's, but it's not terribly long
To second Paul's suggestion, usually, if the regex is not immediately
obvious, its probably better to look into parsing modules, pyparsing
being one of the most accessible modules (to me, anyways)--and well
However, in complicated applications, regex is usually still fun and
valuable as an intellectual exercise.
UCLA-DOE Institute for Genomics and Proteomics
Los Angeles, CA 90095
More information about the Python-list