Feature request- convert to alphanumeric only

I'd like to be able to strip out all ' " \ @ etc etc out of the filenames I am generating. I tried $validate() but it still allows ' and ( through. If I had an $alphanum, $alpha, $num functions then I could force the filename to not have any strange characters in it.

  • $alphanum(x,)- converts to characters a-z, A-Z and other international letters (ie accented letters) or digits 0-9
  • $alpha(x)- converts to characters a-z, A-Z and other international letters (ie accented letters)
  • $num(x)- converts to digits 0-9 only
anum

Thanks!!!

I think that your preferences are a little special as the terms are already occupied by much older conventions.
If you have a particular disliking of some characters ( bracket is a no-no but hyphen is ok?!) you are free to create some actions which search the filename and replace the characters in question.

My understanding of $validate() is, that this function suppresses only those characters, which are not allowed to be used within a filename or filepath.
The single apostroph and some sort of brackets are allowed characters to create a filename.

A function $num() is already covered in Mp3tag scripting language and would collide with your wish, because of different functionality.

Have you tried the function $replace()?
Example:
$replace('test'$char(39)'test',$char(39),$char(95))
$replace('test''''test',$char(39),)
$replace('test''''test','',
)
$replace(test''test,'',_)
... will give the same result:
test_test

Example:
$replace('äöüÄÖÜß','ä','a','ö','o','ü','u','Ä','A','Ö','O','Ü','U','ß','ss')
$replace(äöüÄÖÜß,ä,a,ö,o,ü,u,Ä,A,Ö,O,Ü,U,ß,ss)
... will give the same result:
aouAOUss

Have you tried the function $regexp?
Example:
$regexp('test123öäütest','[^a-zA-Z0-9]',)
Result:
test123test

Example:
$regexp('test123öäütest','[^a-zA-Z]',)
Result:
testtest

Example:
$regexp('test123öäütest','[a-zA-Zöäü]',)
Result:
123

How to convert Unicode characters to ASCII/ANSI characters read there ....
Unicode to ASCII
[X] Regexp error
Change Bartók Béla to Bartok Bela (loose the special chars)

DD.20100321.1401.CET