Python Application 3 – Check Email Address

Step 1
Open any text editor (gedit,pico,vi,nano) then enter the following python script and save the file with .py extension.
#Author : Jijo K Jose
print "\n————————————\nChapter 20 – Regular Expression 4 \n————————————\n"
import re
in_str = raw_input("Enter an email address : ")
se_str = "\w+@\w+\.[com|in|org|net]"
reg1 = re.compile(se_str)
search1 =
if search1:
 print "\nValid email address"
 print "\nInvalid email address"
print "\n———————————–\n"

Step 2
Change file permission to executable using chmod command.
Step 3
Execute the python file.

You can leave a response, or trackback from your own site.

Leave a Reply