I am looking for a regex that will find repeating letters. So any letter twice or more, for example:
booooooot or abbott
I won’t know the letter I am looking for ahead of time.
This is a question I was asked in interviews and then asked in interviews. Not so many people get it correct.
You can find any letter, then use
\1to find that same letter a second time (or more). If you only need to know the letter, then$1will contain it. Otherwise you can concatenate the second match onto the first.