Scenario
I use third-party file renaming software that is written in Delphi and supports the pascal script: http://www.den4b.com/?x=products&product=renamer
The application allows you to use regular expressions to rename files. this means that if what I need to do with the file name cannot be performed using only one RegEx, then I could use different expressions at the same time or also pascal-script code to place the file name until I can format it correctly file name for the needs of this question or something else ...
Problem
I need to format the song file names like below in these names: β ... with the artistβs image β is to the right of the line, I need to match this and put it on the left side of the line.
- Carbin and Sirmark - Sorry Feat. Sevener
- Kristjan Cash Cash - Take Me Home Feat. Bebe Rexha (Revoke Remix)
To make this easy to understand, we could imagine the tokenization of the file name as follows:
[0]ARTIST [1]DASH [2]TRACK [3]FEAT_ARTIST [4]POSSIBLE_ADDITIONAL_INFO_INSIDE:()[]{}
Then, what I need to do with RegEx formats the file name in order to position the tokens in the following order:
[0]ARTIST [3]FEAT_ARTIST [1]DASH [2]TRACK [4]POSSIBLE_ADDITIONAL_INFO_INSIDE:()[]{}
I really do this with this RegEx:
\ A ([^ -]?) \ S- \ s * \ s ([([]) ((feet [\ s] | feat [\ s] | distinguishing [(.?) ... \ s]) [^ () {} []] *) ([)]])? (. +)? \ Z
Replace with
$ 1 $ 4 - $ 2 $ 7
, [0]ARTIST [2]TRACK , , , :
- Dj E-nergy C-21 - Super-hero! feat Dj Ass-hole
, , , , - , , , isn ' t, , .
ingenuos, , , filename , , .
RegEx, , / , , [0]ARTIST [2]TRACK ?
... , , RegEx , 1 "... > " ? ( )
Regex , [1]DASH [3]FEAT_ARTIST, , ( )
, Regex - ([\-]){1}, , , , .
...
[3]FEAT_ARTIST, , [0]ARTIST [2]TRACK.
- : ' Carbin and Sirmark - Feat. Sevener
- To: ' Carbin and Sirmark Feat. Sevener - '
[3]FEAT_ARTIST, , [0]ARTIST [2]TRACK. [4]POSSIBLE_ADDITIONAL_INFO_INSIDE:()[]{}.
- : ' Flight Facilities - Heart Attack Feat. (Snakehips Remix) '
- To: ' Feather. - (Snakehips Remix) '
[3]FEAT_ARTIST, , [0]ARTIST [2]TRACK. [4]POSSIBLE_ADDITIONAL_INFO_INSIDE:()[]{}, .
- : ' Flight Facilities - Heart Attack Feat. Owl Eyes [Remix] -
- To: ' Feather. - [Remix] -
[0]ARTIST a [2]TRACK, [3]FEAT_ARTIST, .
- : ' Fedde Le Grand - Cinematic'
- To: ' Fedde Le Grand - Cinematic'
[0]ARTIST a [2]TRACK, [3]FEAT_ARTIST [1]DASH, .
- : ' Fedde Le Grand Feat. Denny White - '
- To: ' Fedde Le Grand Feat. Denny White - '
[0]ARTIST , , [0]ARTIST [2]TRACK, Regex , .
[2]TRACK , , [0]ARTIST [2]TRACK, Regex , .
- : ' - --
- To: ' - -- feat someone
[0]ARTIST [2]TRACK , , , Regex , .
- : ' Dj E-nergy C-21 - -! feat Dj Ass-hole '
- To: ' Dj E-nergy C-21 - Super-hero! feat Dj Ass-hole '
[0]ARTIST [2]TRACK , [3]FEAT_ARTIST , .
- : ' Dj E-nergy C-21 - Super-hero!'
- To: ' Dj E-nergy C-21 - Super-hero!'
, , .