# Filter Expression For Non-Ascii Characters

**URL:** https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572
**Category:** Support
**Created:** [October 27, 2023, 8:33pm UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572 "2023-10-27T20:33:47Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![mrralan](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/ec9cab/32.png) [@mrralan](https://community.mp3tag.de/u/mrralan)
#### Post date: [October 27, 2023, 8:33pm UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/1 "2023-10-27T20:33:47Z")

</div>

Is it possible to search for all file names or folder names that contain non-ascii characters in them? Currently, I right-click a folder and get a command-prompt. Then I run...

powershell -Command "gci -recurse . | where {$\_.Name -match '[^\u0000-\u007F]'}"

and this works. However, it would be nice to be able to get this info in MP3tag if possible.

---

<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: [October 27, 2023, 8:38pm UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/2 "2023-10-27T20:38:06Z")

</div>

see e.g. here:

> [@Filtering European ASCII characters](https://community.mp3tag.de/t/filtering-european-ascii-characters/15805/7):
>
> When I select the above only the first line is copied, and when I try to paste the second line onto the end of the first in the Mp3tag filter, it doesn't seem to work. Also, I'm sure that there's meant to be two commas between the z and the 0 - am I right? In any case, I tried that, and the best I could get was the titles with all numbers in them.

---

<div class="post-metadata">

### Author: ![mrralan](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/ec9cab/32.png) [@mrralan](https://community.mp3tag.de/u/mrralan)
#### Post date: [October 27, 2023, 8:47pm UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/3 "2023-10-27T20:47:30Z")

</div>

Thanks for this. One example hard codes a bunch of characters to search for. Not what I am looking for. But this example, ARTIST MATCHES "[\xc0-\xff]"... is this doing the same thing as the powershell command?

---

<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: [October 27, 2023, 8:48pm UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/4 "2023-10-27T20:48:52Z")

</div>

> [@mrralan](#):
>
> But this example, ARTIST MATCHES "[\xc0-\xff]"... is this doing the same thing as the powershell command?

Have you tried that expression?

---

<div class="post-metadata">

### Author: ![mrralan](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/ec9cab/32.png) [@mrralan](https://community.mp3tag.de/u/mrralan)
#### Post date: [October 27, 2023, 9:37pm UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/5 "2023-10-27T21:37:31Z")

</div>

> [@mrralan](#):
>
> ARTIST MATCHES "[\xc0-\xff]"

Yes, but it is not finding all the ascii characters... for example, ö... and substituting [^\u0000-\u007F] does not yield the correct results.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [October 27, 2023, 10:12pm UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/6 "2023-10-27T22:12:04Z")

</div>

Did you try [this syntax](https://community.mp3tag.de/t/filter-expressions/10080/3):

`ARTIST MATCHES [\x{0000}-\x{007F}]`

(I don't know what the range \u0000-\u007F should include, maybe you can explain what do you like to filter? Do you mean all this characters

> **[U0000.pdf](https://www.unicode.org/charts/PDF/U0000.pdf)**
>
> 498.00 KB

inlcuding all the control chars?  
Or do you mean filter everything except "a-zA-Z0-9äöüàéèÄÖÜ?")

---

<div class="post-metadata">

### Author: ![mrralan](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/ec9cab/32.png) [@mrralan](https://community.mp3tag.de/u/mrralan)
#### Post date: [October 28, 2023, 12:47am UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/7 "2023-10-28T00:47:07Z")

</div>

I have an mp3 player that cannot display certain non-ascii characters. I want to filter anything that has characters that are NOT in the list 0000 - 007f. Once I can identify which file names have these, I can replace them with the ascii equivalent. For example, I had a folder named, Eydie Gormé. I had to change it to Eydie Gorme. So the filter would just show me all the songs with non-ascii characters. The example ARTIST MATCHES "[\xc0-\xff]" found Eydie Gormé but it did not find another folder name with ö in it.

---

<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: [October 28, 2023, 6:37am UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/8 "2023-10-28T06:37:48Z")

</div>

Or see this thread:

> [@Regular expression to filter path names with diacritics](https://community.mp3tag.de/t/regular-expression-to-filter-path-names-with-diacritics/12909):
>
> Some software (in my case I'm thinking of MusicIP) cannot handle file and path names that contain diacritical marks (accents, umlauts, etc.: e.g., é, â, ü, ñ). But you may already have a lot of such paths in your music folders. Here is a filter that will find all these files: NOT %\_path% MATCHES ^[a-zA-Z0-9\W\_]\*$

---

<div class="post-metadata">

### Author: ![mrralan](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/ec9cab/32.png) [@mrralan](https://community.mp3tag.de/u/mrralan)
#### Post date: [October 28, 2023, 6:54am UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/9 "2023-10-28T06:54:36Z")

</div>

NOT %_path% MATCHES ^[a-zA-Z0-9\W_]\*$ is giving me the same results as ARTIST MATCHES "[\xc0-\xff]"... but searching the entire path.

It seems that ö is being found with "[\xc0-\xff]". It's just that I had that character in some TITLES so I had to change it to TITLE MATCHES "[\xc0-\xff]".

What is still not being detected is Apostrophe character. The single quote ' is in the basic latin block (0000-007F), the Apostrophe isn't. I need the search the find these also and then I can replace them with a single quote.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [October 28, 2023, 7:21am UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/10 "2023-10-28T07:21:11Z")

</div>

```auto
* MATCHES [^\x{0000}-\x{007F}]

```

To check in path and all tags.

---

<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: [October 28, 2023, 7:22am UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/11 "2023-10-28T07:22:32Z")

</div>

> [@mrralan](#):
>
> What is still not being detected is Apostrophe character

Are you sure that it is the genuine apostrophe that you are looking for?  
See e.g. here:

> [@Apostrophe vs. Accent aigu](https://community.mp3tag.de/t/apostrophe-vs-accent-aigu/49672/9):
>
> It depends on where you use this apostrophes. If you want to contribute for example to MusicBrainz, you should follow their rules: Use of basic ASCII punctuation characters such as ' and " is allowed, but typographically-correct punctuation (such as ’ for the English apostrophe) is preferred. Source: [https://musicbrainz.org/doc/Style/Miscellaneous](https://musicbrainz.org/doc/Style/Miscellaneous)

---

<div class="post-metadata">

### Author: ![mrralan](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/ec9cab/32.png) [@mrralan](https://community.mp3tag.de/u/mrralan)
#### Post date: [October 28, 2023, 3:01pm UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/12 "2023-10-28T15:01:07Z")

</div>

Yes, the Apostrophe is what I meant. Some of them use the accent in words like "wasn't" or "don't" and these don't work. The only acceptable characters are the ones that fall within the range '[^\u0000-\u007F]'}".

It looks like we have a winner with dano's expression! \* MATCHES [^\x{0000}-\x{007F}] is working the way I want. I don't know why I couldn't get the results with LyricsLover's expression... it appears to use the same range syntax. Thanks everyone!

I use various filters frequently. Pulling them from history is okay until they roll off. Is there any way to store filters that are used a lot so they will always be there?

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [October 28, 2023, 3:03pm UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/13 "2023-10-28T15:03:22Z")

</div>

> [@mrralan](#):
>
> I don't know why I couldn't get the results with LyricsLover's expression

I assume it is not the used unicode range that causes a problem.  
With `*` in front of `MATCHES` you are looking in ALL tags.  
My suggestion was only looking in the ARTIST tag.

~~So it seems that your apostrophe is somewhere else then in the ARTIST tag.~~

**Update:** (18:50 CET)  
After reading the [documentation](https://www.boost.org/doc/libs/1_83_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html#boost_regex.syntax.perl_syntax.negation) again, I think the first `^` character in  
`[^\x{0000}-\x{007F}]`  
makes the difference, because it indicates a _Negation_.  
Definition of _Negation_:

> If the bracket-expression begins with the ^ character, then it matches the complement\* of the characters it contains, for example `[^a-c]` matches any character that is not in the range `a-c`.

\*_As German speaker I had to translate the meaning of "complement".  
Its some kind of "anything other than"._

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [October 28, 2023, 3:06pm UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/14 "2023-10-28T15:06:29Z")

</div>

> [@mrralan](#):
>
> Is there any way to store filters that are used a lot so they will always be there?

Yes, you can click on the small arrow-to-right on the right end of the filter input box  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/e/e74833f22a03f92a4a309a4092b6c5c7640451e0.png)  
and then on "[Manage History](https://docs.mp3tag.de/menus/format-strings/)".

---

<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: [November 27, 2023, 3:07pm UTC](https://community.mp3tag.de/t/filter-expression-for-non-ascii-characters/62572/15 "2023-11-27T15:07:01Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
