Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
sir, i have a validationExpression for Date dd/MMM/yyyy like:-

"^(([0-9])|([0-2][0-9])|([3][0-1]))\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\-\d{4}$"

but i need validationExpression for dd/MMM/yyyy and dd-MMM-yyyy for both date formate
in single expression. how can i do it.
Posted

1 solution

Replace the "\-"s in your regex with "[-/]":
^(([0-9])|([0-2][0-9])|([3][0-1]))[-/](Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[-/]\d{4}$
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900