I'm looking into using a jQuery password strength indicator and have found one that looks suitable.
It increases the password strength score if special characters are detected:
if (password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)){ score += 5 ;}
However I'd like to be able to specify additional special characters and because these lists of special characters are used in several places, I'd like to only specify the list once:
list = array(!,@,#,$,%,^,&,*,?,_,~,[,],{,},(,));
if (password.match(/(.*[list].*[list])/)){ score += 5 ;}
Is this possible?