Question: How can I find occurences of same subsequent characters in a string with a regular expression or function?

Example:

> 
> I am l​**ee**​t and I have a thr​**ee**​ pi​**zz**​as. That n​**oo**​b right there has only one pi​**zz**​a. P​**oo**​r boy.
> 
> 
>

Answer: 
You can use a [backreference](http://www.regular-expressions.info/brackets.html#usebackrefinregex):

```
/(.)\1/

```

Change `\1` to `\1+` if you want to find sequences of length two or more.

Note that the syntax can vary depending on the regular expression engine you are using.
This should work ................ `(.)\1+`