Page 1 of 1

modifying variable values using regular expression

Posted: Wed Apr 20, 2011 4:23 am
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

Re: modifying variable values using regular expression

Posted: Tue Feb 14, 2012 8:54 am
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.