Description Usage Arguments Value Examples
View source: R/str_group_extract.R
Extract Regular Expression Groups
1 | 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
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.