reg_match {baizer} | R Documentation |
regex match
Description
regex match
Usage
reg_match(x, pattern, group = 1)
Arguments
x |
vector |
pattern |
regex pattern |
group |
regex group, 1 as default. when group=-1, return full matched tibble |
Value
vector or tibble
Examples
v <- stringr::str_c("id", 1:3, c("A", "B", "C"))
reg_match(v, "id(\\d+)(\\w)")
reg_match(v, "id(\\d+)(\\w)", group = 2)
reg_match(v, "id(\\d+)(\\w)", group = -1)
[Package baizer version 0.8.0 Index]