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. Link to comment https://forums.phpfreaks.com/topic/231131-ereg-eregi-php5/ 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(). Link to comment https://forums.phpfreaks.com/topic/231131-ereg-eregi-php5/#findComment-1189685 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 Link to comment https://forums.phpfreaks.com/topic/231131-ereg-eregi-php5/#findComment-1189686 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. Link to comment https://forums.phpfreaks.com/topic/231131-ereg-eregi-php5/#findComment-1189720 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.