reusing parts of a string in RE matches?

John Salerno johnjsal at NOSPAMgmail.com
Wed May 10 11:56:28 EDT 2006


Bo Yang wrote:

>> This matches all the 'ab' followed by an 'a', but it doesn't include 
>> the 'a'. What I'd like to do is find all the 'aba' matches. A regular 
>> findall() gives four results, but really there are seven.
>>
>>   
> I try the code , but I give seven results !

Sorry, I meant that findall() only returns 4 results when searching for 
'aba', when there are actually seven instances of 'aba'. This doesn't 
involve the look-ahead RE.



More information about the Python-list mailing list