for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace hanneskod\yaysondb\Expression;
/**
* Check if $operand matches regular expression
*/
class Regexp implements ExpressionInterface
{
* @var string Internal regular expression
private $regexp;
* Set regular expression
*
* @param string $regexp
public function __construct(string $regexp)
$this->regexp = $regexp;
}
public function evaluate($operand): bool
return !!preg_match($this->regexp, $operand);