tags:

views:

66

answers:

1

Hi..all

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:

  1. The username will be created in the above format.
  2. first 5 characters(xyz\) are same for every username with the slashes.
  3. Only "t4z4567" will be changed for every user.

Please provide me the solution.

+1  A: 

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 :

"xyz\\\\[a-zA-Z]\d[a-zA-Z]\d{4}"

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 :

"xyz\\\\\w{6}"
Thibault Falise
+1 for a courageous guess :)
Tim Pietzcker
definitely...i will mark it as accepted when it works..thanks for the reply
karthik
Thanks...Thibault ....it worked...thanks a lot for saving me...
karthik