Classe: MatchValidator - X-Ref
A validator for regular expressions.
This validator will return true, when the passed value *matches* the
regular expression.
## This class replaces the former class MaskValidator ##
If you do want to test if the value does *not* match an expression,
you can use the MatchValidator class instead.
Below is an example usage for your Propel xml schema file.
<code>
<column name="email" type="VARCHAR" size="128" required="true" />
<validator column="username">
<!-- allow strings that match the email adress pattern -->
<rule
name="match"
value="/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/"
message="Please enter a valid email address." />
</validator>
</code>
prepareRegexp($exp)
X-Ref
|
Prepares the regular expression entered in the XML
for use with preg_match().
param: string $exp
return: string Prepared regular expession.
|