0
regular expression validation

/t5/dreamweaver-discussions/regular-expression-validation/td-p/552736
Apr 24, 2007
Apr 24, 2007
Copy link to clipboard
Copied
i have a form password to be server validated
the password needs to be at least 8 characters with at least 1 being numeric.
this expression example that i found is supposed to be 6-8 characters with at least 1 letter
/^(?![0-9]{6,8})[0-9a-zA-Z]{6,8}$/
can anyone help change this expression to match my requirements?
i can see the {6,8} being {8,9} but not sure of the other changes?
thanks for your help
jim balthrop
the password needs to be at least 8 characters with at least 1 being numeric.
this expression example that i found is supposed to be 6-8 characters with at least 1 letter
/^(?![0-9]{6,8})[0-9a-zA-Z]{6,8}$/
can anyone help change this expression to match my requirements?
i can see the {6,8} being {8,9} but not sure of the other changes?
thanks for your help
jim balthrop
TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/regular-expression-validation/m-p/552737#M204743
Apr 24, 2007
Apr 24, 2007
Copy link to clipboard
Copied
Try:
^(?=.*[A-Za-z])(?=.*[\d])(?!.*[A-Za-z0-9])(?!.*s).{8,}$
That should require at least 8 characters with one digit.
It might be easier just to do separate tests, though. Up to you, really.
Pseudocode:
If Len(password) >= 8
RegExp = "[\D]"
stripped password = RegExp.Replace(password,"")
If Len(stripped password) > 0
OK!
Else
You forgot to include a number!
End
Else
That's not long enough
End
"jim balthrop" <webforumsuser@macromedia.com> wrote in message
news:f0lpte$blc$1@forums.macromedia.com...
>i have a form password to be server validated
> the password needs to be at least 8 characters with at least 1 being
> numeric.
>
> this expression example that i found is supposed to be 6-8 characters with
> at
> least 1 letter
>
> /^(?![0-9]{6,8})[0-9a-zA-Z]{6,8}$/
>
> can anyone help change this expression to match my requirements?
>
> i can see the {6,8} being {8,9} but not sure of the other changes?
>
> thanks for your help
> jim balthrop
>
>
^(?=.*[A-Za-z])(?=.*[\d])(?!.*[A-Za-z0-9])(?!.*s).{8,}$
That should require at least 8 characters with one digit.
It might be easier just to do separate tests, though. Up to you, really.
Pseudocode:
If Len(password) >= 8
RegExp = "[\D]"
stripped password = RegExp.Replace(password,"")
If Len(stripped password) > 0
OK!
Else
You forgot to include a number!
End
Else
That's not long enough
End
"jim balthrop" <webforumsuser@macromedia.com> wrote in message
news:f0lpte$blc$1@forums.macromedia.com...
>i have a form password to be server validated
> the password needs to be at least 8 characters with at least 1 being
> numeric.
>
> this expression example that i found is supposed to be 6-8 characters with
> at
> least 1 letter
>
> /^(?![0-9]{6,8})[0-9a-zA-Z]{6,8}$/
>
> can anyone help change this expression to match my requirements?
>
> i can see the {6,8} being {8,9} but not sure of the other changes?
>
> thanks for your help
> jim balthrop
>
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/dreamweaver-discussions/regular-expression-validation/m-p/552738#M204744
Apr 24, 2007
Apr 24, 2007
Copy link to clipboard
Copied
couldn't get that to work but i did find the answer on line
i found this expression for at least 1 numeral and at least 1 letter
/^\w*(?=\w*\d)(?=\w*[a-z])\w*$/
i ended up applying a seperate validation for the minimum characters of 8 and applied both the entry length and the regular expression validation to the password textbox
thanks for your help; it pointed me in the right direction
i found this expression for at least 1 numeral and at least 1 letter
/^\w*(?=\w*\d)(?=\w*[a-z])\w*$/
i ended up applying a seperate validation for the minimum characters of 8 and applied both the entry length and the regular expression validation to the password textbox
thanks for your help; it pointed me in the right direction
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

