For example, within the Unix enviornment, you may have a folder path:
and you wish to return the 'working' folder name.
In a Data Process shape, enter the following in the 'Text To Find' field of the 'Search/Replace' step and leave the 'Replace with' field blank
This will return
Note: The number of subfoldes involved matters not. You would still use the above strategy. So, for example, if the folder structure was \\prod\boomi\working\test\results, .*(\\) would still return the last directory name (results).