leftmost longest match (of disjunctions) ; greediness of "|"

Joerg Schuster js at cis.uni-muenchen.de
Tue Dec 2 03:19:53 EST 2003


Peter Hansen <peter at engcorp.com> writes:

> produce a longer overall match.  In other words, the "|" operator is never 
> greedy. 

O.k. Thanks for pointing this out. Maybe I should have formulated my
question differently: Is there a trick (be it dirty or not) to make
"|" greedy in python?


Jörg




More information about the Python-list mailing list