by Luuk » Sun Mar 14, 2021 9:38 am
The Regex(1) can do this in first pass, with the "Match" and "Replace" like ...
^\d\d[ -]+(.*)
\1
The ^\d\d[ -]+ is saying "Beginning two numbers, followed by one-or-more "space" or "-".
Then (.*) is saying "(everything else)", so \1 using (.*) as the new name, renaming like...
12 --- filename.txt ===> filename.txt
12-filename.txt =====> filename.txt
12 filename.txt =====> filename.txt
122 - filename.txt ===> (no rename, because three numbers)
123filename ========> (no rename, because three numbers and no "space" or "-")
12filename.txt ======> (no rename, because no "space" or "-" after "beginning two numbers")
=========================================================================
If also wanting to rename the last example?? Im recommend using this instead..
^\d\d[ -]*([^\d].*)
\1
The ^\d\d[ -]* is saying "Beginning two numbers, followed by zero-or-more "space" or "-".
Then ([^\d].*) is saying "(Not a number, everything else), so \1 using this as the new name.
It also renames the last example, so always removing... "First two numbers" (if not a third number) and any following "space" or "-".
If the solutions cannot help for all of the filenames, then need more examples so maybe there can be another regex to better conduct all of the examples.
Also Im thinking its safer with "Renaming Options, Prevent Duplicates" in case you have any exact same filenames, but with different "Beginning two numbers".