Replaced ereg functions with preg_match