How to change from eregi (deprecated) to preg_match function in Zencart with PHP5.3

eregi_replace() is deprecated as of PHP 5.3.0. Use preg_replace() with the i (
===================================================================
admin/includes/classes/phplot.php

in function SetPlotType($which_pt):

$accepted = "bars,lines,linepoints,area,points,pie,thinbarline";
//$asked = trim($which_pt);
$asked = ‘/’.trim($which_pt).’/i’;
if (preg_match($asked, $accepted)) {
$this->plot_type = $which_pt;
return true;
}
============================================
admin/includes/functions/compatibility.php

while(list($k, $line) = each($output)) {
//if(eregi("^$host", $line)) {
if( preg_match(‘/’.$host.’/i’, $line)) {
return true;
}
}
=============================================
admin/includes/functions/password_funcs.php

if ( preg_match(‘/^[a-z0-9]$/i’, $char)) $rand_value .= $char;

=========================================
admin/whos_online.php

if ( preg_match (‘/^(.*)’ . zen_session_name() . ‘=[a-f,0-9]+[&]*(.*)/i’, $whos_online- >fields[‘last_page_url’], $array))

=====================================
includes/classes/language.php

if ( preg_match(‘/^(‘ . $value[0] . ‘)(;q=[0-9]\\.[0-9])?$/i’, $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {

=====================================
includes/functions/functions_email.php

1) if (preg_match(‘/’."\r/i" ,$value) || preg_match(‘/’."\n/i",$value)) return false;
2) if (preg_match("/ *([^<]*) *<([^>]*)> */",$from_email_address,$regs)) {
3) if (preg_match("/ *([^<]*) *<([^>]*)> */",$value,$regs)) {
4) elseif (preg_match("/ *([^ ]*) */",$value,$regs)) {
5) if (!preg_match(‘/’.$space_check .’/’, $email)) {
if ( preg_match(‘/’.$valid_email_pattern.’/i’, $email)) {

=====================================
includes/modules/pages/contact_us/header_php.php

$send_to_email= preg_replace ("/>/i", "", $send_email_array[0]);
$send_to_email= preg_replace ("/</i", "", $send_to_email);
$send_to_name = preg_replace(‘/\<[^*]*/i’, ”, $send_to_array[$_POST[‘send_to’]]);

=====================================
includes/modules/attributes.php

1) if ((preg_replace(‘/txt_/’, ”, $key) == $products_options_names->fields[‘products_options_id’])) {
=====================================
includes/modules/pages/advanced_search_result/header_php.php

=====================================
includes/modules/pages/gv_send/header_php.php

if (preg_match(‘/[^0-9/.]/’, $gv_amount)) {