#1 2019-01-07 11:37

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Use the same separator consistently for all commands

When the + button is pressed in commands like Remove or Replace, ReNamer adds *|* between entries.

But for Rearrange command, the separator is only | (without asterisks on both sides).
This should be consistent for all commands (I like the plain | as separator).

Offline

#2 2019-01-08 00:47

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: Use the same separator consistently for all commands

The benefit of "*|*" over "|" is that the former has fewer chances of occurring in filenames.

For example, imagine a scenario where you have inserted a meta tag into the filename which contained "|" characters. Using the Remove or Replace rules would be a natural way of getting rid of them, but it wouldn't be possible if "|" characters were interpreted as delimiters.

Of course, you could say the same about the "*|*" delimiter, but the chances of that happening are much slimmer, and even then you can still get rid of them by removing the the "|" first and then the remaining "**".

In contrast, the Rearrange rule is intended for rearranging parts of a valid file name, rather than cleaning up weird characters inserted from meta tags. So it is more acceptable to use plain "|" as the separator.

Offline

#3 2019-01-09 05:55

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Use the same separator consistently for all commands

Well, the use of | in the file name would be very rare to begin with.
So such a general precaution is not needed.

In that case, how about using escape character?

So, I is used universally, without causing confusion, and then if we want to use the | character itself, use an escape character.
Standard RegEx syntax.

Last edited by narayan (2019-01-09 16:56)

Offline

#4 2019-01-16 21:07

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: Use the same separator consistently for all commands

Alternatively, we can add an option to explicitly enable/disable multi-item delimiter handling, which can be disabled if the multi-item delimiter needs to be interpreted literally.

Added to the feature suggestions list.

Offline

Board footer

Powered by FluxBB