[Tutor] regexp

Peter Otten __peter__ at web.de
Mon Nov 7 10:33:24 CET 2011


Asokan Pichai wrote:

> IMO the regex is not too bad; I will not use it for this job -- typing
> a 50+ character string
> is more painful (and more error prone) than writing 5--10 lines of code.

Well, you can build the string programmatically:

>>> "*".join(string.ascii_lowercase) + "*"
'a*b*c*d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*'




More information about the Tutor mailing list