str_count

Count regex matches

Counts how many times a regular expression matches within each string.

Parameters

Returns

The number of matches.

Examples

str_count("banana", "a")
-- Returns = 3