+ Reply to Thread
Results 1 to 11 of 11

How to check Email validation in regular expression

  1. #1
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    710

    How to check Email validation in regular expression

    Hello Friends,

    I am trying to check whether email id is valid or not.
    I have a pattern and i want this in function
    my pattern is :

    Please Login or Register  to view this content.
    I don't understand how to use in function.

    Please suggest me.
    Regards,
    MohanS


    "Perfection is not attainable, but if we chase perfection we can catch excellence." - Vince Lombardi

    You can simply say thanks by clicking "*Add Reputation" icon

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    1,555

    Re: How to check Email validation in regular expression

    Try like this:

    Please Login or Register  to view this content.
    To use as
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Not tested.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    710

    Re: How to check Email validation in regular expression

    Hi
    thanks KOKOSEK

    i tried but got error #VALUE!

  4. #4
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    1,555

    Re: How to check Email validation in regular expression

    That's your pattern.
    With:
    Please Login or Register  to view this content.
    works fine and I think validate correctly. But it simple checking. I guess that your pattern is not correct. I am not a Regexp expert.
    Last edited by KOKOSEK; 01-17-2020 at 06:17 AM.

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    6,323

    Re: How to check Email validation in regular expression

    This should suffice in 99.99%.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    710

    Re: How to check Email validation in regular expression

    hi bakerman2,
    Your solution working fine.
    but may I know whats wrong in my pattern because it is currently used in other software and its working fine.
    I want this pattern to be used so that my result and software result will be same.

    software script is as below:

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,171

    Re: How to check Email validation in regular expression

    [a-zA-Z0-9@]w+\.(com|net)
    "ThankyouFor Attention * And Your Help!!"

  8. #8
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    710

    Re: How to check Email validation in regular expression

    Thanks to reply dabaho
    I just want to know what's wrong in above script which I posted.

    Please suggest me
    It's my great pleasure if Sir Jindon look in to the matter.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    15,239

    Re: How to check Email validation in regular expression

    Quote Originally Posted by mohan.r1980 View Post
    I just want to know what's wrong in above script which I posted.
    Impossible to convert such pattern to Regular Expressions in vba.
    R/E in vba only have limited functionalities/pattern matching, and one of them is negative look ahead.

    Google and find the pattern and you will find none of them are perfect...

  10. #10
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    710

    Re: How to check Email validation in regular expression

    Thank you very much Jindon Sir with great explanation.

    I am going to used Bakerman2 script.

    And finally it's great time that you are still helping me and all of us on this forum.
    I always follow you on this forum.
    Wish you stay healthy and happy.

  11. #11
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    6,323

    Re: How to check Email validation in regular expression

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1