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: 
Not sure which version of regex you're working with, but for `egrep`, this works:

```
egrep '(.)\1' < file

```

That will show all lines that have two of some character in a row. If you want just letters:

```
egrep `([A-Za-z])\1' < file

```

would work.
Like this in a perl flavour. `\w` matches a word character, and `\2` matches second parentheses.

```
m/((\w)\2+)/g

```