开发者

Which regex flavors support captures (as opposed to capturing groups)?

开发者 https://www.devze.com 2022-12-26 21:21 出处:网络
As I just learned from this question, .NET regexes can access individual matches within a repeated capturing group.

As I just learned from this question, .NET regexes can access individual matches within a repeated capturing group.

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).V开发者_运维技巧alue, but using Match.Groups(1).Captures I get access to all the individual matches the regex iterated over.

Are there other regex flavors that support this besides .NET?


As far as I know, only .NET and Perl 6 offer that capability.

0

精彩评论

暂无评论...
验证码 换一张
取 消