I need to find all strings containing double letters in positions between 4th and 10th inclusive.
I can find all double letters by
'([a-zA-Z])\1{1,3}';
and positions by
SELECT SUBSTRING(columnmame, 4, 9 ) FROM mytable;
but I do not know how to combine them?
so that the following examples are found:
Liverpool;
Sheffield Central.
but not
Arran.
I have tried
WITH cte AS (
SELECT *, SUBSTRING(columnmame, 4, 9) AS c
FROM mytable
)
SELECT *
FROM cte
WHERE c REGEX '([a-zA-Z])\1{1,3}';
I am aware that MariaDB does not support backreferences such as '\1'.