RegularExpression code for server-side validation of Date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does someone have RegularExpression code (C# WebForm) for server-side validation of Date (mm/dd/yyyy) ... including leap year?
 
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.
 
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.
 
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?
 
Back
Top