I am trying to use a regular expression for name field in the asp.net application.
Conditions:name should be minimum 6 characters ?
I tried the following
"^(?=.*\d).{6}$"
I m completely new to the regex.Can any one suggest me what must be the regex for such condition ?
Look at Expression library and choose user name and/or password regex for you. You can also test your regex in online regex testers like RegexPlanet.
My regex suggestions are:
This regex accepts user names with minimum 6 characters, starting with a letter and containing only letters, numbers and “.”,”-“,”_” characters.
Next one:
Similar to above, but accepts “.”, “-“, “_” and 0-9 to be first characters too.
If you want to validate only string length (minimum 6 characters), this simple regex below will be enough: