I'm totally new with regualr expressions and I have to build one with the following requisites:
between 8 and 15 chars
at least 1 alphabetic char (a-z,A-Z)
at least 1 non alphabetic (all the others)
at least 1 CAPITAL letter
at least 1 non-capital letter
maximum of 2 consecutive equal chars (e.g.: 'g' accepted, 'gg' accepted, 'ggg' not)
I tried with this one, but it works only with a maximum of 5 consecutive equal chars (dont understand why). What I'm doing wrong?
var regexp = /^((?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z])(.{8,15})(?!.*(.)\1{2}))$/;
EDIT it works with
asdfghjkl1Q
asdfghjkl1QQQ
asdfghjkl1QQQQQ
it not works with
asdfghjkl1QQQQQQ
asdfghjkl1QQQQQq
what i'm trying to obtain is: WORKING with :
asdfghjkl1Q
asdfghjkl1QQ
asdfghjkl11
NOT WORKING with:
asdfghjkl1QQQ
asdfghjkl1QQq
asdfghjkl111