| src | 指定要搜索的字符串 |
| pattern | 指定REGEXP_COUNT要搜索的正则表达式 |
| pos | position是一个整数值,用于表明REGEXP_COUNT要在源字符串中开始搜索的位置。缺省值为1。 |
| modifier | modifier用于指定控制模式匹配行为的值。缺省值为NULL。 |
CREATE OR REPLACE FUNCTION public.regexp_count(src text, pattern text, pos integer DEFAULT 1, match_param text DEFAULT 'g'::text)
RETURNS integer
LANGUAGE sql
IMMUTABLE STRICT NOT FENCED SHIPPABLE
AS $function$ SELECT count(1)::int FROM regexp_matches(substr($1, $3), $2, 'g'|| $4) $function$
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/bigdata/317271.html