Match First Sequence in Regular Expression?

Christos Georgiou tzot at
Thu Jan 26 10:30:42 EST 2006

On Thu, 26 Jan 2006 14:09:54 GMT, rumours say that "Roger L. Cauvin"
<roger at> might have written:

>Say I have some string that begins with an arbitrary sequence of characters 
>and then alternates repeating the letters 'a' and 'b' any number of times, 
>I'm looking for a regular expression that matches the first, and only the 
>first, sequence of the letter 'a', and only if the length of the sequence is 
>exactly 3.
>Does such a regular expression exist?  If so, any ideas as to what it could 

Is this what you mean?


This fits your description.
TZOTZIOY, I speak England very best.
"Dear Paul,
please stop spamming us."
The Corinthians

More information about the Python-list mailing list