mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 15:25:45 +01:00
15 lines
326 B
PHP
15 lines
326 B
PHP
<?php
|
|
namespace Respect\Validation\Rules;
|
|
|
|
class Yes extends Regex
|
|
{
|
|
public function __construct($useLocale = false)
|
|
{
|
|
$pattern = '^y(eah?|ep|es)?$';
|
|
if ($useLocale && defined('YESEXPR')) {
|
|
$pattern = nl_langinfo(YESEXPR);
|
|
}
|
|
|
|
parent::__construct('/'.$pattern.'/i');
|
|
}
|
|
}
|