title: Regular expression for UK Mobile Number - Python
body: <p>I need a regular expression that only validates <strong>UK mobile numbers</strong>.</p>
  <p>A UK mobile number can be between <code>10-14</code> digits and either starts with <code>07</code>, or omits the <code>0</code> and starts with <code>447</code>.</p>
  <p>Importantly, if the user adds <code>+44</code> it should be rejected.</p>
  <p>So these would be valid:</p>
  <blockquote>
  <p>07111111111</p>
  <p>447111111111</p>
  </blockquote>
  <p>and these would be invalid:</p>
  <blockquote>
  <p>+4471111111111</p>
  <p>021929182711</p>
  <p>00701029182</p>
  </blockquote>
  <hr />
  <p>What I have so far:</p>
  <pre><code>rule = re.compile(r'^\+?(44)?(0|7)\d{9,13}$')
  
  if not rule.search(value):
      msg = u&quot;Invalid mobile number.&quot;
      raise ValidationError(msg)
  </code></pre>
  <p>This does not validate according to my rules yet; could someone help?</p>