[Tim] > ... > It's the *natural* semantics if Andrew's suspicion that it's > compiling a DFA is correct ... More from the man page: AREs report the longest/shortest match for the RE, rather than the first found in a specified search order. This may affect some RREs which were written in the expectation that the first match would be reported. (The careful crafting of RREs to optimize the search order for fast matching is obsolete (AREs examine all possible matches in parallel, and their performance is largely insensitive to their complexity) but cases where the search order was exploited to deliberately find a match which was not the longest/shortest will need rewriting.) Nails it, yes? Now, in 10 seconds, try to remember a regexp where this really matters <wink>. Note in passing that IDLE's colorizer regexp *needs* to search for triple-quoted strings before single-quoted ones, else the P/P semantics would consider """ to be an empty single-quoted string followed by a double quote. This isn't a case where it matters in a bad way, though! The "longest" rule picks the correct alternative regardless of the order in which they're written. at-least-in-that-specific-regex<0.1-wink>-ly y'rs - tim
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4