Copying Year to front of folder

A swapping-ground for Regular Expression syntax

Copying Year to front of folder

Postby yioryos467 » Wed Dec 10, 2014 5:46 am

Hi,

I have a few movie folders and I want to copy the Year to the front of the folder. I have never used BRU and need some help.
i.e. Just to let you know the [xxxx] also includes.... [1080p], [DVDRiP], and a few others.... I just need the Year to move/copy to the front.

Before I Go to Sleep (2014) [720p]
2014 - Before I Go to Sleep (2014) [720p]

Thank You
yioryos467
 
Posts: 2
Joined: Wed Dec 10, 2014 5:38 am

Re: Copying Year to front of folder

Postby TheRegExpMaster » Wed Dec 10, 2014 8:16 pm

Hi, you must select the folders to process and fill in the following in "RegEx (1)" :

MATCH :
Code: Select all
(.+)(\()(\d{4})(\)\s*\[[^\]]+\])$

REPLACE :
Code: Select all
\3 - \1\2\3\4


This RegEx only works if the folder ends with "(some number of 4 digits) random number of space [any caracter excluding closing brackets]"

For your information :
\1 stores everything before the year
\2 stores the opening parenthesis before the year
\3 stores the year
\4 stores everything after the year

Please tell me if it works ;)
TheRegExpMaster
 
Posts: 25
Joined: Wed Nov 05, 2014 8:45 pm

Re: Copying Year to front of folder

Postby yioryos467 » Wed Dec 10, 2014 11:49 pm

Thank You so much.... it works brilliantly.
It will save me so much time.....

Regards
George
yioryos467
 
Posts: 2
Joined: Wed Dec 10, 2014 5:38 am

Re: Copying Year to front of folder

Postby TheRegExpMaster » Thu Dec 11, 2014 2:43 am

You're welcome George :wink:
TheRegExpMaster
 
Posts: 25
Joined: Wed Nov 05, 2014 8:45 pm


Return to Regular Expressions