Hi, I am a bit confuse from using the regex formula.
I would like to extract the folder path from using the [engine.workflowdirectory] in the muti-field formula tool.
For example, the folder path of the workflow directory is "C:\folder1\folder2\folder3\"
However, what i want "C:\folder1\folder2\folderABC\" instead
I have tried the below formula which I found online, but failed.
REGEX_Replace([engine.workflowdirectory], '\\\\[^\\\\]+$', '')
The number and name of folder are not fix, which means the workflow directory could be "C:\folder5\folder4\folder6\folder1\folder2\folder3\"
But all i want is just remove everything after the second last backslash and replace it by "folderABC\" to "C:\folder5\folder4\folder6\folder1\folder2\folderABC\"
could anyone help with this?
Solved! Go to Solution.
Hey @smallpotato, you should be able to use the following:
REGEX_Replace([Engine.WorkflowDirectory], '(.+\\)[^\\]+\\', '$1')+'folderABC\'
thanks for the quick reply. its work for me