I need a Regular expression to validate string for below rules.
- String should not contain any repeated characters more than 2 times.
- String should not allow special characters like &, <, %
So far I managed to create regular expression
/(?!(.)\1{2,})^([a-zA-Z0-9''\.\-\,]+\s?)*$/i
which validates rules 1 & 2. But only problem what I have is it only validates rule at the start of string.