+ 1
can you explain me
can u explain me function CheckPassword(txt) { var passw= /^[A-Za-z]\w{7,14}$/; // just explain me this line if(txt.value.match(passw)) { alert('Correct, try another...') return true; } else { alert('Wrong...!') return false; } } /^[A-Za-z]\w{7,14}$/ some how i get it that any lowercase and any uppercase but after that why \w{7,14}$/ please anyone can explain me
2 Réponses
+ 8
^ stand for start of string
[A-Za-z] stand for one occurence of any of char range
\w stand for word char (ie: any alphanumeric char, including underline char)
{7,14} specify than previous \w need to be found between 7 and 14 times
$ stand for end of string (in some context, also mark new line)
+ 2
Hi, that is to validate the length of password is between 7 to 14 characters