mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 15:25:45 +01:00
Most changes was made by php-cs-fixer. Also removes unused `RecursiveTreeIterator` class.
17 lines
289 B
PHP
17 lines
289 B
PHP
<?php
|
|
namespace Respect\Validation\Rules;
|
|
|
|
class Regex extends AbstractRule
|
|
{
|
|
public $regex;
|
|
|
|
public function __construct($regex)
|
|
{
|
|
$this->regex = $regex;
|
|
}
|
|
|
|
public function validate($input)
|
|
{
|
|
return (bool) preg_match($this->regex, $input);
|
|
}
|
|
}
|