
zumbrujm
New User
Oct 15, 2009, 6:31 AM
Post #1 of 4
(6628 views)
|
Matching Pattern 4 characters at end of file name, not extension
|
Can't Post
|
|
Hello, I have a list of file names like this: Song title (30).mp3 Another song title [02].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.
s/(\s?((\[\d\d\]|\(\d\d\))\....)$)// 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? Thanks, John
|