I need strong password validation regex
Special Characters - Not Allowed
Spaces - Not Allowed
Numeric Character - At least one character
At least one Capital Letter
Minimum and Maximum Length of field - 6 to 12 Characters
Repetitive Characters - Allowed only two repetitive characters
my Regex is ^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s)(?=(?:(\w)(?!\1{2}))+).{6,12}$
but it ignores special characters (where to add?)
Please help!
Met by
[a-zA-Z0-9@]{6,12}Met by positive lookahead
(?=.*\d)Met by positive lookahead
(?=.*[A-Z])I am not sure what you mean by this. The negative lookahead
(?!.*(.)\1\1)makes sure that no character is allowed to appear more than two times in a row. Substringaais okay,aaais not.Make it
(?!.*(.+)\1\1)to reject repeated substrings of length more than one (likeababab) or add.*before\1to reject non-continuous repeated appearances too.