> but I don't understand why regex look-behinds (and look-aheads) have to be > fixed-width patterns. > > i'm getting the impression that it's supposed to make searching > exponentially slower otherwise
That's because of the underlying theory of regular expressions. They are modelled using so called finite state automata (FSM). These are very much limited in the complexity of things they can do, and so are regular expressions. Explaining that further would require to dig deep into the details of FSM, grammars and languages - deeper than I'm currently willing to do :) But I wanted to point out that there is a "real" technical reason for that, not just a lack of feature or willingness to implement one. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list