# Feature request- convert to alphanumeric only

**URL:** https://community.mp3tag.de/t/feature-request-convert-to-alphanumeric-only/10154
**Category:** General Discussion
**Created:** [March 21, 2010, 6:55am UTC](https://community.mp3tag.de/t/feature-request-convert-to-alphanumeric-only/10154 "2010-03-21T06:55:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![indulis](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@indulis](https://community.mp3tag.de/u/indulis)
#### Post date: [March 21, 2010, 6:55am UTC](https://community.mp3tag.de/t/feature-request-convert-to-alphanumeric-only/10154/1 "2010-03-21T06:55:35Z")

</div>

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!!!

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [March 21, 2010, 8:29am UTC](https://community.mp3tag.de/t/feature-request-convert-to-alphanumeric-only/10154/2 "2010-03-21T08:29:31Z")

</div>

> [@indulis](#):
>
> not have any strange characters in it.

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.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [March 21, 2010, 12:02pm UTC](https://community.mp3tag.de/t/feature-request-convert-to-alphanumeric-only/10154/3 "2010-03-21T12:02:01Z")

</div>

> [@indulis](#):
>
> 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. ...

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](https://community.mp3tag.de/t/7279/1)  
[Regexp error](https://community.mp3tag.de/t/9957/6)  
[Change Bartók Béla to Bartok Bela (loose the special chars)](https://community.mp3tag.de/t/9129/1)

DD.20100321.1401.CET
