move within brackets etc () [] {}

Advanced Renamer forum
#1 : 04/11-19 03:25
fena
fena
Posts: 4
In this example 13 Aug to Aug 13
02 May to May 02 etc

01-Mindbenders - Omaha (13 Aug 1968)
02-Mindbenders - All Night Worker (02 May 1966)
03-Mindbenders - Cool Jerk (19 Dec 1966)
04-Mindbenders - Rock Me Baby (21st Sep 1967)
05-Mindbenders - Ride Your Pony (22 Aug 1966)
06-Mindbenders - Can't With You Can't Without You (02 May 1966)
07-Mindbenders - Uncle Joe The Ice Cream Man (13 Aug 1968)
08-Mindbenders - Interview-Blessed Are The Lonely (23rd Feb 1968)
09-Mindbenders - The Way You Do The Things You Do (02 May 1966)
10-Mindbenders - We'll Talk About It Tomorrow (14 Mar 1967)

I did try but not sure how to work with word-numbers while inside brackets etc
thanks David


04/11-19 03:25
#2 : 04/11-19 09:53
David Lee
David Lee
Posts: 1125
Use the Replace method using Regular expressions...

Replace: \((.*) (.*) (.*)\)
with: (\2 \1 \3)


04/11-19 09:53
#3 : 04/11-19 10:57
fena
fena
Posts: 4
You make it seem so easy. Thanks for your help plus I have learned something again. Cheers !


04/11-19 10:57
#4 : 04/11-19 11:31
fena
fena
Posts: 4
David this works very well here on your amazing program. I tried the regex on some other programs & it returns with 321 not switching the actual words. Is that because the PCRE library is being used or does your regex not work in perl or other formats. Curious I am to learn. Thanks again.


04/11-19 11:31
#5 : 04/11-19 12:38
David Lee
David Lee
Posts: 1125
Reply to #4:

It's not my program - I'm just an occasional user! The author is Kim Jensen, to whom great credit is due - see: www.advancedrenamer.com/about

The way you use Regex varies between applications so it's difficult to comment on your issue.
For example: the equivalent solution using the Script method in ARen (ie JavaScript) would be:
return item.name.replace(/\((.*) (.*) (.*)\)/, "($2 $1 $3)");

However there are frequently problems with quantifiers such as * and ? being "greedy" - so that a match may include more of the string than desired.

Try the Regex: \(([^ ]*) ([^ ]*) ([^ ]*)\)

This explicitly searches for three sub-strings of characters not including spaces, separated by single spaces.



04/11-19 12:38
#6 : 05/11-19 08:05
fena
fena
Posts: 4
I stand corrected thanks to Kim for this amazing program & to you David for all the help you're offering. I come by here once in a while to learn & you are so helpful to so many people. Thanks again I appreciate learning from your examples. Cheers


05/11-19 08:05