Re: a simple regex question

2006-04-02 Thread Paddy
John Salerno wrote: > But would findall return this match: aMNHiRFLoDLFb ?? > > There are actually two matches there, but they overlap. So how would > your write an RE that catches them both? I remembered the 'non-consuming' match (?+...) and a miniute of experimentation gave the following. >>>

Re: a simple regex question

2006-04-01 Thread Roel Schroeven
John Salerno schreef: >> pattern = '([a-z][A-Z]{3}[a-z][A-Z]{3}[a-z])+' >> print re.search(pattern, mess).groups() >> >> Anyway, this returns one matching string, but when I put this letter in >> as the solution to the problem, I get a message saying "yes, but there >> are more", so assuming this

Re: a simple regex question

2006-03-31 Thread John Salerno
Justin Azoff wrote: > John Salerno wrote: >> Ok, I'm stuck on another Python challenge question. Apparently what you >> have to do is search through a huge group of characters and find a >> single lowercase character that has exactly three uppercase characters >> on either side of it. Here's what I

Re: a simple regex question

2006-03-31 Thread Justin Azoff
John Salerno wrote: > Ok, I'm stuck on another Python challenge question. Apparently what you > have to do is search through a huge group of characters and find a > single lowercase character that has exactly three uppercase characters > on either side of it. Here's what I have so far: > > pattern

Re: a simple regex question

2006-03-31 Thread John Salerno
John Salerno wrote: > Ok, I'm stuck on another Python challenge question. Apparently what you > have to do is search through a huge group of characters and find a > single lowercase character that has exactly three uppercase characters > on either side of it. Here's what I have so far: > > patt