regex_match in CodeIgniter form_validation generates: Message: preg_match(): No ending delimiter '/' found regex_match in CodeIgniter form_validation generates: Message: preg_match(): No ending delimiter '/' found codeigniter codeigniter

regex_match in CodeIgniter form_validation generates: Message: preg_match(): No ending delimiter '/' found


When you set the validation rules you separate them with a | so the |'s in your regex is causing the validation rule to split at those and that is causing the error. Discussion here on the issue. It seems it's a limitation or bug in codeigniter. You can test it out by running a regex with and without |'s and see if the usage of pipes will cause an error. If that is the case then you may have to validate by regex by other means, maybe use a callback function as detailed on this page where your function will do a preg_match using the regex which needs to be inside the function of course and then return true/false.