Skip to content

modifying variable values using regular expression

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
  • vanrobstone Offline
  • Posts: 3
  • Joined: Fri Dec 10, 2010 10:59 am

modifying variable values using regular expression

Post by vanrobstone »

Hi,

Is it possible to use a set variable task to modify the value of a variable to obtain a new value with a regular expression?

For example, I might have a variable called file.path and from that generate a new variable called file.name

file.path = c:\test\rob\outer\filename.txt

I want to perform an operation on that variable value to obtain just

file.name = filename.txt

a regex operating on file.path [^\\]*$ would equate to that value but I have had no success in making this work.

Thanks

Rob
  • Support_Duane Offline
  • Support Specialist
  • Posts: 66
  • Joined: Thu Mar 05, 2009 3:49 pm

Re: modifying variable values using regular expression

Post by Support_Duane »

Before version 4.0, it was not possible to use a regular expression in a Set Variable task. At version 4.0 and beyond, the Replace(text, regex, replacement) function may be used.
Post Reply