RegEx question: force format for ##-XXX-####

  • Thread starter Thread starter DMG
  • Start date Start date
D

DMG

I have used Regular Expressions very little! I have a textbox that I
want to limit the data entered to be a date in the format as such:

14-Feb-2004

Two numbers {dash} Three characters {dash} Four numbers

I don't care about checking for validity. I have tried the RegEx
Library website but can't find anything in this format.

Can anyone help? It is GREATLY appreciate!

Thanks!
 
This regex should do what you asked (two digits, 3 letters, 4 digits)

[\d]{2}-[a-zA-Z]{3}-[\d]{4}
 
Back
Top