Need regular Expression

Posted by Udaysimha under ASP.NET on 8/16/2013 | Points: 10 | Views : 682 | Status : [Member] | Replies : 1
Hi,

I have a text box that should accept 06182013-1 format data only. The first part(06182013) is date ,so its length is always 8, the second part(1) is record number and it may be between 1 to maxnumber. So i need a Regular Expression to validate this data in Asp.net.

Please help me. Advanced Thanks.

Uday

uday


Responses

Posted by: Bandi on: 8/19/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
May be try this expression value in regular expression control
^([1-9]|0[1-9]|1[0-9]|2[0-9]|3[0-1])([1-9]|0[1-9]|1[0-2])(1[9][0-9][0-9]|2[0][0-9][0-9])$ for "DDMMYYYY"
^([1-9]|0[1-9]|1[0-9]|2[0-9]|3[0-1])([1-9]|0[1-9]|1[0-2])(1[9][0-9][0-9]|2[0][0-9][0-9])-\d$ for "DDMMYYYY-X"  


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Udaysimha, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response