Modifying Aweber Email Parser Field

Discussion in 'Programming' started by thebeacon, Feb 23, 2010.

  1. #1
    Trying to setup simple email parser for aweber.

    Not sure if the email parsing code is the same across the board or every email parsing service uses its own.

    All I am trying to do is extract name and email from email.

    Name field seems to be working fine email through is no luck yet.

    Here is the default email extracting code for parser

    Example of how text appears in the email that I am trying to extract if from;

    Applicant:
    John Doe
    123 Mail St.
    North Pole, AL
    mailto:johndoe@example.com

    Code to Extract First Name (works fine):\n[>\s]*Applicant:\s+(.+?)\n

    Code to Extract Email (does not work): \n[>\s]*mailto:\s+(.+?)\n

    Now if I add space in the test email between mailto: and the actual email, everything works just fine. The thing is that I get emails from automated source and there is no way to create that space.

    I have to modify parser extraction code to handle mailto: and email address being together.

    Any help would be greatly appreciated.
     
    thebeacon, Feb 23, 2010 IP
  2. thebeacon

    thebeacon Guest

    Messages:
    236
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I figured it out

    I had to change code from: \n[>\s]*mailto:\s+(.+?)\n

    To: \n[>\s]*mailto:+(.+?)\n
     
    thebeacon, Feb 23, 2010 IP