what is the regular expression to check if a string has no more than 2 repetitive character? : <p>Hi i have a requirement to check on passwords . the password should not contain no more than 2 repetitive character.</p>

<p>my password must contain atleast upper case, lower case, number and special characters #?!@$%^&amp;*-</p>

<p>so if i have a password like for example</p>

<p>Password123$ it is valid
Passsword123$ it is invalid
Passssword123$ it is invalid
PPaassword123$$ valid
PPaassword123$$$ it is invalid</p>

<p>please help me
thank you </p>
