You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Wendy Smoak <ja...@wendysmoak.com> on 2005/02/28 22:16:39 UTC
[validation] Help with 'contains' validation
I'm trying to validate a password such that it cannot contain the userId.
Is this something I can do in validation.xml?
I'm currently using a mask in validation.xml:
<field property="password" depends="required,mask">
<arg0 key="label.password"/>
<var>
<var-name>mask</var-name>
<var-value>^[0-9a-zA-Z!%*-_+=:,\./?]*$</var-value>
</var>
</field>
(And I'm not very good at regular expressions, so if there's a better way to
say "letter, digit, or any of these special characters, I would appreciate a
suggestion.)
Can it be done with validwhen? How do I say "does not _contain_ userId"?
I'd like it to be case insensitive, but could live without that if it's
easier.
Thanks,
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org