This Python regex allows you to split an audio filename with the sintax Authors - Title (Text1) [Text2].extension into:
AuthorsTitleText1Text2.extension
It is oriented to use .fullmatch() since the objective is to guarantee the capture of lastest groups.
Moreover, it handles copies of the files thanks to the latest non-capturing group (?:\s*-*[\w*\s*]*)?. See the last example.I.e., for the following filenames:
Author - Title.extension
AuthorTitle.extensionAuthor1&Author2-This is a title(feat. Someone)[NoPremiere].mp3
Author1&Author2This is a titlefeat. SomeoneNoPremiere.mp3Author1 & Author2 - Title with & (This) (Is) [Too] [Spaced] .m4u
Author1 & Author2Title with &IsSpaced.m4uname1 - title1 ( album1 ) - copy.mp3
name1title1album1.extensionNote: this regex will only get the latest string in the parentheses and in the square brackets and won't match more of them. In order to obtain all inside them, re.findall() should be implemented. Also, non-word and non-whitespace characters are not supported after the last hyphen.