哪些正则表达式调味剂支持捕获(而不是捕获组)? [英] Which regex flavors support captures (as opposed to capturing groups)?
本文介绍了哪些正则表达式调味剂支持捕获(而不是捕获组)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
正如我从此问题中学到的, I.例如,如果我将诸如\b(\w+\s*)+
之类的正则表达式应用于字符串,则仅最后一个词将存储在\1
或Match.Groups(1).Value
中,但是使用Match.Groups(1).Captures
,我可以访问所有经过正则表达式匹配的单个匹配项结束.
I. e., if I apply a regex like \b(\w+\s*)+
to a string of words, only the last word will be stored in \1
or Match.Groups(1).Value
, but using Match.Groups(1).Captures
I get access to all the individual matches the regex iterated over.
.NET之外还支持其他正则表达式吗?
Are there other regex flavors that support this besides .NET?
推荐答案
据我所知,只有.NET和Perl 6提供了该功能.
As far as I know, only .NET and Perl 6 offer that capability.
这篇关于哪些正则表达式调味剂支持捕获(而不是捕获组)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文