May-16-2020, 12:12 AM
Hi,
I am trying to verify the given number is a valid phone number or not.
Conditions:
1. The number may be a 10 digit one : 9898989876
2. The number can start with "zero" : 09898989876
3. The number can be international : +919898989876
I use below program, and when I enter any of the above number my output is showing "Invalid number"
I am trying to verify the given number is a valid phone number or not.
Conditions:
1. The number may be a 10 digit one : 9898989876
2. The number can start with "zero" : 09898989876
3. The number can be international : +919898989876
I use below program, and when I enter any of the above number my output is showing "Invalid number"
import re mblNum =input("Please enter the mobile number to validate\n") m = re.fullmatch('[+91]*[0]*[6-9]\d{9}', mblNum) if m != None: print("valid number") else: print("Invalid number")