powered by
string
pattern
str_extract_all(string, pattern)
regex
fixed
str_extract
shopping_list <- c("apples x4", "bag of flour", "bag of sugar", "milk x2") str_extract_all(shopping_list, "[a-z]+") str_extract_all(shopping_list, "\\b[a-z]+\\b") str_extract_all(shopping_list, "\\d")
Run the code above in your browser using DataLab