473,396 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help on Regular experession to validate date

Hi,

I want to use RegularExpressionValidator to validate a date

I want to let user to enter date in the following format

one or two digits for day
one or two digits for month
two or four digits for year
User should be allowed to use as date Separator either . or - or /

So this should be valid date

1/11/03
21.5.2004
3-11-00

If I use the following regular expression it allows only . as date separator
\d{1,2}\.\d{1,2}\.(\d{2}|\d{4})
I tryed the following sequence for separator, to allow any of the three I
mention above, but it doesn't works.
(\.|\-|\/)
I tried with the following one too
(.|-|/)
None of them are working

Can anyone tell me what I did wrong?

Thank you.
Bogdan


Nov 17 '05 #1
0 882

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

Similar topics

1
by: dcinfinite | last post by:
hi.. i have a few other questions 2 ask..i used the "calender" function to insert Date of Birth for my "add customer form" is that advisible?coz i feel it'll be easy for customers to just click...
6
by: paulsmith5 | last post by:
Hi, I have the following regular expression to validate a date-time field in European or d/m/y h:m:s format. ...
2
by: Christian Staffe | last post by:
Hi, I would like to check for a partial match between an input string and a regular expression using the Regex class in .NET. By partial match, I mean that the input string could not yet be...
4
by: Frank Rocco | last post by:
Hello, What is the best way to validate a textbox to see if it contains a valid date or a valid time or both? Thanks Frank
2
by: Bogdan Zamfir | last post by:
Hi, I want to use RegularExpressionValidator to validate a date I want to let user to enter date in the following format one or two digits for day one or two digits for month two or four...
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
22
by: deepak.rathore | last post by:
can someone give the regular expr. to validate leap yr like 02/29/2000,02/29/00 Thanks
6
by: Wayne Wengert | last post by:
I hope this is an appropriate group for this question - if not, let me know where I should take this question. I want a regular expression that will validate a date in the format mm/dd/yyyy. I...
23
by: codefire | last post by:
Hi, I am trying to get a regexp to validate email addresses but can't get it quite right. The problem is I can't quite find the regexp to deal with ignoring the case james..kirk@fred.com, which...
3
by: samuelberthelot | last post by:
Hello, I would like to validate a date in a textbox on the onChange event. The date must be in the format 01/01/2007 I would like to use a regular expression to validate it but I'm not very...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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 project—planning, coding, testing,...

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.