Nothing to repeat

Ian hobson42 at gmail.com
Sun Jan 9 13:09:44 EST 2011


On 09/01/2011 17:49, Ian wrote:
> I think you want to anchor your list, or anything will match. Perhaps
My bad - this is better

    re.compile('^((spa)*(m)*)+$')

search finds match in  'spa', 'spaspaspa', 'spammmspa',  '' and   'mmm'

search fails on 'spats', 'mats' and others.





More information about the Python-list mailing list