public function regex_match(string $str = null, string $pattern, array $data): bool
	{
		if (strpos($pattern, '/') !== 0)
		{
			$pattern = "/{$pattern}/";
		}

		return (bool) preg_match($pattern, $str);
	}
public function regex_match(string $str = null, string $pattern, array $data): bool
	{
		if (strpos($pattern, '/') !== 0)
		{
			$pattern = "/{$pattern}/";
		}

		return (bool) preg_match($pattern, $str);
	}
public function regex_match ( string $ str = null , string $ pattern , array $ data ) : bool { if ( strpos ( $ pattern , '/' ) !== 0 ) { $ pattern = "/{$pattern}/" ; } return ( bool ) preg_match ( $ pattern , $ str ) ; }
Compares value against a regular expression pattern.

@param string $str
@param string $pattern
@param array  $data    Other field/value pairs

@return boolean
Compares value against a regular expression pattern .