Actually Extract All Patterns
Arguments
- str
A string or vector of strings
- pattern
A regex pattern. If you want to extract multiple terms, use the regex or operator. (For 'one' or 'two':
one|two
)
Examples
c(
'oneightwo',
'1two3four'
) |>
strg_extract_all('one|two|three|four|five|six|seven|eight|nine|[1-9]')
#> [[1]]
#> [1] "one" "eight" "two"
#>
#> [[2]]
#> [1] "1" "two" "3" "four"
#>