Esc* modifiers eat backslashes

Confirmed! That is weird. It must be putting things together slightly differently if the path needs quotes or not.

We need to look into why, as the two should at least be consistent (one way or the other). I've made a note to look at it.

I would use this form:

@nofilenamequoting
Rename PATTERN=(.*) TO="{dlgfolder|||escbackslash|noterm}\\\1" REGEXP IGNOREEXT

The @nofilenamequoting seems to be optional, at least in the cases I've tested, but I'd rather be explicit about it, especially here when we're doing something delicate with escaped characters.

Adding noterm means the path won't have any backslash(es) on the end, allowing us to add the exact number we need explicitly.

The "add filename on to path" functionality doesn't know about the escbackslash (since it's outside of the {dlgfolder|...} it applies to), I would not rely on it to correctly preserve the double backslashes at the end of the escaped string when adding a component to the end of the path. We might change it so that does work in both these cases (depending on what's going on behind the scenes), but I like doing it explicitly and not relying on that at all. One less thing to worry about!

1 Like