需要定期EX pression为DD-MMM-yyyy格式验证日期 [英] Need regular expression for validating date in dd-MMM-yyyy format
问题描述
我不以书面形式定期EX pressions所以需要你的帮助的专家。我想在DD-MMM-YYYY格式,即07军2012年来验证日期。我正在使用asp.net RegularEx pressionValidator。
任何人都可以帮我提供前pression?
感谢您分享您的时间。
使用一个datepicker可能是最好的办法。然而,因为这不是你问什么,这里有一个选项(虽然它是区分大小写):
<$p$p><$c$c>^(([0-9])|([0-2][0-9])|([3][0-1]))\\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\-\\d{4}$此外,这里就是你可以很容易地测试正防爆pressions的地方:<一href=\"http://www.regular-ex$p$pssions.info/javascriptexample.html\">http://www.regular-ex$p$pssions.info/javascriptexample.html
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 in asp.net.
Can anybody help me out providing the expression?
Thanks for sharing your time.
Using a DatePicker is probably the best approach. However, since that's not what you asked, here's an option (although it's case sensitive):
^(([0-9])|([0-2][0-9])|([3][0-1]))\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\-\d{4}$
In addition, here's a place you can easily test Regular Expressions: http://www.regular-expressions.info/javascriptexample.html
这篇关于需要定期EX pression为DD-MMM-yyyy格式验证日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!