Match First Sequence in Regular Expression?

Christoph Conrad nospam at spamgourmet.com
Thu Jan 26 10:27:14 EST 2006


Hello Roger,

> since the length of the first sequence of the letter 'a' is 2. Yours
> accepts it, right?

Yes, i misunderstood your requirements. So it must be modified
essentially to that what Tim Chase wrote:

    m = re.search('^[^a]*a{3}b', 'xyz123aabbaaab')

Best wishes from germany,
 Christoph



More information about the Python-list mailing list