2 ms·
Update: I tested it out a little more here. https://github.com/oilshell/blog-code/blob/master/regular-languages/greedy.sh#L61 https://github.com/oilshell/blog-
by chubot 6y ago
Update: I tested it out a little more here.
https://github.com/oilshell/blog-code/blob/master/regular-languages/greedy.sh#L61 https://github.com/oilshell/blog-code/blob/master/regular-la...
Basically everything you want with regard to greedy-nongreedy can be done through automata-based engines.
They jump through a lot of hoops to make them work!
However I would also argue that when you're using them, you're doing it as a performance hack in a Perl-style regex engine. In an automata-based engine, you can just write
/x*/
/(x*)/
and it's what you want, and it runs fast.