Fun with mp3 tagging: A success story

Eos

Diamond Member
Jun 14, 2000
3,463
17
81
Like most normal people, I fret if the case is not exactly correct on my song files. a, an, the, and, but, or, nor, for, yet, so, as, at, by, for, in, of, to, and from need to be lower case, unless at the start or end of a title.

I have Bulk Rename Utility, but I couldn't figure out how to achieve what I wanted, so I turned to Mp3Tag.

I did have to fix maybe 5% by hand, but these are unique cases. Compilations, etc.

Here's how I fixed every song. These five actions had to be run consecutively:

Action type: Replace with regular expression
Field: _TAG
Regular expression: ([-({\[\]}) _",./+&@:;*])(\l)
Replace matches with: $1$upper($2)
[x] case-sensitive comparison

Action type: Format value
Field: _FILENAME
Formatstring: $regexp(%_filename%,'([-({\[\]}) _",./+&@:;*])(\l)',$1\u$2)

Action type: Replace with regular expression
Field: _All
Regular expression: ^(\l)
Replace matches with: $upper($1)
[x] case-sensitive comparison

Action type: Replace with regular expression
Field: _ALL
Regular expression: (?<![/\-:;\(\)\[\]{}])\s(a|an|the|and|but|or|nor|for|yet|so|as|at|by|for|in|of|to|from)(?=\s)(?!\s[\-\(\)\[\]{}])
Replace matches with: $lower($0)
[ ] case-sensitive comparison

Action type: Replace with regular expression
Field: _ALL
Regular expression: (^|\s|\(|\[|/)'(.{1})
Replace matches with: $1'$upper($2)
[ ] case-sensitive comparison
 

radhak

Senior member
Aug 10, 2011
843
14
81
That is interesting - so this MP3Tag allows search/replace with regular expressions? That should solve a bunch of my tagging issues... stuff that I gave up on believing not possible!
 

Eos

Diamond Member
Jun 14, 2000
3,463
17
81
That is interesting - so this MP3Tag allows search/replace with regular expressions? That should solve a bunch of my tagging issues... stuff that I gave up on believing not possible!

Yeah, I was surprised as well. Bulk Rename Utility is easier to use, and covers 99.9% of cases, but this one was simply not possible with BRU.

Good luck!
 

Hugh Jass

Golden Member
Nov 17, 2011
1,537
23
81
Thanks for this...it will come in very handy for cleaning up the tags on my huge MP3 collection.