* * For the full copyright and license information, please view the "LICENSE.md" * file that was distributed with this source code. */ declare(strict_types=1); namespace Respect\Validation\Rules; /** * @see http://semver.org/ */ class Version extends AbstractRule { public function validate($input): bool { $pattern = '/^[0-9]+\.[0-9]+\.[0-9]+([+-][^+-][0-9A-Za-z-.]*)?$/'; return (bool) preg_match($pattern, $input); } }