groupmatch {lazy.symbolic} | R Documentation |
Return the captured value for each group
Description
Return the captured value for each group
Usage
groupmatch(pattern = NULL, string = "", debug = 0)
Arguments
pattern |
pattern with groups |
string |
a string |
Value
A vector (length = # of groups) consisting of the captured values
Examples
expr=c("a[i,k]*b[k,j]","a[i,k]*b[k,k]","a[i,k]*b[p,j]")
pat="(\\w+)\\[(\\w+),(\\w+)\\]\\*(\\w+)\\[\\3,(\\w+)\\]"
groupmatch( pat, "aa[i,kk]*b[kk,l]" )
[Package lazy.symbolic version 1.0.0.20250425 ]