I am developing a login form with User Name and Password. I want the user to create the username in a specified format. So i am using RegularExpressionValidator for the username. What is the Validation Expression for this format.
The format is:
xyz\\t4z4567 (characters are not case sensitive)
Rules:
- The username will be created in the above format.
- first 5 characters(xyz\) are same for every username with the slashes.
- Only “t4z4567” will be changed for every user.
Please provide me the solution.
Try this regular expression :
"[a-zA-Z]{3}\\\\[a-zA-Z]\d[a-zA-Z]\d{4}"Based on your edit, this one should be correct :
This expression is assuming the specific order of letters and digits as provided in your example. If the last 6 digits can all be letters or digits, then this expression should be sufficient :