Thursday, 1 March 2012

Easy Email Example

This ones a very quick post about a regular expression I use all the time to validate email addresses within my applications.
A while a go now I had the need to do this and I believe got the regular expression from http://regexlib.com and added into my application.
The regular expression which hasn’t failed me as yet is:
^((\s*[a-zA-Z0-9\._%-]+@[a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4}\s*[,;:]){1,100}?)?(\s*[a-zA-Z0-9\._%-]+@[a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4})*$
This should let all valid emails through and find all emails which aren’t valid.
This is how it should look when implemented.  Obviously the item its linked to will very depending on the name of your item.

4 comments:

  1. An email showcasing project will convey your group to you in more prominent numbers! As a proprietor and administrator of a neighborhood tailor shop it is imperative to remain in front of the nearby rivalry. https://dcit.newcastle.edu.au/education/2016/09/22/the-most-popular-email-services-in-the-world/

    ReplyDelete
  2. Just get in touch with Email Experts Technicians who can install a suitable e-mail client on your PC and further insert the exact e-mail protocols. email on deck

    ReplyDelete
  3. Well this filter is much needed as sometimes the priority mails are stuck and most of the times go un-noticed in inbox. thanks for sharing the method for the readers.

    ReplyDelete