title: Rails validating phone number regex
body: <p>Trying to strengthen my user profile forms etc by adding effective regex's to ensure that valid emails, phone numbers etc are being used.
  I have the following regex, that works fine when tested on Rubular, however I get a syntax error when I add it to my model as below:</p>
  
  <pre><code>(^(\+44\s?7\d{3}|\(?07\d{3}\)?)\s?\d{3}\s?\d{3}$
  
  validates_format_of :contactnr, with: (^(\+44\s?7\d{3}|\(?07\d{3}\)?)\s?\d{3}\s?\d{3}$, allow_blank =&gt; true
  </code></pre>