regexp_count(string, pattern)

Count the number of matches that are found in the string for the regular expression pattern.

Example

vowels = regexp_count("the quick brown fox", "[aeiou]")