Как грамотно заменить eregi на preg_match в данном коде:
function detect_brows() {
global $vers, $browser;
$user_agent = $_SERVER["HTTP_USER_AGENT"];
if (eregi("(opera) ([0-9]{1,2}.[0-9]{1,3}){0,1}", $user_agent, $vers) or
eregi("(opera/)([0-9]{1,2}.[0-9]{1,3}){0,1}", $user_agent, $vers))
{$browser = "Opera";}
elseif (eregi("(konqueror)/([0-9]{1,2}.[0-9]{1,3})", $user_agent, $vers))
{$browser = "Konqueror";}
elseif (eregi("(lynx)/([0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2})", $user_agent, $vers))
{$browser = "Lynx";}
elseif (eregi("(links) \\(([0-9]{1,2}.[0-9]{1,3})", $user_agent, $vers))
{$browser = "Links";}
elseif (eregi("(msie) ([0-9]{1,2}.[0-9]{1,3})", $user_agent, $vers))
{$browser = "MSIE";}
elseif (eregi("(netscape6)/(6.[0-9]{1,3})", $user_agent, $vers))
{$browser = "Netscape";}
elseif (eregi("(firefox)/([0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2})", $user_agent, $vers) or
eregi("(firefox)/([0-9]{1,2}.[0-9]{1,2})", $user_agent, $vers))
{$browser = "FireFox";}
elseif (eregi("(mozilla)/([0-9]{1,2}.[0-9]{1,3})", $user_agent, $vers))
{$browser = "Mozilla";}
elseif (eregi("(flock)", $user_agent))
{$browser ="Flock";}
elseif (eregi("(maxthon)", $user_agent))
{$browser ="Maxthon";}
else
{$browser = "Unknown browser :(";}
}