Hi!
I am using the validation frame work with sturts, to validate the input field for address I had given the mask in validation.xml as below:
<field property="address" depends="required,mask">
<arg0 key="agentProfileForm.address.NotEntered"/>
<var>
<var-name>mask</var-name>
<var-value>^[0-9a-zA-Z ',/#---]*$</var-value>
</var>
</field>
My intention of using 2 hyphens (---) in the mask is to allow the character '-' as a valid value, but when I do this special chracters like @,#,$ etc are also considered as valid characters.
How to allow hyphen '-' as a valid character?
Thanks in advance.
bye
RamPrasad.
Discussions
Web tier: servlets, JSP, Web frameworks: How to allow hyphen (-) in validation frame work
-
How to allow hyphen (-) in validation frame work (1 messages)
- Posted by: RamPrasad Suswaram
- Posted on: August 24 2004 05:41 EDT
Threaded Messages (1)
- In a normal regexp... by Rene Zanner on August 24 2004 08:25 EDT
-
In a normal regexp...[ Go to top ]
- Posted by: Rene Zanner
- Posted on: August 24 2004 08:25 EDT
- in response to RamPrasad Suswaram
...you have to use \- to escape the -.
Hope that helps,
René Zanner