Function eregi() is deprecated, any replacement?

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

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

Mon Mar 14, 2011 6:25 am

preg_match() will probably be your best bet.

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

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
  • Information
  • Who is online

    Users browsing this forum: Hoodenter42 and 3 guests