Here is the regular expression that I am trying to modify:
The client only wants the user to be able to enter a maximum of 2 of the same consecutive characters.
^[a-zA-Z0-9-().\&\@\?\""#,\+\''\s\/]{7,}$
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use a look-ahead assertion:
Here the negated look-ahead assertion
(?!\1\1)is tested for each character that is matched by([a-zA-Z0-9-().&@?"#,+'\s\/]). It looks at the next two following characters and tests if they are the same as the previously matched one. If this is not the case, the negated look-ahead assertion is fulfilled.