Hello,
So I have a tool that uses Regex to search text. I am trying to extract certain data from the text; in this example I want to find the "TO" data in the email text. Since this data came from Lotus Notes it's formatted slightly different where it doesn't put the : after the To:
Here is what I am using now, it works but pulls too many false positives.
If I remove "^to " then I get no data returned, if I leave it in then I pull a lot of false positives.
How do I match against To and the @ sign for a valid hit?
Example:
******************************************************
From me@me.com
To you@you.com
Subject about regex
To who ever reads this, I am stuck; please help me
******************************************************
Anyone have suggestions on how I can use the @ to validate the email address, if no @ then no match?
So I have a tool that uses Regex to search text. I am trying to extract certain data from the text; in this example I want to find the "TO" data in the email text. Since this data came from Lotus Notes it's formatted slightly different where it doesn't put the : after the To:
Here is what I am using now, it works but pulls too many false positives.
Code:
(?i)(?<=\b(^to |^to:|^to;):?)[^:].+?$
How do I match against To and the @ sign for a valid hit?
Example:
******************************************************
From me@me.com
To you@you.com
Subject about regex
To who ever reads this, I am stuck; please help me
******************************************************
Anyone have suggestions on how I can use the @ to validate the email address, if no @ then no match?