I have the following regex that is pulling the sender and receiver domains:
"SenderAddress":"\w+.*@(?<s_domain>.*)","RecipientAddress":"\w+.*@(?<r_domain>.*)
The issue I have is that there are some emails that don't have the 'Subject' field right after the receiver domain.
How can I write my regex that once it's done matching the receiver domain, it ignores everything after which will address when fields are missing?
Thx
Hi @jwalzerpitt ,
You just need to anchor your regex properly.
Try the following:
"SenderAddress":"[^@]+@(?<s_domain>[^"]+)","RecipientAddress":"[^@]+@(?<r_domain>[^"]+)"
If you're using rex, you'll have to escape the double quotes:
| rex "\"SenderAddress\":\"[^@]+@(?<s_domain>[^\"]+)\",\"RecipientAddress\":\"[^@]+@(?<r_domain>[^\"]+)\""