title: HTML5 pattern for phone number with parentheses
body: <p>I've got an HTML5 pattern that works great for phone numbers in the following format:</p>
  
  <pre><code>111-222-3333
  111 222 3333
  (777)-888-9999
  (777)888-9999
  </code></pre>
  
  <p>But if a user enters </p>
  
  <pre><code>(777-999-9999
  </code></pre>
  
  <p>It passes the validation. Ideally I'd want this to throw an error since the parentheses is clearly not closed. Here is my pattern:</p>
  
  <pre><code>pattern="^\(?\d{3}\)?[- ]?\d{3}[- ]?\d{4}$"
  </code></pre>
  
  <p>Any ideas on what I'm doing wrong? I've been banging my head against a wall for hours on this one. Thanks!</p>