alex goldman <[EMAIL PROTECTED]> writes: > vermicule wrote: > > > > > What is so hard to understand ? > > Should be perfectly clear even to a first year undergraduate. > > > > As for "greedy" even a minimal exposure to Djikstra's shortest path > > algorithm would have made the concept intuitive. And from memory, > > that is the sort of thing done in Computing 101 and in Data Structures > > and Algorithms 101 > > > > It seems to me that you want the Python doc to be written for morons. > > And that is not a valid complaint. > > He's right actually. If we understand the term "greedy" as it's used in > graph search and optimization algorithms, Python's RE matching actually IS > greedy.
No, you're just confused about the optimization metric. In regexes, "greedy" match optimizes for the longest match, not the fastest. And this is common regex terminology - man perlre and you will find discussion of "greedy" vs. "stingy" matching. -SEan -- http://mail.python.org/mailman/listinfo/python-list