0
I am trying to validate a password through Regexp, in javascript, but it only returns false when it should actually return true, for having given match value, someone would know if there is something wrong with my code?
$scope.verifyPasswordIsValid = function (a , b) {
var digits_4 = new RegExp("^(\d\d)\d{0,4}\1$");
var seq_number = new RegExp("^1*2*3*4*3*2*1$");
var seq_alphab = new RegExp("^a*b*c*d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*$");
console.log("reg alp: "+seq_alphab.test(a));
console.log("reg 4: "+digits_4.test(a));
console.log("reg number: "+seq_number.test(a));
}
Related http://answall.com/questions/42459/express%C3%A3o-regular-n%C3%A3o-works-correctly-in-webform/42486#42486
– Guilherme Lautert
Examples of passwords you are testing must be correct and incorrect.
– Guilherme Lautert
for digits-4 to using "1111", for seq_number to using "1234", for seq_alphab to using "abcd", i.e.
– Victor Siqueira