Extract Regular Expression Groups
Extract Regular Expression Groups
str_group_extract(string, pattern, group = NULL, nas = TRUE)
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) |
string vector or string matrix
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.