That doesnt look very Y3K compliant :-P
If you have complex logic then best thing to do is to create a custom date
validator.
The code would be really simple and will catch cases where people might
enter in:

19/39/1000

Btw.. why not just use the date validator? It will handle exactly that
format easily

-Tim

-----Original Message-----
From: Andy Kriger [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 4:44 PM
To: Struts Users Mailing List
Subject: RE: Valid Regexp for MM/dd/yyyy matching in a string?


Looks like it should work, you might need to escape the slashes.

It's easy enough to test either by using grep on the command line (which is
not the best test since there are differences btw Unix regexp and Java
regexp) or by writing a test class that uses the ORO library (Validator
doesn't use the Java regexp package) or by using the ORO test applet at
http://jakarta.apache.org/oro/demo.html.

-----Original Message-----
From: David Erickson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 16:28
To: Struts Mailing List
Subject: Valid Regexp for MM/dd/yyyy matching in a string?


Here is what I came up with.. I don't know if its valid or not but I'd like
it to match a date in the format MM/dd/yyyy for parsing.

<var-name>mask</var-name>

<var-value>^[0-1]{1}[0-9]{1}/[0-3]{1}[0-9]{1}/[1-2]{1}[0-9]{3}$</var-value>



Thanks!

-David




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to