regex to match repeated consonant

Try this:

([b-df-hj-np-tv-z])\1{2,}

Explanation:

  • [b-df-hj-np-tv-z] are all the consonants
  • \1 is the back reference to the 1st group (ie the same character)
  • {2,} means "2 or more of the preceding term", making 3 or more in all

See live demo.


This is about the shortest regex I could think of to do it:

(?i)([b-z&&[^eiou]])\1\1+

This uses a regex character class subtraction to exclude vowels.
I didn't have to mention "a" because I started the range from "b".
Using (?i) makes the regex case insensitive.

See a live demo.


There may be shortcuts in certain regex libraries but you can always...

b{3,}|c{3,}|d{3,}...

Some libs for example let you match using a back reference which may be a tad cleaner...

(bcd...)\1{2,}