CompareValidator can easily handle the request. Regular expressions are
complicated and have limitations like the inability to recognize a legal
date value.
The CompareValidator uses the current thread's CultureInfo
(System.Threading.Thread.CurrentThread.CurrentUICulture) to determine the
date format.
You can set the culture with your desired date format in <@ Page culture= >
or on CurrentUICulture in Page_Load(). See the .net docs on the CultureInfo
class to learn how to create them and the culture IDs for your culture.
You can also modify a cultureInfo to set the desired format:
CultureInfo.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy"
CultureInfo.DateTimeFormat.DateSeparator = "/"
Hint: You cannot modify the CultureInfo object assigned by default to
CurrentUICulture. Clone it or create a new instance. These you can modify.
--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx