I'm working on a project to monitor an exchange email account and download matching emails to disk. The emails download in html format, but I really only need to open the email content in basic text and search for and parse out pieces of information. Those pieces would be set in their own variables or printed to flat files.
Taking an example of one part, I've got a line in an email, I want to read the line and capture the IP address
Code: Select all
<div>Please send such and such files to IP 127.0.0.1. Thanks in advance.</div>
The content wouldn't always be the same, but should have an IP in some part of the email so I was looping through each line and trying to match on an IP format with regex and capture the value into $1 to be set in a variable or printed to a file.
Now I know regular expression but I am unclear from the minimal documentation regarding it as to how much is supported within the program or the syntax which may be required. The basic regex to hit on a IP is below, could I use something of this nature within a print task for example?
I tried with various formats of what seemed like it would be close, but nothing managed to work.
Code: Select all
<setVariable name="Output_IP" value="${Replace(row[1], \d+\.\d+\.\d+\.\d+, $1)}" version="2.0" />
I can easily open the file and read each line and look for a static text which works, but I need to search the file for an IP pattern and when it reaches a matching line, extract the IP.