public function rule_alpha($a) { $msg = 'must contain only letters'; if (!preg_match('/^([A-Za-z])*$/', $a)) { return $this->fail($msg); } }