Hi, My regex always return false: "Phalcon\Validation\Validator\Regex"
$name = new Text('username');
$name->setLabel('Usename');
$name->addValidators([
new PresenceOf(['message' => _('Username is required')]),
new UniquenessValidator([
"model" => new Users(),
"attribute" => "username",
"message" => _("This username is already in use"),
]),
new Regex([
"message" => "Username can only contain letters and numbers",
'pattern' => '^[a-zA-Z0-9_.-]*$',
"allowEmpty" => true
]),
]);
$this->add($name);
What's wrong ?