function _getRegex(HTML_QuickForm2_Rule $rule, HTML_QuickForm2_Node $el) { if ($el instanceof Am_Form_Element_Date) { return; } // @todo fix it up! if (preg_match('{^(/|\\|)(.+)(\\1)([giDm]*)$}', $rule->getConfig(), $regs)) { $params = array($regs[2], str_replace('D', '', $regs[4])); } else { throw new Am_Exception_InternalError("Cannot parse regexp [{$params}] for use in " . __METHOD__); } return array('regex', $params); }
function _getRemote(HTML_QuickForm2_Rule $rule, HTML_QuickForm2_Node $el) { return array('remote', $rule->getConfig()); }