Function eregi() is deprecated, any replacement?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Function eregi() is deprecated, any replacement?

Post by egami » Mon Mar 14, 2011 6:25 am

preg_match() will probably be your best bet.

User avatar
Nullsig
php-forum Fan User
php-forum Fan User
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: Function eregi() is deprecated, any replacement?

Post by Nullsig » Mon Mar 14, 2011 10:39 am

so there is no regular expression function in php any more,
As egami stated "preg_match() will probably be your best bet."

eregi uses POSIX for its regular expressions, preg uses PERL. You will need to rewrite your expressions to fit the PERL syntax but it is faster than eregi which is why ereg has been deprecated.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests