#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2011
    Posts
    2
    Rep Power
    0

    Urgent regex help required


    Hi, please could somebody give me some direction or an answer to my dillema, I have tried but I am comming up short each time.

    We have a script that runs a regex preg_match_all against emails returned from an email account that have bounced from our bulkmail system, the script as it is runs fine however we end up getting mails back where the email address is prepended with an rfc822; on the email address, making the email address rfc822;mikey @ somedomain .co .za which is returned in the array of emails found in the raw mail body.

    This obviously does not match the email address in the db and therefore never gets removed from the db, I need this following regex expresion to be changed/modified so that if an address is prepended with rfc822; it just returns the(E-Mail address mikey @ somedomain . co .za and if it is not prepended the email address will be returned only

    %\b([^@\s]+@[a-zA-Z0-9\-][a-zA-Z0-9\-\.]{0,254})\b%is
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,066
    Rep Power
    9398
    Since semicolons would be invalid anyways,
    Code:
    [^@\s;]+
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2011
    Posts
    2
    Rep Power
    0
    you are a star, that worked a treat.

IMN logo majestic logo threadwatch logo seochat tools logo