3 ms·
All POSIX compatible regex engines do the same. It's somewhat linked to why POSIX regexes don't have non-greedy operators. But DFAs can implement the preferenc
by burntsushi 5y ago
All POSIX compatible regex engines do the same. It's somewhat linked to why POSIX regexes don't have non-greedy operators.
But DFAs can implement the preference-order semantics found in backtracking regex engines too. Russ Cox's articles show how to do that.
(Just adding some additional info to your point.)