it was used in this codewar challenge. and i find i really interesting.
Also u can Write it like this if you want /(.)\1+/g it works exactly the same
/(.)\1+/g