title: Regular Expressions in Python. Checking the validity of a phone number
body: <p>I am trying to build a logic for checking the validity of phone number in Python. If any mobile number starting with +91 or 91 and containing 10 digits starting in between 6 -9 in entered by the user. It should be a valid phone number.
  I am tried the below code but its giving me an error :
  error: unbalanced parenthesis at position 9
  Any help will be much appreciated.
  For example :
  the phone number should have any of the below formats:
  +917162377291
  916162377291
  +918162377291
  +919162377291
  If user enters any of the numbers in the above format condition that the first digit post 91 or +91 should be among {6,7,8 or 9} followed by 9 digits should be a valid phone number.</p>
  <pre><code>import re 
  s=input('Enter the phone number:')
  m=re.fullmatch('^\(+91|91)[6-9]d{9}',s)
  if m!=None:
      print('Correct Number')
  else:
      print('Incorrect Number')
  </code></pre>