jamesjmann Posted March 19, 2011 Share Posted March 19, 2011 I'm sure this issue has been addressed before, but as I can't find anything on google OR bing, I've resorted to asking it here: Since, ereg and eregi are deprecated in PHP5, how do you test strings using regular expressions? Is there a new function for this? EDIT: I also looked on php.net, but all it says is its deprecated in PHP5. I didn't see any links to the new function(s) that have replaced the former. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted March 19, 2011 Share Posted March 19, 2011 Notes Note: As of PHP 5.3.0, the regex extension is deprecated in favor of the PCRE extension. Calling this function will issue an E_DEPRECATED notice. See the list of differences for help on converting to PCRE. Note: preg_match(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to ereg(). Quote Link to comment Share on other sites More sharing options...
Eyewash01 Posted March 19, 2011 Share Posted March 19, 2011 http://php.net/manual/en/function.preg-match.php Quote Link to comment Share on other sites More sharing options...
jamesjmann Posted March 19, 2011 Author Share Posted March 19, 2011 Notes Note: As of PHP 5.3.0, the regex extension is deprecated in favor of the PCRE extension. Calling this function will issue an E_DEPRECATED notice. See the list of differences for help on converting to PCRE. Note: preg_match(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to ereg(). I know, and I AM using javascript, but I'm making sure that php catches the errors if javascript isn't enabled on the user's computer. Just to be safe. And thanks for the quick reply. I'ma go look up PCRE, right now. Might need help converting my current ereg calls though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.