Release Year/Date Regular Expression Question

Hello. I am new to the forum, but I love using MP3Tag. I recently converted a lot of my wife's iTunes files to FLAC and I used MusicBrainz to fix most of the tags that were incorrect. However, what I don't like about MusicBrainz is how it always lists the exact date for the release year instead of just the date. Is there any way to make a regular expression change a date from this:

2015-02-21 to just 2015

Thank you very much for all of your time. I have tried figuring out the syntax for regular expressions, but given my lack of coding knowledge, it basically looks like a completely foreign language to me.

You don't need regular expression for this, $left() can be used instead (see the useful Scripting docs for more):


Which when used to format the Year tag will keep only the leftmost 4 characters and remove everything else.

To preview how this will look open the Convert menu>Tag - Tag, then change the Field to YEAR and in the Format String paste the above code.

Personally I prefer adding the full year/date as then if need be it can merely be displayed differently with title formatting in such players as foobar2000, however there may be other reasons why you need to truncate it permanently (or just personal preference I guess).

the $left() is of course valid.

I just tried

and this leaves just the first number. No need to start counting the digits...

Are those files lossless to begin with? You'd be wasting your time otherwise.

Thank you very much for that. I had looked through the scripting commands, but I instead had opted for the $cutright script, which would have left me without a date if I was trying to alter a file that only had the four-digit year to begin with. Thanks.

Haha, hence why I hate iTunes. Some of them were 256kbps, which isn't a very bad bitrate, but some of them were a paltry 128kbps. They were bought off of iTunes (which I don't do to begin with for this reason alone) and there is no way to change the bitrate of the song at all from iTunes' end. So, because I do a lot of conversion to other devices using MusicBee, I decided to convert them all to FLAC files so that I would at least be able to preserve the original "quality" of the file, instead of constantly converting from lossy to lossy. And yes, I do realize that even after this conversion to FLAC files, I will still lose about as much audio data as I would have converting from lossy to lossy in the first place.

The original quality of the music was destroyed when you bought them in those low quality mp3 such as the 128's.

Sorry to say you're not going to put the info back in the file that's already lost.

Trancodes / Frequency ranges (Hz):
128kbps / 16k Hz
256kbps / 19.5k Hz
320kbps (highest mp3 encoding) / 20.5k Hz (human hearing threshold more or less)
FLAC / (22k Hz) which is lossless

Converting lossy to lossless is a complete loss of your time and hard drive space I'm sorry to say.

Musicians poured their blood sweat and tears into putting those higher frequencies into that music. So clicking a magic button is not going to put that back.

Search the web on this subject, there's lots of info out there.

To get a better basic understanding of Frequency of music look at these images. The program is Spek BTW (

Fake 320kbps Actually 128kbps (16k Hz):

Real FLAC (22k Hz):

Your files will still look like the top image even though they're FLAC. Test one file and see. If your ears hear a difference they're lying :wink:

Well, for the record, I was not the one that purchased the files. I always buy CDs and rip them myself with FLAC. And yes, I do know that some of the information is already lost. What I am saying is that I converted the files to FLAC to save what frequencies I could before any more degradation could occur due to my large amount of file conversions I do to various devices. I'm not saying that I could resurrect the frequencies that were already lost; only saying that I didn't want any more frequency loss from occurring in the future.