+ Reply to Thread
Results 1 to 4 of 4

Parse Email address from middle of a string

  1. #1
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    Parse Email address from middle of a string

    Hi all,

    I'm trying to parse an e-mail address from the middle of string using reg expresson.

    I have a couple of ideas on how I can do this. But I would like to use just a reg exp pattern.

    Find the right pattern is my hurdle.

    I've attemped to use the following however it'sreturning the address along with the string of characters that are in front of it.

    ^([a-z0-9_\.\-\,\.<\>\])(EMTag>)([a-z0-9_\.\-]+@(([a-z0-9\-]+\.)+)([a-z]+))(<EMTag)([a-z0-9_\.\-\,\.<\>]+)$
    Any ideas on a pattern I can use?

    Thanks,

    BDB

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Parse Email address from middle of a string

    Have a look here: http://www.regular-expressions.info/email.html

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    Re: Parse Email address from middle of a string

    Domski,

    Thanks for the link.

    However, my issue in not coming up with the syntex or pattern for the email itself.
    The issue is if I have a sting like this: MyHomeState>TX<,EM>[email protected]<EM
    Then obviously a pattern for email will not work or it will include parts before the actual email. I want pattern which will recognize what's before the email segment, the email, and the part after the email.

    Any suggestions?

    Thanks,

    BDB

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Parse Email address from middle of a string

    Hello BDB,

    If you provide some sample data, the more the better, I can help you create a parser.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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