Oct 15, 2009, 6:31 AM
Post #1 of 4
Matching Pattern 4 characters at end of file name, 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?