re_match_all: Extract all matches of a regular expression

Description Usage Arguments Value

Description

This function is a thin wrapper on the gregexpr base R function, to provide an API that is easier to use. It is similar to re_match, but extracts all matches, including potentially named capture groups.

Usage

1

Arguments

pattern

Regular expression, defaults to be a PCRE expression. See regex for more about regular expressions.

text

Character vector.

...

Additional arguments to pass to regexpr.

Value

A list of character matrices. Each list element contains the matches of one string in the input character vector. Each matrix has a .match column that contains the matching part of the string. Additional columns are added for capture groups. For named capture groups, the columns are named.


MangoTheCat/rematch documentation built on May 8, 2019, 3:49 p.m.