Higher_Attitude Higher_Attitude - 3 months ago 7
SQL Question

Find any character occur more than 4 times

I want to find any character occurs between 4 and 10 times, I used

REGEXP_LIKE
but it's valid just for one character 'a' , I want to find for all alphabet:

SELECT regex_test_name
FROM regex_test
WHERE REGEXP_LIKE(regex_test_name, 'a{4,10}')

Answer
SELECT regex_test_name
FROM regex_test
WHERE REGEXP_LIKE(regex_test_name, '([[:alpha:]])\1{3,9}')

Inspired by dnoeth's answer, but since it catches the first character, specifying 3-9 subsequent repeats means 4-10 successive occurences in total.