re2r (version 0.2.0)

$.re2_matrix: Get a match group

Description

Get a match group

Usage

# S3 method for re2_matrix
$(self, group)

Arguments

self

re2_matrix

group

group name

Examples

Run this code
# NOT RUN {
text = c("this is test",
    "this is test, and this is not test",
    "they are tests")
res = re2_match(
    string = text,
    pattern = "(?P<testname>this)( is)"
)
class(res)
is.matrix(res)
is.character(res)
print(res)
res$testname
res$.match
res$`.2`
res[, ".2"]
res[, ".match"]
res[, "testname"]
# }

Run the code above in your browser using DataLab