in reply to Re^2: Regexp match filename, exclude path
in thread Regexp match filename, exclude path

I'm not sure what you mean by

The solution can't be anything except a backslash, it has to be something like the last set of characters that isn't preceded by a backslash.

The following will match the last sequence of non-backslash characters in your string, which is what you seem to want:

m![^\\]+\.pdf$!;

Anchoring the match makes sure you get the filename path, and the character set negation makes sure you get nothing with a backslash in it.