title: Regular expression to validate US phone numbers?
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><br>
    <a href="https://stackoverflow.com/questions/4338267/validate-phone-number-with-javascript">Validate phone number with JavaScript</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to write a regular expression to validate US phone number of format 
   (123)123-1234 -- true
   123-123-1234 -- true</p>
  
  <p>every thing else in not valid.</p>
  
  <p>I came up something like </p>
  
  <pre><code> ^\(?([0-9]{3}\)?[-]([0-9]{3})[-]([0-9]{4})$
  </code></pre>
  
  <p>But this validates, 
  123)-123-1234
  (123-123-1234</p>
  
  <p>which is NOT RIGHT.</p>