I can return the last 3 folders from a folder path (if the no. of folders is known) using:
$regexp(%_folderpath%,(.+)(\\.+)(\\.+)(\\.+),$2$3$4)
However, what I need, is to return the last 3 folders, regardless of the no. of folders in the path.
I believe this can be done using the $repeat(x,n) function with $folderdepth(%_folderpath%), but my knowledge of $regexp is weak and I cannot get this to work.
Please can someone help/advise?