Non-greedy matching with grep

后端 未结 1 825
情书的邮戳
情书的邮戳 2021-01-17 21:56

Non greedy matching as far as I know is not part of Basic Regular Expression (BRE) and Extended Regular Expression (ERE). However, the behaviour on different versions of

相关标签:
1条回答
  • 2021-01-17 22:43

    The double quantifier is simply a syntax error and could result in either an error message or undefined behavior. It would arguably be better if you got an error message.

    Perl extensions to regex post-date POSIX by a large margin; at the time these tools were written, it was extremely unlikely that someone would try to use this wacky syntax for anything. Greedy matching was only introduced in Perl 5, in the mid-1990s.

    0 讨论(0)
提交回复
热议问题