This is extended version of Phalcon\Validation\Validator\Regex with Validator Trait implemented.
namespace Foo\Forms;
use Phalcon\Forms\Element\Text;
use Vegas\Validation\Validator\Regex;
class Bar extends \Vegas\Forms\Form
{
public function initialize()
{
$foobar = new Text('foobar');
$foobar->addValidator(new Regex(['pattern' => '/[abfor]{6}/']));
$this->add($foobar);
// ...
}
}