Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,15})$
|
Description |
I built this expression to test a string in ASP for valid username and password constraints. It can be adapted for any number of scenerios. For instance in this case, we needed to ensure the username someone wanted was not all numbers or all letters and was 6-15 characters in length with no special characters. This expression tests negatively for all number cases, then all letter cases, and lastly tests for only alphanumeric characters in the required range. In other words: the match must be alphanumeric with at least one number, one letter, and be between 6-15 character in length.
|
Matches |
C2dfeed | sporttrak1 | 11223a
|
Non-Matches |
pookie | d34_fff | 123456
|
Author |
Rating:
Pete Lindquist
|
Displaying page
of
pages;
Items to