reorder file names with a common separator of space-space

A swapping-ground for Regular Expression syntax

reorder file names with a common separator of space-space

Postby angeltread » Sun Jun 23, 2024 9:12 pm

got a bunc of file names that are basically

onewordname - title with a varying number of words - 2017-10-10 - 1080p.mp4

each section is different, including the date too.
the common separator between each section is <space>-<space> though.
gotta be away to reorder the sections right?

so i wanna reorder that example into

onewordname - 2017-10-10 - title with a varying number of words - 1080p.mp4

help this uneducated out.
angeltread
 
Posts: 6
Joined: Fri Aug 07, 2020 12:03 am

Re: reorder file names with a common separator of space-space

Postby Luuk » Mon Jun 24, 2024 7:16 am

With having a checkmark for "Simple", the Match and Replace could be like...
%1 - %2 - %3 - %4
%1 - %3 - %2 - %4

If its not good enough, can remove the checkmark with a Match and Replace like...
^([^ ]+ - )(.+? - )((?:19|20)\d\d-\d\d-\d\d - )(.+)
\1\3\2\4
Luuk
 
Posts: 803
Joined: Fri Feb 21, 2020 10:58 pm

Re: reorder file names with a common separator of space-space

Postby angeltread » Mon Jun 24, 2024 4:42 pm

ah thanks mate.
totally understand it too i just needed a starting point.
now how to keep it in my brain!!!!
angeltread
 
Posts: 6
Joined: Fri Aug 07, 2020 12:03 am


Return to Regular Expressions