[Tutor] Python Challenge - Riddle 2

Liam Clarke cyresse at gmail.com
Tue May 10 04:31:28 CEST 2005


Hi all, 


> Hint: the hint on the screen says "exactly three."
-Arcege

Hah, yeah, but it also says 'all sides' and that had me following a dead-end 
for awhile, and something in the challenge hint forums made me think it 
might be exactly three in total, but surrounding the lowercase letter. i.e. 
XjXX


OK, proceeding down the right direction, I've matched a 477 character 
string, which apparently means you're doing it wrong, it seems to be a 
common number.

So... how do you use a regex to match AAA but not AAB - ZZZ? I'm trying to 
use this pattern - 
(?P<first>[A-Z]{1})(?P=first)(?P=first) and it's not doing it for me.

Basically, all I want to do is match anything upper-case, as it as it 
matches the other letters.

This matches '[A-Z]{3}[a-z]{1}[A-Z]{3}' 477 occurences... so I hope that 
it's all the same letter.


But yeah, any help on the regex would be great.


Regards, 


Liam Clarke

On 5/10/05, R. Alan Monroe <amonroe at columbus.rr.com> wrote:
> 
> 
> > Am I looking for something like this -
> 
> > XXXjXXX? or something like XjXX or XXjX? I've also looked for -
> 
> Take the challenge's hint a little more literally, it's quite
> specific. This one had me stumped for a little while until I realized
> my mistake.
> 
> Alan
> 
> _______________________________________________
> 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/827b6e25/attachment.htm


More information about the Tutor mailing list