# number of special character in string

**URL:** <https://community.mp3tag.de/t/number-of-special-character-in-string/18837>\
**Category:** Support\
**Created:** [March 27, 2017, 3:18am UTC](https://community.mp3tag.de/t/number-of-special-character-in-string/18837 "2017-03-27T03:18:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![peymanch](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/65b543/32.png) [@peymanch](https://community.mp3tag.de/u/peymanch)\
**Post date:** [March 27, 2017, 3:18am UTC](https://community.mp3tag.de/t/number-of-special-character-in-string/18837/1 "2017-03-27T03:18:47Z")

</div>

**hi  
i want to find how many special string like "-" in string?  
for example  
my filename is:  
asef-bi-maram.mp3  
i want to find number of hyphen (-) in the filename  
please help me  
thank you**

---

<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 27, 2017, 3:54am UTC](https://community.mp3tag.de/t/number-of-special-character-in-string/18837/2 "2017-03-27T03:54:44Z")

</div>

> [@peymanch](#):
>
> hi
> 
> i want to find number of hyphen (-) in the filename

Please stop using the bold font. I don't need to yelled at to answer. I am not that old yet.

I once had a filter to find the folder depth.  
So perhaps something like this would help:

$add($len($regexp(%\_filename%,'[^-]',)),1)  
It returns a value 1 too high

If you want to use it in a filter, try something like this:  
"$add($len($regexp(%\_filename%,'[^-]',)),1)" IS 3  
to find 2 -

---

<div class="post-metadata">

**Author:** ![peymanch](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/65b543/32.png) [@peymanch](https://community.mp3tag.de/u/peymanch)\
**Post date:** [March 27, 2017, 4:46am UTC](https://community.mp3tag.de/t/number-of-special-character-in-string/18837/3 "2017-03-27T04:46:43Z")

</div>

> [@ohrenkino](#):
>
> Please stop using the bold font. I don't need to yelled at to answer. I am not that old yet.
> 
> I once had a filter to find the folder depth.  
> So perhaps something like this would help:
> 
> $add($len($regexp(%\_filename%,'[^-]',)),1)  
> It returns a value 1 too high
> 
> If you want to use it in a filter, try something like this:  
> "$add($len($regexp(%\_filename%,'[^-]',)),1)" IS 3  
> to find 2 -

ok got it  
i use this  
$len($regexp(%\_filename%,'[^-]',))

---

<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/number-of-special-character-in-string/18837/4 "2026-02-09T12:26:45Z")

</div>


