Created
March 17, 2020 03:56
-
-
Save johnifegwu/29210ab58010d478be98b1fd19cba577 to your computer and use it in GitHub Desktop.
Email Extraction and Validation
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 | |
#Character Classess | |
#email extraction / validation | |
#Email Address | |
pattern = r"([\w\.-]+)@([\w\.-]+)(\.[\w\.]+)" | |
while True: | |
email = input("Enter a valid email address: ") | |
str = "For enquiries, please write to " + email | |
print(str + "\n permorming a search...\n") | |
match = re.search(pattern, str) | |
if match: | |
print(" Successful!\n You entered a Valid email address. \n Your email add is: " + match.group()) | |
else: | |
print(" Failed! \n You have entered an Invalid email address.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment