Description Usage Arguments Value Examples
Return capturing names.
1 |
pattern |
a pre-compiled regular expression or a string |
... |
further arguments passed to |
capturing names
1 2 3 4 5 6 7 | get_named_groups(re2("(a)(?P<name>b)"))
regexp = re2("(?P<A>exprA(?P<B>exprB)(?P<C>exprC))((expr5)(?P<D>exprD))")
print(regexp)
(res = get_named_groups(regexp))
re2_match("exprAexprBexprCexpr5exprD", regexp)
|
[1] ".match" ".1" "name"
re2 pre-compiled regular expression
pattern: (?P<A>exprA(?P<B>exprB)(?P<C>exprC))((expr5)(?P<D>exprD))
number of capturing subpatterns: 6
capturing names with indices:
.match A B C .4 .5 D
expression size: 41
[1] ".match" "A" "B" "C" ".4" ".5" "D"
.match A B C .4
[1,] "exprAexprBexprCexpr5exprD" "exprAexprBexprC" "exprB" "exprC" "expr5exprD"
.5 D
[1,] "expr5" "exprD"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.