How could I design a RegEx script which would remove a filename from a path? The trick is, the paths have all sorts of wrenches to throw into the works.
As you can see, the idea is to capture all the content to the last slash by using (.*\/) and discard the rest .*. Check the substitution section above.