^(\w+) - (\d+). (.+) \((\d+)\) \[(\w+)]
I created the following regex to match a pattern of directories I use to store my music collection in.
The general pattern for the directory structure is like this
artist - albumnr. albumname (year) [quality]
I am trying to match into groups the artist, albumname, year and quality. However, I would like to clean up the albumname and remove anything that be inside parentheses or any string that would appear after a dash.
e.g.
albumname -blahblah (remastered)– would just return albumname in the 3rd group matchalbumname (remastered)– would still just return albumnamealbumname– the regex should still be able to return album name even if there is no – or backets within the result.
This one will match
albumname -blahblah (remastered)andalbumname (remastered)but notalbumname (remastered) -blahblah:Test here
If you also want to match against
albumname (remastered) -blahblah