Need Flex Regex Validation Expression for password that allows for only alphanumeric values and requ
Posted
by BlueDude
on Stack Overflow
See other posts from Stack Overflow
or by BlueDude
Published on 2010-04-19T06:34:03Z
Indexed on
2010/04/19
6:53 UTC
Read the original article
Hit count: 349
Hi I'm trying to setup a RegexpValidator that only accepts a string of alphanumeric characters between 6-30 characters long and requires one number. I'm new to Regular Expressions and everything I've tried seems to keep returning an invalid ValidationRsultEvent. Here's a chunk of code:
<mx:RegExpValidator id="regexValidator" source="{passwordInput}" property="text"
triggerEvent="" valid="onPasswordValidate(event)" invalid="onPasswordValidate(event)" />
private function validateRegister():void
{
regexValidator.expression = "^(?=.*(\d|\W)).{6,30}$";
regexValidator.validate();
}
© Stack Overflow or respective owner