A regular expression to match consecutive occurrences of the same character in a string. match a character that occurs x times (3 times in this regex) in a row in a string.
/([a-zA-Z0-9])\1{2}/
Matches:
- Regggex
- 2211122
- Reggggex
Non-matches:
- Reggex
- 221122
See Also:
- Regex To Match Characters Repeated More Than A Specified Number Of Times
- Regular Expression To Check For Repeating Numbers