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

colct
random 123 text 456 test2

© 2017-2021 LogicHub®. All Rights Reserved.