Hi Brian,

I don't think your regular expression is complete.  For example, 
abc123 will match the regular expression "[A-Za-z]".  I think you
need to specify the parts of the regexp that specify the beginning
end of the string:

^[a-zA-Z \\.]?$
^ means the start of the string
$ means the end of the string

might work.

Good luck,

David

-----Original Message-----
From: brian janaszek [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 31, 2003 7:35 AM
To: [EMAIL PROTECTED]
Subject: Regular Expression Questions


Hi--

Two questions regarding Intake and it's regular expression engine....

1. String validation.  I'm trying to enforce the following rule: an
input field for a user's name/prefix/suffix/alias can only contain
alphabet letters, spaces, and periods ('.').  I thought a regex like
this ("[A-Za-z]") would enforce letters only, but it also allows
digits.  I've found some regular expression tutorials, but the patterns
they suggest don't seem to work from within Intake.  Any suggestions?

2. Date validation.  I need be sure a date follows a particular format
(mm/dd/yyyy), and I need to be sure that the day indicated is
permissable for the given month (i.e.: 02/31/1922 is NOT valid).  The
format validation is easily done via Intake. The DateValidator in the
commons library seems to only do format validation.  Obviously this sort
of validation can be done via the GregorianCalendar class, but I'm
wondering if a package exists to do this sort of validation (as I don't
want to re-invent the wheel).

TIA,
b


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

Reply via email to