title: the system stopped working after changing eregi to preg_match
body: <p>On my website i have a contact us form which used to work fine until i upgraded to php 7. Now when i fill the form it returns as invalid email and the logs doesn't show any error.</p>
  
  <p>Earlier it was showing error as</p>
  
  <pre><code>PHP Fatal error:  Uncaught Error: Call to undefined function eregi() in /app/index.php:27
  </code></pre>
  
  <p>This is line 27:</p>
  
  <pre><code> if (!empty($email) &amp;&amp; !preg_match("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)){
          $err[] = "Invalid email&lt;br&gt;";
      }
  </code></pre>
  
  <p>So i changed <code>eregi</code> to <code>preg_match</code> but now it just doesn't work.</p>
  
  <pre><code>&lt;?php
  $err=array();
  
  if(count($_POST) &gt; 0)
  {
  
      $name = isset($_REQUEST["name"]) ? trim($_REQUEST["name"]) : "";
      $address = isset($_REQUEST["subject"]) ? trim($_REQUEST["subject"]) : "";
      $country = isset($_REQUEST["country"]) ? trim($_REQUEST["country"]) : "";
      $email = isset($_REQUEST["email"]) ? trim($_REQUEST["email"]) : "";
      $contact_no = isset($_REQUEST["contact_no"]) ? trim($_REQUEST["contact_no"]) : "";
      $budget = isset($_REQUEST["budget"]) ? trim($_REQUEST["budget"]) : "";
      $com_name = isset($_REQUEST["com_name"]) ? trim($_REQUEST["com_name"]) : "";
      $message_text = isset($_REQUEST["message_text"]) ? trim(addslashes($_REQUEST["message_text"])) : "";
      $message_text=htmlentities($message_text,ENT_QUOTES);
  
  
      $ipaddress = $_SERVER['REMOTE_ADDR'];
      $date = date("F j, Y, g:i a"); 
  
  
      if(empty($name)) $err[]="You must enter your name,";
      if(empty($email)) $err[]="proper email address,";
  
      if (!empty($email) &amp;&amp; !preg_match("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)){
          $err[] = "Invalid email&lt;br&gt;";
      }
      if(empty($contact_no)) $err[]="proper contact no";
  
      if(!empty($contact_no) &amp;&amp; !(is_numeric($contact_no)) )
      $err[]="Contact No must be in Number&lt;br&gt;";
  </code></pre>