regexp_count

Count the number of matches of a regex pattern in a given string.

Usage Details

Input
table

col

random 123 text 456 test

select *, regexp_count(col, '\\d+') as ct from table

Output

col

ct

random 123 text 456 test

2


Did this page help you?