title: Validation for xxx-xxx-xxxx or (xxx)xxx-xxxx
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/123559/a-comprehensive-regex-for-phone-number-validation">A comprehensive regex for phone number validation</a>  </p>
  </blockquote>
  
  
  
  <p>Whats the regex for</p>
  
  <pre><code>xxx-xxx-xxxx
  or
  (xxx)xxx-xxxx
  </code></pre>
  
  <p>I can create regex for the first one with</p>
  
  <pre><code>/^\d{3}-\d{3}-\d{4}$/
  </code></pre>
  
  <p>but how to add rule in this so it can also handle the second one?</p>