Regexp Over Multiple Lines

Duncan Booth duncan at NOSPAMrcp.co.uk
Wed Sep 11 15:57:34 CEST 2002


vetter at lincom-asg.com (Keith) wrote in 
news:565e316f.0209110529.30e61ea4 at posting.google.com:

> I am sure that this has been discussed... but in a nutshell can you
> tell me where python lacks in power behind perl.  If I go to rewrite
> my Perl code, which has gotten really messy, in Python will I be
> saying over and over again, "Man, I can't do =that= in Python!"
> 
I don't claim to know Perl, but sticking my neck out I would say on the 
basis of long experience of this newsgroup that you should be able to get 
the results you want in Python, but you may find that the idiomatic way to 
achieve it requires a significant mental gearshift.

Once you learn the idioms you should do fine.

BTW, one of the idioms is not to use regular expressions as often as in 
Perl.

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list