Renaming files with tag, replace trailing periods

What is the correct meaning of this code fragment?
If placeholder is empty ... or ... if placeholder contains two double apostrophes?

If you need to test for the existence of any content in a placeholder, then you can code ...
$if(%placeholder%,'yes','no')

If the first meaning is that what you want to do, then you can shorten the format string to ...

$validate('E:\Music\'$regexp($if2(%ALBUMARTIST%,%ARTIST%),'\.+$','_')'\'$regexp(%ALBUM%,'\.+$','_')'\'$num(%TRACK%,2)' '%TITLE%,'_')

... or even better ... see following examples ...


Examples for "Clean Path String"

1.

$validate($regexp('x ... E: \ ... Music \ ...\ ... Artist *2*\ Title 3 ... x','(?:^|(?<=\\\\))[ .]+|[ .]+(?:(?=\\\\)|$)',),'_')

Result = "x ... E_\Music_Album 1_\Artist 2\Title 3 ... x"

2.

$validate($regexp(' ... E: \ ... Music \ ...\ ... Artist *2*\ Title 3 ... ','(?:^|(?<=\\\\))[ .]+|[ .]+(?:(?=\\\\)|$)',),'_')

Result = "E:\Music_Album 1_\Artist 2\Title 3"
Note: $validate respects the colon at the second string position.

3.

$validate($regexp(' ... E: \ ... Music \ ...\ ... Artist *2*\ Title 3 ... ','(?:^|(?<=\\\\))[ .]+|[ .]+(?:(?=\\\\)|$)',),)

Result = "E:\Music\Album 1\Artist 2\Title 3"
Note: $validate respects the colon at the second string position.

4.
This expression might be the safest one to remove all bad characters from the given string ...

$regexp($validate($regexp(' ... E: \ ... Music \ ...\ :.:.: ... | Artist *2*\ ? Title 3 ... ','(?:^|(?<=\\\\))[ .]+|[ .]+(?:(?=\\\\)|$)',),),'(?:^|(?<=\\\\))[ .]+|[ .]+(?:(?=\\\\)|$)',)

Result = "E:\Music\Album 1\Artist 2\Title 3"
Note: $validate respects the colon at the second string position.


DD.20111126.1905.CET
Edit.
DD.20111128.0955.CET