\r\n\r\n
Regular Expressions Topics include: System.Text.RegularExpressions classes, and .NET regular expression syntax.

Go Back  Xtreme .NET Talk > .NET > Regular Expressions > date validation.


\r\n \r\n \r\n \r\n
 
 
Thread Tools Display Modes
\r\n \r\n
\r\n
\r\n \r\n i have the following date vaidation regex pattern:
\r\n[0-3]\\d-(JAN|FEB|
\r\nMAR|APR|MAY|JUN|J UL|
\r\nAUG|SEP|OCT|NOV|D EC)
\r\n-\\d{4}
\r\n
\r\ni now its fine...i think that the days pattern is somewhat wrong isnt it?
\r\ni mean you can enter nubers bigger then 31 right?
\r\nso any idea how to fix it????\r\n
\r\n
\r\n \r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n'; pd[426933] = '\r\n\r\n \r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n \r\n\r\n
\r\n
\r\n  \r\n #2  \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n Old\r\n \r\n 09-07-2004, 11:51 AM\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n John_0025\r\n John_0025 is offline\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
Quote:
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n Originally Posted by John_0025\r\n \r\n
\r\n
It would also match 00 as the day and allow some unrealistic years (actually depends what you are doing. Anyway show how to only allow year 19xx or 20xx)
\r\n
\r\n
\r\n
Code:
\r\n
(0[1-9]|[12][0-9]|3[01])-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)-(19|20)\\d\\d
\r\n
\r\n \r\n
\r\n
sweeeeeeet!!! thanx again mate!
\r\nim starting to understand this regexp thingy....(heared about it only before 2 days ago) \r\n
\r\n
\r\n \r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n'; // next/previous post info pn[426921] = "426937,426933"; pn[0] = ",426921"; pn[426933] = "426921,426937"; pn[426937] = "426933,426921"; // cached usernames pu[0] = guestphrase; pu[36445] = "FlyBoy"; pu[35515] = "John_0025"; // -->
Prev Previous Post   Next Post Next
  #1  
Old 09-07-2004, 09:21 AM
FlyBoy FlyBoy is offline
Centurion
 
Join Date: Sep 2004
Posts: 106
FlyBoy is on a distinguished road
Default date validation.

i have the following date vaidation regex pattern:
[0-3]\d-(JAN|FEB|
MAR|APR|MAY|JUN|J UL|
AUG|SEP|OCT|NOV|D EC)
-\d{4}

i now its fine...i think that the days pattern is somewhat wrong isnt it?
i mean you can enter nubers bigger then 31 right?
so any idea how to fix it????
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
date drop down list validation son ASP.NET 5 05-04-2004 11:10 AM
Date Validation andycharger General 1 02-05-2004 06:15 AM
Date Validation in a text box dhj ASP.NET 5 01-20-2004 06:14 AM
MSDN - date validation - cant work for me lsemun ASP.NET 0 06-15-2003 02:27 AM
date validation using validation controls arun_mrk ASP.NET 6 04-01-2003 09:35 PM

Advertisement:

Powered by liquidweb