CodeIgniter Forums
Form_validation request: Regex matching rules - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Form_validation request: Regex matching rules (/showthread.php?tid=24109)



Form_validation request: Regex matching rules - El Forum - 10-31-2009

[eluser]Colin Williams[/eluser]
http://twitter.com/crynobone brought up a great idea for the Form_validation class. He proposes it support regex matching to minimize the need for callback functions. I whole-heartedly support the idea.

Two possibilities: Create a new rule "matches_regex[$exp]" or extend the existing "matches" rule to discover a regex (based on the syntax of the passed value).

Anyone up to the challenge? I'm already neck deep in developing other CI extensions but really like this idea.