fix deprecated function (eregi -> preg_match)