johnsmith153 Posted November 5, 2008 Share Posted November 5, 2008 I believe ereg will no longer be available in PHP6. I have quite a few scripts to change, so want to get it right. Ideally I will make the changes now. Can I simply replace "ereg" below with "preg"? The lines below are parts of a script that will need changing. if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { if (!ereg("^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$", $email_array[1])){ if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $emailtocheck)) Link to comment https://forums.phpfreaks.com/topic/131442-preg-ereg-whats-the-difference/ Share on other sites More sharing options...
DarkWater Posted November 5, 2008 Share Posted November 5, 2008 Oh, would you look at this. A tutorial on regular expressions written by some anonymous upstanding individual who is not myself seems to have put a section on PCRE vs. POSIX-Extended in his tutorial! http://www.phpfreaks.com/tutorial/regular-expressions-part1---basic-syntax/page7 What a great person. Link to comment https://forums.phpfreaks.com/topic/131442-preg-ereg-whats-the-difference/#findComment-682645 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.