title: Phone number regex is not working
body: <p>Hi have given phone no validation by including the given code</p>
  
  <pre><code>validates :phone, format: { with: /(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}/}
  </code></pre>
  
  <p>When I give inpiut phone number as a <code>012-365-4987</code> then it works properly but when i give <code>(123) 856-9347</code> then it gives me error maximum 12 numbers. Please guide me about correct regex for these two phone numbers</p>