Niu Danny wrote in <tyapr01mb4992126db2705ee02e22b028c1...@tyapr01mb4992.jpnprd01.prod.outl\ ook.com>:
[fixing quotes] ||发件人: [email protected] <[email protected]> \ ||代表 Steffen Nurpmeso via austin-group-l at The Open Group <austin-gro\ ||[email protected]> ||发送时间: 2024年9月15日 04:53 ||收件人: Niu Danny via austin-group-l at The Open Group ||主题: Re: 回复: [1003.1(2024)/Issue8 0001857]: Several problems with \ ||the new "lazy" regex quantifier. "lazy" is your own invention and totally off-topic, by the way. ||Niu Danny via austin-group-l at The Open Group wrote in || <tyapr01mb4992132ab4f0542d6eee5a4fc1...@tyapr01mb4992.jpnprd01.prod.outl\ || ook.com>: ... |||https://www.austingroupbugs.net/view.php?id=1857 || ... |||On a related note, can we disclose from which implementation(s) |||did we standardize REG_MINIMAL from? I checked, it's not GNU, |||at least not as of 2024-09-14. || ||This was [1], later corrected / adjusted by [2]. || || [1] https://www.austingroupbugs.net/view.php?id=793 || [2] https://www.austingroupbugs.net/view.php?id=1329 |I didn't mean which bug introduced that feature. I meant which **Impleme\ |ntation** did we base it on. Like i (the one who opened the issue) had written in [1] on 2013-11-15: Some Open Group members already ship with regular expression facilities [Note that GNU is not an "Open Group Member", i have no idea how you come to this conclusion.] which support at least some of the extensions, and there exist long-proven, stable and free (also for commercial use, BSD-licensed), almost drop-in, alternatives which can be used by the others (see the mailing list for some references). I explicitly said it like that, that much is plain. Btw i personally did not even understand issue 1329, let alone your one now, as i find the text from 793 absolutely sufficient. I personally would possibly have gone the perl(1)re way and said By default, a quantified subpattern is "greedy", that is, it will match as many times as possible (given a particular starting location) while still allowing the rest of the pattern to match. If you want it to match the minimum number of times possible, follow the quantifier with a "?". Note that the meanings don’t change, just the "greediness": *? Match 0 or more times, not greedily +? Match 1 or more times, not greedily ?? Match 0 or 1 time, not greedily {n}? Match exactly n times, not greedily (redundant) {n,}? Match at least n times, not greedily {,n}? Match at most n times, not greedily {n,m}? Match at least n but not more than m times, not greedily but if you search the standard you will find lots of "shortest" and "longest", but not a singly "greedy". (The "leftmost" was just copied over from other standard terms it seems to me.) Unless i have my pants full i very much feel that "leftmost shortest possible" pretty much reflects "match non-greedily". [1] http://austingroupbugs.net/view.php?id=793 Having said that, Arnold Robbins of GNU awk quite enthusiastically posted somewhere (i cannot find nowhere where he did, actually) that he is about to change the implementation of its (regex of GNUlib) regular expression engine (alternatively) to a newly written one [2], ie, from Mike Haertel, famous for his implementation of GNU grep. He has opened an issue for itself in order to support "non-greedy repetition operators" already [3]. [2] https://github.com/mikehaertel/minrx [3] https://github.com/mikehaertel/minrx/issues/12 --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)
