-
Regular expression
Hello, I am trying to validate a password that must be at least 2 letters, 2 numbers and at least 8 characters. I created this regular expression:
Code:
function validar_Pass(passVal:String):Boolean{
var pw:RegExp = /^?=.{8,}[A-Za-z]{2,}[0-9]{2,}/;
return(pw.test(passVal));
}
But it didn't validate.
What did I do wrong?
Thank you.
-
This should work, isn't it? Or is there any mistake in the code?
-
Senior Member
Here is the summary I hate people like you who judge my favorite password.
But seriously, check out http://regexpal.com/ for testing your regular expressions.
For your specific example, ?= means "followed by", right, so there must be something before ?= and that something would be a match, not stuff after ?=
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|