Count regex matches
Counts how many times a regular expression matches within each string.
s (String | List | Vector): The
input string(s).
pattern (String): The regular
expression to count.
The number of matches.
str_count("banana", "a")
-- Returns = 3