.net - regex for alphanumeric, but at least one character -
In my asp.net page, I have an input box that should have the following verification:
Must be alphanumeric, with at least 1 character (i.e. all numbers can not be).
^ \ d * [a-zA-Z] [a-zA-Z0- 9] * $
In fact it means:
- Zero or more ASCII points;
- An alphabetical ASCII character;
- Zero or more alphanumeric ASCII characters.
Try some tests and you'll see that it will pass an alphanumeric ASCII string where at least one non-numerical ASCII character will be required.
The key is on the \ d *
front without it the regex becomes more odd to do it.
Comments
Post a Comment