Created
July 23, 2020 16:57
-
-
Save muthu1809/2efbc9dfaae3e837a85ea852cf5cac92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def isMobileNumber(sentence): | |
mobileNumberPattern = re.compile("(91[6-9][0-9]{9})") | |
number = mobileNumberPattern.findall(sentence) | |
return number | |
sentence = "My mobile no is 918344777333 and 918883775533, 91234567890" | |
mobileNumber_present = isMobileNumber(sentence) | |
print(type(mobileNumber_present)) | |
for number in mobileNumber_present: | |
print(number) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment