Need regular expression for validating date in dd-MMM-yyyy format

后端 未结 8 1318
不思量自难忘°
不思量自难忘° 2020-12-31 17:57

I am not expert in writing regular expressions so need your help. I want to validate date in \"dd-MMM-yyyy\" format i.e. 07-Jun-2012. I am using RegularExpressionValidator i

相关标签:
8条回答
  • 2020-12-31 18:20
    "\d{4}\d{2}\d{2}|\d{2}/\d{2}/\d{4}|\d{2}.\d{2}.\d{4}|\d{2}\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)|(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\d{2}\-\d{4}|\d{4}-\d{2}-\d{2}"
    

    These format is mm.dd.yyyy, d-MMM, mm.dd.yyyy

    0 讨论(0)
  • 2020-12-31 18:25

    Regex without leading zero in day.

    ^\d{1,2}-[a-zA-Z]{3}-\d{4}$
    

    Update Regex with leading zero in day.

    ^\d{2}-[a-zA-Z]{3}-\d{4}$
    
    0 讨论(0)
提交回复
热议问题