Propel API
Class

MatchValidator

class MatchValidator implements BasicValidator

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>

Methods

boolean isValid(ValidatorMap $map, string $str)

Whether the passed string matches regular expression.

Details

at line 70
public boolean isValid(ValidatorMap $map, string $str)

Whether the passed string matches regular expression.

Parameters

ValidatorMap $map
string $str

Return Value

boolean