Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
validation match_pattern
  • 
    Warning!
    
    ErrorException [ Warning ]: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash
    
    COREPATH/classes/validation.php @ line 672:
    
    671: {
    672: return $this->_empty($val) || preg_match($pattern, $val) > 0;
    673: }
    
    I got this error in my code
    $val->add_field('pd',"Product",'required|match_pattern[A-Za-z]');
  • match_pattern needs a full and compliant PRCE pattern, including delimiters. So try something like
    $val->add_field('pd',"Product",'required|match_pattern[#^[A-Za-z]+$#]');
    
  • thank u WW , i missed was # in my code

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion