struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Rosen" <JRo...@yvimail.com>
Subject RE: Struts Validator 4 digit numeric
Date Wed, 27 Nov 2002 15:38:46 GMT
One of the best regex resources are the PERL man-pages:
http://www.perldoc.com/perl5.8.0/pod/perlre.html

Jason

-----Original Message-----
From: Greg Dunn [mailto:greg.dunn@nisc.cc]
Sent: Wednesday, November 27, 2002 7:28 AM
To: Struts Users Mailing List
Subject: RE: Struts Validator 4 digit numeric


Yes, I did try that, it causes the same  "Nested repetitions *?+ in
expression" error.  However removing the * seems to have fixed things.  I
thought the * had to be in the mask expression in validation.xml because it
was in all the examples I read in the docs.  Where can I find a good Reg.
Expression tutorial?  Thanks.

Greg



-----Original Message-----
From: Jarnot Voytek Contr AU HQ/SC [mailto:Voytek.Jarnot@MAXWELL.AF.MIL]
Sent: Wednesday, November 27, 2002 9:14 AM
To: 'Struts Users Mailing List'
Subject: RE: Struts Validator 4 digit numeric


Did you try ^\d{4}$
Why do you include the * in your regexp - I think that's what's breaking it.

--
Voytek Jarnot


-----Original Message-----
From: Greg Dunn [mailto:greg.dunn@nisc.cc]
Sent: Wednesday, November 27, 2002 9:07 AM
To: Struts Users Mailing List
Subject: Struts Validator 4 digit numeric


I'm trying to use Struts Validator to validate a 4 digit numeric using a
mask:

<field
   property="ssn"
   depends="mask">
       <arg0 key="register.form.ssn.displayname"/>
       <var>
           <var-name>mask</var-name>
           <var-value>^[0-9]{4}*$</var-value>
       </var>
</field>

Which causes:

"Invalid expression: ^[0-9]{4}*$ Nested repetitions *?+ in expression"

The expression ^[0-9]^4*$ causes no exception but it throws out '0000' as
not
valid.  (Obviously I have work to do on regular expressions.)  Any
assistance is appreciated.


Greg


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message