RegularExpression code for server-side validation of Date

G

Guest

Does someone have RegularExpression code (C# WebForm) for server-side validation of Date (mm/dd/yyyy) ... including leap year?
 
G

Guest

One more question: How can I perform server-side validation on a string for U.S. currency

xxx,xxx or xxx,xxx.xx or xxxxxxx [any number of x's] pass. Other strings do not.
 
K

Kevin Spencer

The following web site sahould be helpful to you for this and future similar
problems:

http://www.regexplib.com/

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

mg said:
One more question: How can I perform server-side validation on a string for U.S. currency?

xxx,xxx or xxx,xxx.xx or xxxxxxx [any number of x's] pass. Other strings
do not.
 
P

Peter Blum

The CompareValidator will handle validating dates, integers, currencies and
decimal. Just set its Operator property to "DataTypeCheck" and the Type
property to the desired type. This system is more functional than using
regexs (as well as easier) in that it respects the culture of the page. For
dates, it also knows if a date is not legal.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

mg said:
Does someone have RegularExpression code (C# WebForm) for server-side
validation of Date (mm/dd/yyyy) ... including leap year?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top