c# - Modify Regular Expression for "dd/MM/yyyy" -


i have regular expression "dd/mm/yyyy" works fine,

"^([0]?[1-9]|[1][0-2])[./-]([0]?[1-9]|[1|2][0-9]|[3][0|1])[./-]([0-9]{4}|[0-9]{2})$" 

but want modify accepts 00/mm/2014. program interpret days in specific month. example 00/04/2014 means dates in month of april.

can tell me kind of change need make above script make happen?

here code using in :

<asp:textbox id="textbox5" runat="server" maxlength="1"  cssclass="maincontent"                          style="text-align:justify" validationgroup="mke" width="130px" />                      <asp:imagebutton id="imgbntcalc" runat="server" causesvalidation="false"                           imageurl="images\calendar-schedulehs.png" />                                     <asp:maskededitextender id="maskededitextender2" runat="server"                                          acceptnegative="left" displaymoney="left" errortooltipenabled="true"                                          mask="99/99/9999" masktype="date" messagevalidatortip="true"                                          onfocuscssclass="maskededitfocus" oninvalidcssclass="maskedediterror"                                          targetcontrolid="textbox5"  />                                          <asp:maskededitvalidator id="maskededitvalidator2" runat="server"                                          controlextender="maskededitextender2" controltovalidate="textbox5"                                          display="dynamic" emptyvalueblurredtext="*"  validationexpression="^(?:[012]?[0-9]|3[01])[./-](?:0?[1-9]|1[0-2])[./-](?:[0-9]{2}){1,2}$"                                         invalidvaluemessage="date invalid" validationgroup="mke1" />                                     <asp:calendarextender id="calendarextender1" runat="server"  format="dd/mm/yyyy"                                         popupbuttonid="imgbntcalc" targetcontrolid="textbox5" />  

well right it's built mm/dd/yyyy (the first group can contain 0-12). here's 1 works dd/mm/yyyy , allows 00 or 0 day:

"^([0]?[0-9]|[12][0-9]|[3][01])[./-]([0]?[1-9]|[1][0-2])[./-]([0-9]{4}|[0-9]{2})$" 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -