str_group_extract: Extract Regular Expression Groups

Description Usage Arguments Value Examples

View source: R/str_group_extract.R

Description

Extract Regular Expression Groups

Usage

1

Arguments

string

string to extract from

pattern

pattern with groups to match

group

groups to extract

nas

return NA values (TRUE) or filter them out (FALSE)

Value

string vector or string matrix

Examples

1
2
3
4
strings <- paste(LETTERS, seq_along(LETTERS), sep = "_")
str_group_extract(strings, "([\\w])_(\\d+)")
str_group_extract(strings, "([\\w])_(\\d+)", 1)
str_group_extract(strings, "([\\w])_(\\d+)", 2)

dsmisc documentation built on Sept. 13, 2020, 5:21 p.m.