/** * constructor * * @return NameRule * @author Justin Palmer **/ public function __construct($message = '%s is an invalid email address.') { parent::__construct("/^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)\$/", $message); }
/** * constructor * * @return NameRule * @author Justin Palmer **/ public function __construct($message = '%s should be in the format: ##.##') { parent::__construct("/^([0-9]+.[0-9]{2})\$/", $message); }
/** * constructor * * @return AlphaExtraRule * @author Justin Palmer **/ public function __construct($message = '%s should be a valid web address.') { $preg = "/^((http|https|ftp):\\/\\/(www\\.)?|www\\.)[a-zA-Z0-9\\_\\-]+\\.([a-zA-Z]{2,4}|[a-zA-Z]{2}\\.[a-zA-Z]{2})(\\/[a-zA-Z0-9\\-\\._\\?\\&=,'\\+%\$#~]*)*\$/"; parent::__construct($preg, $message); }
/** * constructor * * @return AlphaExtraRule * @author Justin Palmer **/ public function __construct($extra = '', $message = '%s should only include lowercase and capital letters.') { $preg = '/^([0-9' . $extra . '])+$/'; parent::__construct($preg, $message); }
/** * constructor * * @return NameRule * @author Justin Palmer **/ public function __construct($message = '%s should be a date in format: YYYY-MM-DD') { parent::__construct("/^(19|20)[0-9]{2}-[0|1][0-9]-[0-3][0-9]\$/", $message); }
/** * constructor * * @return NameRule * @author Justin Palmer **/ public function __construct($message = '%s should be in the format: ##-####### OR #########.') { parent::__construct("/^(\\d{2})\\-?(\\d{7})\$/", $message); }
/** * constructor * * @return NameRule * @author Justin Palmer **/ public function __construct($message = '%s should be in the format: ###-###-####') { parent::__construct("/^([0-9]){3}(\\s|-)([0-9]){3}(-|\\s)([0-9]){4}\$/", $message); }
/** * constructor * * @return NameRule * @author Justin Palmer **/ public function __construct($message = '%s is not valid.') { parent::__construct("/^([0-9]){1,5}\\s?([0-9]){1,5}\\s?([0-9 \\-]){2,15}\$/", $message); }