[Tutor] regexp

Peter Otten __peter__ at web.de
Sat Nov 5 09:22:05 CET 2011

Steven D'Aprano wrote:

> Good luck with the question! If you do solve it, please come back and
> tell us how you did it. I for one am curious now whether or not it can
> be done using Python regexes. Perhaps someone else might have a
> solution. You could try the python-list at python.org mailing list, also
> available on comp.lang.python on Usenet.

Dinara, here's a hint: 

I found a brute-force solution where the regex contains every allowed letter 
explicitly, followed by a quantifier. As long as you confine yourself to 
ascii-letters the performance may be acceptable.

If that hurts your sense of esthetics the tip to try comp.lang.python is a 
good one. Matthew Barnett aka MRAB, author of an alternative regex library 
for python, posts there regularly.

More information about the Tutor mailing list