You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Peter Courcoux <pe...@courcoux.biz> on 2004/01/01 00:36:59 UTC

Re: Regular Expression Questions

Hi Brian,



On Wed, 2003-12-31 at 15:34, brian janaszek wrote:
> 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?
> 

My recollection is hazy but try '[A-Za-z]*'. I think you need to specify
that you are matching all the characters not just one. But I may have
the syntax wrong...

Regards,

Peter


> 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



-- 
Peter Courcoux <pe...@courcoux.biz>

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org