Skip to content

Extent of regex support and proper syntax?

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
  • shadowfox Offline
  • Posts: 2
  • Joined: Thu Jun 11, 2015 2:13 pm

Extent of regex support and proper syntax?

Post by shadowfox »

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?

Code: Select all

\d+\.\d+\.\d+\.\d+
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.
  • User avatar
  • Support_Julie Offline
  • Support Specialist
  • Posts: 91
  • Joined: Thu Mar 05, 2009 3:49 pm
  • Location: Ashland, NE USA
  • Contact:

Re: Extent of regex support and proper syntax?

Post by Support_Julie »

Regarding regex support in GoAnywhere, please refer to the on-line help. In the current release, the Appendix has a section titled "Wildcards and Regular Expressions"
Julie Rosenbaum
Sr Support Analyst
e. [email protected]
p. 1.800.949.4696
w. HelpSystems.com
Post Reply