You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dale Newfield <Da...@Newfield.org> on 2007/11/08 18:01:24 UTC
Re: [struts] [S1.3]Strange problem with validation.xml's Regex
enthucoder wrote:
> I am validating a condition : Input should not contain any of these
> characters &,",<,>,%,(,)
>
> And to achieve this my RegEx is : ^[^(\&|"|<|>|%|\(|\))]+$
That should be: ^["&<>%()]*$
(using + instead of * at the end adds the restriction that the field
must contain at least one character).
The other problem you're having is that you're putting this in an XML
document. Either it must be valid XML (for example, & -> &), or it
must be enclosed in a CDATA block.
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [struts] [S1.3]Strange problem with validation.xml's Regex
Posted by Dale Newfield <Da...@Newfield.org>.
Dale Newfield wrote:
> enthucoder wrote:
>> I am validating a condition : Input should not contain any of these
>> characters &,",<,>,%,(,)
>> And to achieve this my RegEx is : ^[^(\&|"|<|>|%|\(|\))]+$
>
> That should be: ^["&<>%()]*$
D'oh! That should be: ^[^"&<>%()]*$
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org