modifying variable values using regular expression
Posted: Wed Apr 20, 2011 4:23 am
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
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