respect-validation/library/Rules/Roman.php

22 lines
493 B
PHP
Raw Normal View History

2011-10-25 20:06:43 +02:00
<?php
2015-06-08 16:47:14 +02:00
/*
* This file is part of Respect/Validation.
*
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
*
* For the full copyright and license information, please view the "LICENSE.md"
* file that was distributed with this source code.
*/
2011-10-25 20:06:43 +02:00
namespace Respect\Validation\Rules;
class Roman extends Regex
2011-10-25 20:06:43 +02:00
{
public function __construct()
{
$pattern = '^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$';
parent::__construct('/'.$pattern.'/');
2011-10-25 20:06:43 +02:00
}
}