title: Validate email or mobile with regular expression
body: <p>I have one form field. In that field it's possible for user to enter <strong>EMAIL</strong> or <strong>MOBILE</strong>. From a PHP page i got value. After that i want to check whether this is email id or mobile number. suppose <code>email</code> means i want to email success,suppose <code>mobile</code> means i want to show mobile success ,i think we have to write regular expression,but i don't know how to write regular expression for this problem?  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;form action="#" method="POST" id="forgotForm"&gt;
    &lt;div class="form-group has-feedback"&gt;
      &lt;input type="text" class="form-control" placeholder="Email OR Mobile" id="email" name="email" value="" aria-required="true" required="" data-msg-required="Please enter your email"&gt;
      &lt;span class="glyphicon glyphicon-envelope form-control-feedback"&gt;&lt;/span&gt;
    &lt;/div&gt;
    &lt;/form&gt;
  
    home.php
    &lt;?php
    $email=$_POST['email'];//here value it will come like 9986128658 or admin@gmail.com
    
    ?&gt;</code></pre>
  </div>
  </div>
  </p>