Extract filename from path

I am trying to extract a filename from a path using Text Replace.

For example the input string can be any of the following:

C:\Test2\Test.Project\Project1\Config\LastFile.txt

C:\LastFile.txt

C:\Local copy\spork\config items old\LastFile.txt

 

I am trying to use the regex option without any luck.  The search string I am using is [^\\]$

Then trying to replace using $1

Any suggestions?

 

thanks!

 

 

 

 

Hi Mike

The easiest way is to use the Set Variable action and the “Extract Filename portion from a path/filename” modifier.