Hacker News new | ask | show | jobs
by mananaysiempre 86 days ago
>> lazy quantifiers for inclusion into the next release of POSIX

> That is surprising!

I mean, POSIX BREs (only!) also include (single-digit) backreferences. Surprisingly, (with such a restriction) this is actually polynomial[1,2] if impractical (h/t 'burntsushi for the reference[3]). But I still wouldn’t take POSIX as the arbiter of sanity in this case. Thus far I’m not even convinced their text actually amounts to a well-defined ordering on parse trees.

I don’t know if nongreedy quantifiers are all that interesting without match groups, though, so this isn’t a particularly burning question in my view.

[1] https://branchfree.org/2019/04/04/question-is-matching-fixed...

[2] https://github.com/travisdowns/polyregex

[3] https://news.ycombinator.com/item?id=40431198