by Luuk » Mon Sep 20, 2021 8:02 pm
There is usually four different ways that Im seeing users conduct renames like the explanation.
The first is putting a checkmark in "simple", so then using a 'Match' and 'Replace' like...
%1 - %2 (%3)
%1 - %3 - %2
The simple expressions cant verify that %3 is a year, so instead some users say it like...
%1 - %2 (20%3)
%1 - 20%3 - %2
So at least then, they can know any text inside of the parenthesis will start with "20".
Without a checkmark in "simple", the three main ways Im usually seeing...
^(.+ - )(.+) \((\d{4})\)$
\1\3 - \2
This makes sure there are 4-digits inside of parenthesis, and the very last " - " says "end of Artist".
Without simple, we use \( and \) to say "(" and ")" since otherwise, the regex will use them for grouping.
^([^-]+ - )([^-]+) \(((19|20)\d{2})\)$
\1\3 - \2
Its just like above, except replacing "." with "[^-]" and also makes sure that year starts with 19 or 20.
Some users like doing it this way, to forbid renaming any files that have more than one hyphen.
^((?:(?! - ).)+ - )((?:(?! - ).)+) \(((19|20)\d{2})\)$
\1\3 - \2
Its just like above, but instead of forbidding more than one hyphen, it forbids having more than one " - ".
So names like... "Some-Artist-Name - Some-Title (Year)" could still be renamed, if its a worry.
Im usually type something like the last one, but its only because Im often conducting very many sub-folders.
And its unfortunate, but my filename-formats are often very different, so Im always being very extra careful.
For many users, the "simple" is good enough.. It really just depends on how different your filenames can be.