就像我刚学到的 this question , .NET regexes can access individual matches within a repeated capturing group .
也就是说,如果我使用类似regex的 \b(\w+\s*)+ 对于一个字符串,只有最后一个单词将存储在 \1 或 Match.Groups(1).Value 但使用 Match.Groups(1).Captures 我可以访问所有与regex迭代的匹配项。
\b(\w+\s*)+
\1
Match.Groups(1).Value
Match.Groups(1).Captures
除了.NET,还有其他的regex风格支持这个吗?
据我所知,只有.NET和Perl6提供这种功能。