static function regex(&$value, $regex, $matchModel = null) { if (!preg_match($regex, $value)) { if (!$matchModel) { $matchModel = Tool::regexExpand($regex); } Debug::toss(['type' => 'regex', 'detail' => $matchModel], 'InputException'); } }