I'm trying to check some date input to a Web form. The formats I accept are 'mm/dd/yy, m/d/yy, mm/dd/yyyy, m/d/yyyy'.
Here's the regex I'm using to check:
( $date=~/^((\d\d?)\/(\d\d?)\/(((\d{2,2}))|(\d{4,4})))($|(,(\s*)((\d\d?)\/(\d\d?)\/(((\d{2,2}))|(\d{4,4}))))+$)/ )
Basic component is:
((\d\d?)\/(\d\d?)\/(((\d{2,2}))|(\d{4,4})))
then either end the line:
$
or go on with a comma, optional white space and repeat of the basic component and finally anchor to the final line end.
Thanks.
(Please copy [EMAIL PROTECTED] on responses as I digest. Thanks.) -- Peter Fleck University of Minnesota Cancer Center [EMAIL PROTECTED] www.cancer.umn.edu
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]