# Validate function ignores backslash

**URL:** <https://community.mp3tag.de/t/validate-function-ignores-backslash/18687>\
**Category:** Support\
**Created:** [February 10, 2017, 12:31am UTC](https://community.mp3tag.de/t/validate-function-ignores-backslash/18687 "2017-02-10T00:31:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![culinko](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/dc4da7/32.png) [@culinko](https://community.mp3tag.de/u/culinko)\
**Post date:** [February 10, 2017, 12:31am UTC](https://community.mp3tag.de/t/validate-function-ignores-backslash/18687/1 "2017-02-10T00:31:17Z")

</div>

Greetings!

I'd like to ask, is it intended that the $validate function ignores the backslash symbol? All other illegal characters are properly replaced. I ran into this problem recently by trying to convert the tag of the song "40 Years Back\Come" from Röyksopp to filename with the following format string: "$validate([%artist% -]%title%,\_)". I was surprised that the $validate function ignored the backslash and I ended up with a directory "Röyksopp - 40 Years Back" and the song "Come" inside of it (classic windows behavior). I know that I can replace this character by using the $replace function, but I was wondering if the $validate function ignoring the backslash is intended?

Thanks a lot for the feedback, much appreciated!

---

<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:** [February 10, 2017, 4:59am UTC](https://community.mp3tag.de/t/validate-function-ignores-backslash/18687/2 "2017-02-10T04:59:44Z")

</div>

> [@culinko](#):
>
> ... is it intended that the $validate function ignores the backslash symbol? ...

Yes, it is intentional. Using the backslash in a filename allows you to create new folder structures (what you probably just found out unintentionally).

---

<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:** [February 10, 2017, 8:31am UTC](https://community.mp3tag.de/t/validate-function-ignores-backslash/18687/3 "2017-02-10T08:31:36Z")

</div>

> [@culinko](#):
>
> ... is it intended that the $validate function ignores the backslash symbol? All other illegal characters are properly replaced. ...

The function $validate() is able to make a text string valid to be used as a path name in the filesystem. If you want to do this, then use this function.

Note: $validate allows the backslash as the delimiter within a path string.  
Note: $validate allows the colon to exist at position 2 counted from the left edge of the string, when used as the separator for the drive letter.

Usage: $validate(,)  
Following invalid characters will be replaced with ReplaceChar:  
034 "  
042 \*  
047 /  
058 :  
060 \<  
062 \>  
063 ?  
124 |

Otherwise characters or strings can be replaced by the functions $replace() or $regexp(), or by the actions "Replace", "Replace with Regular Expression".

DD.20170210.1031.CET

---

<div class="post-metadata">

**Author:** ![culinko](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/dc4da7/32.png) [@culinko](https://community.mp3tag.de/u/culinko)\
**Post date:** [February 10, 2017, 12:45pm UTC](https://community.mp3tag.de/t/validate-function-ignores-backslash/18687/4 "2017-02-10T12:45:32Z")

</div>

Thank you for the answers. So if I wanted to continue to use validate and also replace any backslashes, how would the string need to look like? I came up with this, but I am not sure if it's correct.

$validate($replace([%artist%] - %title%,,_),_)

---

<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:** [February 10, 2017, 5:18pm UTC](https://community.mp3tag.de/t/validate-function-ignores-backslash/18687/5 "2017-02-10T17:18:38Z")

</div>

> [@culinko](#):
>
> ... So if I wanted to continue to use validate and also replace any backslashes, how would the string need to look like? ...

If you don't want to use the function $validate, then you may apply the function $replace this way ...

**$replace([%ARTIST%' - ']%TITLE%,'\','\_','"','\_','\*','\_','/','\_',':','\_','\<','\_','\>','\_','?','\_','|','\_')**

DD.20170210.1918.CET

---

<div class="post-metadata">

**Author:** ![culinko](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/dc4da7/32.png) [@culinko](https://community.mp3tag.de/u/culinko)\
**Post date:** [February 10, 2017, 6:34pm UTC](https://community.mp3tag.de/t/validate-function-ignores-backslash/18687/6 "2017-02-10T18:34:43Z")

</div>

I don't know why do you assume that I don't want to use the $validate function anymore when I said that I do want to continue using it, but in addition I want to replace the backslash with underscore. Do you think the string in my previous post is correct? Thanks!

---

<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:** [February 11, 2017, 7:10am UTC](https://community.mp3tag.de/t/validate-function-ignores-backslash/18687/7 "2017-02-11T07:10:22Z")

</div>

> [@culinko](#):
>
> ... Do you think the string in my previous post is correct? ...

Because you gave different formatstring examples in your posts #1 and #4, ...  
and because you have applied the special functionality of the "[...] square bracket function", ...  
I cannot judge about the correctness of your formatstrings.

You can check a formatstring for your own within the converter "Tag - Tag", ...  
because the converter dialog offers a preview of the result of a given formatstring.

DD.20170211.0910.CET

---

<div class="post-metadata">

**Author:** ![culinko](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/dc4da7/32.png) [@culinko](https://community.mp3tag.de/u/culinko)\
**Post date:** [February 11, 2017, 12:10pm UTC](https://community.mp3tag.de/t/validate-function-ignores-backslash/18687/8 "2017-02-11T12:10:08Z")

</div>

> [@DetlevD](#):
>
> Because you gave different formatstring examples in your posts #1 and #4, ...

Of course I gave a different string in post #4, I just included the replacing of backslash into it. And since I don't know script formatting very well, I was asking you because I though you know script formatting well (I assumed this from the 6k forum posts you have).

> [@DetlevD](#):
>
> and because you have applied the special functionality of the "[...] square bracket function",

Yes, because some of my files don't have an artist (yet) so I simply want them to be named just "Title".

> [@DetlevD](#):
>
> You can check a formatstring for your own within the converter "Tag - Tag", ...  
> because the converter dialog offers a preview of the result of a given formatstring.

I am aware that there is a preview, but I wasn't sure if this will work with all of my current (and future) files without giving me any errors at some point. Anyway, thanks for all of your feedback, I will simply use the string and hope it will work correctly every time.

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:26pm UTC](https://community.mp3tag.de/t/validate-function-ignores-backslash/18687/9 "2026-02-09T12:26:39Z")

</div>


