How to use Rename Special "RegExp Rename..."?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
klopi
Posts: 5
Joined: 28 Sep 2012 20:21

How to use Rename Special "RegExp Rename..."?

Post by klopi »

i want to rename a lot of folders formated like "Artist - Album (Year)" into "Artist - (Year) Album". I bet it's pretty easy with RegExp Rename if you know how it works but i don't get it :( .
either someone can tell me how it works or simply write me the correctly regex (this would also help me a bit to understand how it works).

thanks

highend
Posts: 14953
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: How to use Rename Special "RegExp Rename..."?

Post by highend »

There are many ways to do it, e.g.:

Code: Select all

(.*?\s-\s)(.*?)\s(\(.*?\)) > $1$3 $2
3 capture groups (surrounded by round parenthesis) and you're assigning them bei $1, $2 and $3. $2 and $3 are switched.
\s = a space
\( or \) = a literal ( or )
.*? capture any character (non greedy)

Test it on a few items first...
One of my scripts helped you out? Please donate via Paypal

klopi
Posts: 5
Joined: 28 Sep 2012 20:21

Re: How to use Rename Special "RegExp Rename..."?

Post by klopi »

works perfeclty
and thanks for the explanation

i think they should add some examples into the yellow textfield above the inputfield like they did at the other rename specials.

Post Reply