mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 07:15:45 +01:00
Most changes was made by php-cs-fixer. Also removes unused `RecursiveTreeIterator` class.
15 lines
295 B
PHP
15 lines
295 B
PHP
<?php
|
|
namespace Respect\Validation\Rules;
|
|
|
|
/**
|
|
* @link http://semver.org/
|
|
*/
|
|
class Version extends AbstractRule
|
|
{
|
|
public function validate($input)
|
|
{
|
|
$pattern = '/^[0-9]+\.[0-9]+\.[0-9]+([+-][^+-][0-9A-Za-z-.]*)?$/';
|
|
|
|
return (bool) preg_match($pattern, $input);
|
|
}
|
|
}
|