[Tutor] Python Challenge - Riddle 2

Liam Clarke cyresse at gmail.com
Tue May 10 13:16:40 CEST 2005


Hi,

So... the [^A-Z] limits the [A-Z]{3}?... /me picks at IDLE. Dang, it does. 
Thanks a bundle, Roel! And I learn a little more about regexes.... :Z


Cheers, 


Liam Clarke


On 5/10/05, Roel Schroeven <rschroev_nospam_ml at fastmail.fm> wrote:
> 
> Liam Clarke wrote:
> 
> > This matches '[A-Z]{3}[a-z]{1}[A-Z]{3}' 477 occurences... so I hope
> > that it's all the same letter.
> 
> You have to many occurences because that regex matches XXXxXXX, but also
> XXXXXXxXXXXXX. You should only match exactly 3 guards on each side. IIRC
> I used something like (sadly I threw my code for levels 1 and 2 away):
> '[^A-Z][A-Z]{3}[a-z]{1}[A-Z]{3}[^A-Z]'
> 
> --
> If I have been able to see further, it was only because I stood
> on the shoulders of giants. -- Isaac Newton
> 
> Roel Schroeven
> 
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 



-- 
'There is only one basic human right, and that is to do as you damn well 
please.
And with it comes the only basic human duty, to take the consequences.'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050510/6ffadf23/attachment.htm


More information about the Tutor mailing list