struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jarnot Voytek Contr AU HQ/SC <Voytek.Jar...@MAXWELL.AF.MIL>
Subject RE: Struts Validator 4 digit numeric
Date Wed, 27 Nov 2002 15:14:29 GMT
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>


Mime
View raw message