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