public function rule_regex($a)
    {
        $opt = array();
        $rule = $this->pullRule();
        if ($rule[0] != '/') {
            $rule = '/^'.$rule.'*$/';
        }
        $opt['regexp'] = $rule;

        if (!filter_var($a, FILTER_VALIDATE_REGEXP, ['options' => $opt])) {
            return $this->fail('does not match the pattern');
        }
    }