phppreg-replacepreg-matcheregi

PHP Convert eregi() string to preg_match or preg_replace


please can someone help me with convert this string from eregi() to preg_match or preg_replace? Thank you very much!

$eregicheck = "^([-!#\$%&'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#\$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,4}\$";

Solution

  • Sure:

    $pregcheck = "(".$eregicheck.")i";
    

    Done.