Using .NET regular expressions.
Let’s say I have the following text:
ddddddddddd
And I would like to test for a repetition of more than 2 for any character.
The regex should not return a match for a text containing double letters like the word “look”.
UPDATE
Do not assume the input text only consists of repetition of the letter d.
I want ANY repetition of characters.
Try this
See it here on Regexr
The
.matches any character, this character is stored in group 1, because of the brackets around it. The\1{2,}checks then for 2 or more of this character (together with the originally matched character then 3 or more.)