Regex to export valid filenames


#1

Hi, I'm fairly new to using regex in mp3tag.

I'm trying to bulk export the cover art to all of my albums to directory using the 'quick action' -> 'export cover to file' 'c:\Covers\%artist%-%album%'

This works great unless there are special characters in the album name (i.e. : or \ etc.).

What regex expression can I use to remove (or replace) any instance of a non-alphanumeric character in the album name? I need to do this without retagging the original files?

I'd like to replace %album% = 'Star Wars - Episode 1: The Phantom Menace'
with 'Star Wars - Episode 1 The Phantom Menace'
or 'Star Wars - Episode 1- The Phantom Menace'

Thanks


#2

$replace(%album%,:,,,)
or
$replace(%album%,:,-,,-)

! This syntax only works since 2.37i

http://help.mp3tag.de/en/main_scripting.html


#3

Thank a lot. That worked great. I must have overlooked the scripting page.

I found what will eliminate all invalid characters is:
$validate(%artist% - %album%,-)