Tuesday, April 19, 2011

bash (shell) code to verify email address

I used the regex from here, and modified it to accept lower case letters.

if [[ "$email" =~ "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$" ]]
then
    echo "Email address $email is valid."
else
    echo "Email address $email is invalid."
fi

3 comments:

  1. Today i am feeling so much happy because actually i was looking information about email verification service . Just now i have read this blog content attentively then i got more helpful information about it. I am really surprised for that. Thanks for your good job.

    ReplyDelete
  2. Email Marketing is a great way of promoting your business.

    email verification service

    ReplyDelete