# Filter for capitals does not work

**URL:** https://community.mp3tag.de/t/filter-for-capitals-does-not-work/65093
**Category:** Support
**Created:** [June 20, 2024, 1:00pm UTC](https://community.mp3tag.de/t/filter-for-capitals-does-not-work/65093 "2024-06-20T13:00:46Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![djrip](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/3ab097/32.png) [@djrip](https://community.mp3tag.de/u/djrip)
#### Post date: [June 20, 2024, 1:00pm UTC](https://community.mp3tag.de/t/filter-for-capitals-does-not-work/65093/1 "2024-06-20T13:00:46Z")

</div>

> [@Filter expressions](https://community.mp3tag.de/t/filter-expressions/10080/5):
>
> "$if($eql($regexp(%title%,^\u\u\u\u,),%title%),yes,no)" IS no

Hi, If [A-Z] finds capitals and [A-Z]{4} should find 4 capitals, why doesn't

`"$if($eql($regexp(%title%,[A-Z]{4},),%title%),yes,no)" IS no`

work?

Oh, cos I have to put the expression in ' expression ', like...

`"$if($eql($regexp(%title%,'[A-Z]{4}',),%title%),yes,no)" IS no`

But then shouldn't `%title% MATCHES '[A-Z]{4}'` do the same?

---

<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: [June 20, 2024, 1:07pm UTC](https://community.mp3tag.de/t/filter-for-capitals-does-not-work/65093/2 "2024-06-20T13:07:07Z")

</div>

See the notes on filters:

> **[Filter and Search – Mp3tag Documentation](https://docs.mp3tag.de/filter/#notes)**
>
> Documentation on Filter and Search and keywords to form complex filter expressions. Mp3tag is the universal Tag Editor.

All operations are non-case sensitive. All filter keywords must be uppercase

If you want to force the filter to take care of the case, try  
`%title% MATCHES (?-i)[A-Z]{4}`

---

<div class="post-metadata">

### Author: ![djrip](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/3ab097/32.png) [@djrip](https://community.mp3tag.de/u/djrip)
#### Post date: [June 20, 2024, 1:10pm UTC](https://community.mp3tag.de/t/filter-for-capitals-does-not-work/65093/3 "2024-06-20T13:10:27Z")

</div>

The exp `%title% MATCHES '(?-i)[A-Z]{4}'` shows all files... whereas  
`"$if($eql($regexp(%title%,'[A-Z]{4}',),%title%),yes,no)" IS no`  
shows the desired result

---

<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: [June 20, 2024, 1:11pm UTC](https://community.mp3tag.de/t/filter-for-capitals-does-not-work/65093/4 "2024-06-20T13:11:38Z")

</div>

@djrip  
Please use backticks or the code-symbol to enclose your format strings.

 ![image](https://community.mp3tag.de/uploads/default/original/3X/5/a/5aff9ef7002aef5527128828504e321be7e31b81.png)  
Source: [Hints for asking Support Requests](https://community.mp3tag.de/t/hints-for-asking-support-requests/56190#use-formatting-when-necessary-4)

---

<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: [June 20, 2024, 1:24pm UTC](https://community.mp3tag.de/t/filter-for-capitals-does-not-work/65093/6 "2024-06-20T13:24:07Z")

</div>

> [@ohrenkino](#):
>
> `%title% MATCHES (?-i)[A-Z]{4}`  
> then you get all titles with 4 capital letters

Exactly.  
And with  
`%title% MATCHES (?-i)[a-z]{4}`  
you would filter fo all titles with 4 following lowercase letters, at whatever position they occur in **title**

---

<div class="post-metadata">

### Author: ![djrip](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/3ab097/32.png) [@djrip](https://community.mp3tag.de/u/djrip)
#### Post date: [June 21, 2024, 1:39pm UTC](https://community.mp3tag.de/t/filter-for-capitals-does-not-work/65093/8 "2024-06-21T13:39:56Z")

</div>

Thanks. I also discovered `title MATCHES (?-i)\s[a-z]` finds words that start with a lower case letter, regardless of position. Why is it that we can't filter case sensitive results using regex MATCHES.

---

<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: [June 21, 2024, 1:42pm UTC](https://community.mp3tag.de/t/filter-for-capitals-does-not-work/65093/9 "2024-06-21T13:42:22Z")

</div>

> [@djrip](#):
>
> Why is it that we can't filter case sensitive results using regex MATCHES.

I thought that @LyricsLover and me described 2 ways to do exactly that: filter case-sensitively which is switched on with `(?-i)`

---

<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: [June 21, 2024, 1:51pm UTC](https://community.mp3tag.de/t/filter-for-capitals-does-not-work/65093/10 "2024-06-21T13:51:06Z")

</div>

> [@djrip](#):
>
> Why is it that we can't filter case sensitive results using regex MATCHES.

`(?i)` starts case- **in** sensitive mode  
`(?-i)` turns off case-insensitive mode **aka** case-sensitive

> [@djrip](#):
>
> `(?-i)\s[a-z]` finds words that start with a lower case letter, regardless of position

You are searching for a whitespace character followed by a lowercase letter between a and z.  
You don't define if it has to match at the start or the end of your content.

---

<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: [July 21, 2024, 1:51pm UTC](https://community.mp3tag.de/t/filter-for-capitals-does-not-work/65093/11 "2024-07-21T13:51:26Z")

</div>

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