Need help with a program

Jean-Michel Pichavant jeanmichel at sequans.com
Thu Jan 28 13:21:42 EST 2010


D'Arcy J.M. Cain wrote:
> On Thu, 28 Jan 2010 18:49:02 +0100
> Jean-Michel Pichavant <jeanmichel at sequans.com> wrote:
>   
>> Using regexp may increase readability (if you are familiar with it). 
>>     
>
> If you have a problem and you think that regular expressions are the
> solution then now you have two problems.  Regex is really overkill for
> the OP's problem and it certainly doesn't improve readability.
>
>   
It depends on the reader ability to understand a *simple* regexp.
It is also strange to get such answer after taking so much precautions, 
so let me quote myself:

"Using regexp *may* increase readability (*if* you are *familiar* with it)." 

I honestly find it quite readable in the sample code I provided and 
spares all the if-len-startwith-strip logic, but If the OP does not 
agree, fine with me. But there's no need to get certain that I'm 
completly wrong.

JM





More information about the Python-list mailing list