Created
July 23, 2020 16:57
-
-
Save muthu1809/b8e3e60db942217257a0c38423c6c4ad 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