Regex in JavaScript to reject three consecutive characters

I'm new to Regex and it would be great if someone can help me write a JS regex to reject 3 consecutively repeated characters.

+3


source to share


1 answer


Regular expression:

/(.)\1\1/

      



will match a string containing three repeated characters.

+9


source







All Articles