Using a regular expression in assigning a tag


#1

I want to update the Album field of a large number of files. The albums names are actually the parent directory names, but with a prefix of album release year.

1984 - Some Album

One additional complication is that in years when a band released more than one albums, there are suffixes 'a', 'b' in order on the directory name:

1985a - Album 1
1985b - Album 2

I want to strip out the year, the suffix if any, and space-dash-space combination and use the remainder to fill the ID3 Album field.

This does not seem to work (Convert > Tag - Tag):

$regexp(%_directory%, '^\d{4}[a-z]? - ','')

What am I missing?


#2

If I see that correctly, then you have a blank behind the comma in front of the apostrophe.
Strip that and everything should be working:
$regexp(%_directory%,'^\d{4}[a-z]? - ','')


#3

Thanks for the pointer. This is exactly what worked:

$regexp(%_directory%,'^\d{4}[a-z]? - ',)