str_extract: Extract strings from a vector of strings

Description Usage Arguments

View source: R/str_extract.R

Description

Using only base regex, return a matching string based on the posssibilites entered in extract. Was intended to find a matching string when several possibilites exist. For example, when searching str_extract(c("Case_Two", "Case_One"), "One|Two"), the function will return the found regex in the order they were found in the vector of strings, i.e. c("Two", "One").

Usage

1
str_extract(string, extract)

Arguments

string

character string or vector containing expressions to look for

extract

Regular expression to look for in string


cfbeuchel/CarlHelpR documentation built on Dec. 24, 2019, 8:08 p.m.