isRegex() public static method

Returns true if value matches $pattern, false otherwise. Uses preg_match() for the matching.
public static isRegex ( mixed $value, mixed $pattern ) : mixed
$value mixed
$pattern mixed
return mixed
Beispiel #1
0
 /**
  * @todo Implement testIsRegex().
  */
 public function testIsRegex()
 {
     $input = 'username_786';
     $regex = '/[a-zA-Z0-9_]/';
     $this->assertTrue(Inspekt::isRegex($input, $regex));
 }