protected function compileRegex($key, $masque)
    {
        if (!preg_match("/^regex:(.+)+$/", $masque, $match)) {
            return;
        }

        $regex = '/'.preg_quote($match[1]).'/';

        if (!preg_match($regex, $this->inputs[$key])) {
            return;
        }

        $this->fails = true;
        
        $this->last_message = $this->lexique('regex', $key);
        
        $this->errors[$key][] = [
            "masque" => $masque,
            "message" => $this->last_message
        ];
    }
protected function compileRegex($key, $masque)
    {
        if (!preg_match("/^regex:(.+)+$/", $masque, $match)) {
            return;
        }

        $regex = '/'.preg_quote($match[1]).'/';

        if (!preg_match($regex, $this->inputs[$key])) {
            return;
        }

        $this->fails = true;
        
        $this->last_message = $this->lexique('regex', $key);
        
        $this->errors[$key][] = [
            "masque" => $masque,
            "message" => $this->last_message
        ];
    }
protected function compileRegex ( $ key , $ masque ) { if ( ! preg_match ( "/^regex:(.+)+$/" , $ masque , $ match ) ) { return ; } $ regex = '/' . preg_quote ( $ match [ 1 ] ) . '/' ; if ( ! preg_match ( $ regex , $ this -> inputs [ $ key ] ) ) { return ; } $ this -> fails = true ; $ this -> last_message = $ this -> lexique ( 'regex' , $ key ) ; $ this -> errors [ $ key ] [ ] = [ "masque" => $ masque , "message" => $ this -> last_message ] ; }
Compile Regex Rule

[regex] Check that the contents of the field with a regular expression

@param string $key
@param string $masque

@return void
Compile Regex Rule