FYI, Original link: 
https://github.com/mikehaertel/minrx/issues/12#issuecomment-2702534742

> 下面是被转发的邮件:
> 
> 发件人: mikehaertel <[email protected]>
> 主题: 回复:[mikehaertel/minrx] Support new POSIX 2024 non-greedy repetition 
> operators ?? *? and +?. (Issue #12)
> 日期: 2025年3月6日 GMT+8 10:01:04
> 收件人: mikehaertel/minrx <[email protected]>
> 抄送: dannyniu <[email protected]>, Manual <[email protected]>
> 回复给: mikehaertel/minrx 
> <reply+ahpjzmg4bbafv3zvd2l3sigf2trobevbnhhjhxv...@reply.github.com>
> 
> MinRX currently matches the specific (aaa??)* example in the proposed new 
> wording, but does so for reasons that I think are accidental.
> I personally think the most desirable behaviour for (aaa?)* against "aaaaa" 
> would be for the first instance of the parenthesized subexpression to match 
> aa (because that's minimal), but then the second instance should match aaa, 
> because that results in the longest match for the outer enclosing *, and aaa 
> is certainly a legal match to aaa??.
> Throughout POSIX regular expressions there has been a theme that optimizing 
> the overall match of outermost-enclosing constructs takes precedence over 
> optimizing the matches for inner enclosed subpatterns, and I think Geoff 
> Clare's proposed new wording violates the principle of least surprise in that 
> regard.
> I've tried several possible definitions for what minimal repetitions should 
> mean, and all the definitions I've experimented with so far turn out to have 
> cases with surprising behavior. I've found obvious bugs in both TRE as well 
> as the Apple matcher based on TRE. I would say that Apple has fixed a number 
> of bugs compared to the github version of TRE (I've been using 
> http://github.com/laurikari/tre.git for reference, but I'm not sure what the 
> most actively-maintained non-Apple version of TRE is).
> I hope the POSIX committee will not rush to incorporate this proposed change, 
> and instead give implementations time to fix their bugs and users time to 
> come to consensus on what the "right thing" is.
> —
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> You are receiving this because you are subscribed to this thread.Message ID: 
> <mikehaertel/minrx/issues/12/[email protected]>


  • Fwd: [mikehaertel/minrx] ... Niu Danny via austin-group-l at The Open Group

Reply via email to