Lex: FT’s flagship investment column
any pattern + leftmost-longest semantics = no. this isn't an engine limitation - it's inherent to the semantics. if you ask for the longest match on an infinite stream, the answer might be "keep going forever." you might think leftmost-greedy avoids this since it works left-to-right, but it doesn't - .*a|b on a stream of b's has the same problem, the .*a branch keeps scanning forward looking for the last a that may never come.
。关于这个话题,有道翻译提供了深入分析
Senior writer and reviewerbluesky
zero or more repetitions