473,473 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Date validation

Hello,

Can anyone recommend me a regular expression that could validate any date
format, including military - dd-MMM-yyyy, i.e. 1-Mar-2007. I've found many
datetime validation expressions, but not for this format.

Thank you,

--
Peter Afonin
Mar 6 '07 #1
4 4801
Hi

here's a sample that works partialy

\d{1,2}\-[A-Za-z]{3}\-\d{4}

or if you want to be more specific

\d{1,2}\-[Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec]\-\d{4}

Adlai

--
-------------------------------------
If my answer helped you please press "Yes" bellow

אם תשובה זו עזרה לך, א*א הצבע "כן"

Adlai Maschiach
http://blogs.microsoft.co.il/blogs/adlaim/
"Peter Afonin" wrote:
Hello,

Can anyone recommend me a regular expression that could validate any date
format, including military - dd-MMM-yyyy, i.e. 1-Mar-2007. I've found many
datetime validation expressions, but not for this format.

Thank you,

--
Peter Afonin
Mar 6 '07 #2
Hi,

You can try microsoft ajax control library and can use mask edit for date
plz refer
http://ajax.asp.net/ajaxtoolkit/Mask...askedEdit.aspx

Cheers
Chetan Chaphekar

"Peter Afonin" wrote:
Hello,

Can anyone recommend me a regular expression that could validate any date
format, including military - dd-MMM-yyyy, i.e. 1-Mar-2007. I've found many
datetime validation expressions, but not for this format.

Thank you,

--
Peter Afonin
Mar 6 '07 #3
Thank you for all your suggestions.

Peter

On Mar 6, 3:01 am, Chetan Chaphekar
<ChetanChaphe...@discussions.microsoft.comwrote:
Hi,

You can try microsoft ajax control library and can use mask edit for date
plz referhttp://ajax.asp.net/ajaxtoolkit/MaskedEdit/MaskedEdit.aspx

Cheers
Chetan Chaphekar

"PeterAfonin" wrote:
Hello,
Can anyone recommend me a regular expression that could validate any date
format, including military - dd-MMM-yyyy, i.e. 1-Mar-2007. I've found many
datetime validation expressions, but not for this format.
Thank you,
--
PeterAfonin- Hide quoted text -

- Show quoted text -

Mar 6 '07 #4
On Mon, 5 Mar 2007 19:12:45 -0800, Peter Afonin wrote:
Hello,

Can anyone recommend me a regular expression that could validate any date
format, including military - dd-MMM-yyyy, i.e. 1-Mar-2007. I've found many
datetime validation expressions, but not for this format.

Thank you,
Hey Peter,

If you want to validate *ANY* date format I would advise before resorting
to wrestling with the many many regular expressions (since there are many
many valid date formats) first of all try to minimize the need to validate
dates by using controls that are aware of dates ... like calendars or date
pickers. This way you minimize code and effort and make it easier for users
to input data

--
Bits.Bytes
http://bytes.thinkersroom.com
Mar 6 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: Dr John Stockton | last post by:
It has appeared that ancient sources give a method for Numeric Date Validation that involves numerous tests to determine month length; versions are often posted by incomers here. That sort of code...
0
by: Brian Conway | last post by:
I am having some validation and insertion problems. I am using a date picker that takes the selected date and puts it to ("dd-MMM-yyyy") format, as this was the only format that Oracle would...
7
by: Paul | last post by:
Hi, I have a form where a user is required to enter a start date and an end date. Both are required and must between a specific date range (e.g. 01/01/1900 and 01/01/2099) and the end date...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
12
by: Diego | last post by:
Can I validate (possibly with a compare validator) a Date entered by the user based upon his regional settings? I.e. if a user is american the format would be mm/dd/yyyy, if brittish dd/mm/yyyy...
1
by: Brendan Reynolds | last post by:
In an ASP.NET 1.1 app I have the following range validation control. This is an intranet app that will be used only within Ireland, so all date input is expected to be in dd/mm/yyyy format. ...
17
by: Petyr David | last post by:
Just looking for the simplest. right now my perl script returns an error messge to the user if the date string is invalid. would like to do this before accessing the server. TX
3
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
I have VS 2005 (C#) There is a control numericUpDown so you can spin numeric values. What I need to do is to spin date (+- one day). How to do that? Moreover, I want a user to type the date as...
2
by: John Smith | last post by:
Hello, I have a VB.NET application with a Windows form that have several textboxes fields where I have dates entered. I would like to do a date validation check after the the field is updated, so...
5
Stang02GT
by: Stang02GT | last post by:
I have been asked to validate a date on our web-page so that people cannot enter dates like 14/1/08 or 2/30/06. I have found code that will do exactly what i need it to do, but i am not sure how to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.