October 15th, 2009, 10:41 AM
Match chars at end of filename, but not extension
I have a list of file names like this:
Song title (30).mp3
Another song title .MP3
A final song (57).wma
What I would like to do is remove those track numbers. The regex I have so far, while not quite working correctly, will match " (57).wma" and replace it with nothing. Instead, I want to preserve the file extension.
Is there a way to specify for the $ anchor to start looking x characters from the end, so it won't match the file extension?
October 15th, 2009, 04:53 PM