Reformat Items with comma

A swapping-ground for Regular Expression syntax

Reformat Items with comma

Postby j.zulkeski » Fri Nov 18, 2016 8:28 pm

File names are dash separated.

album-number-last,first-song name.zip

would like:

album-number-first last-song name.zip

However, I do not want to touch items named:

album-number-name,the-song name.zip

Can someone please help me regex this? Pretty sure I have to replace ", the" with something the replace it after the swap, but I rarely use regex so I'm not sure how to format it.
j.zulkeski
 
Posts: 4
Joined: Thu Oct 15, 2015 8:09 pm

Re: Reformat Items with comma

Postby j.zulkeski » Fri Nov 18, 2016 9:50 pm

Got it. Did:

(.*)-(.*)-(.*), (.*)-(.*)

replaced:

\1-\2-\4 \3-\5
j.zulkeski
 
Posts: 4
Joined: Thu Oct 15, 2015 8:09 pm

Re: Reformat Items with comma

Postby Admin » Fri Nov 18, 2016 11:04 pm

8)
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm


Return to Regular Expressions