I'm attempting to use PCRE as part of my scripting and have hit a mental block. Regex is not a strong point for me so please bear with me.
What I have is a file name such as this one:
My music name (Album Name - Artist Name) 2010_12_15_14_45_55 0001.mp3
What I want to do is remove the date/time/unique number from the name which was originally put there by another application. I would like to return a result resembling this:
My music name (Album Name - Artist Name).mp3
Some gotchas to note is there may be more than one set of open/close parenthesis. They need to remain as they contain info about the MP3. Ideally, removing the characters located between the last closing parenthesis and the period before the file name extension.
I put replace in the title as well because I am interested to know how this might be done as well. For instance, replacing the 2010 with 2011.
Thanks in advance.