Help with complex filter criteria

I'm trying to set a filter with the logic:

(title HAS Symphony)
(not title matches Symphony No. [0-9] in [A-G]( |-sharp |-flat )(Minor|Major),(| '(.*?)',) (Op. |K|WoO )([1-9][0-9]{0,2}) - (I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV).)

Each works fine individually, but I get no results when combining them, even though I should. Any thoughts?

Could you please post the exact filter expression for the combination.
The one above cannot work, even individually, because "and" and "matches" and "not" have to be written in capitals.
(I have not examined the regular expression)

Thank you. I did have AND capitalized in the filter, but not NOT. Changing that does give results, but still unexpected. For example a track simply titled "Aria" shows up, even though it doesn't meet the criteria set by the filter, specifically, title HAS Symphony.

This should do the trick:

(title HAS Symphony) AND NOT (title MATCHES "Symphony No\. [0-9] in [A-G]( |-sharp |-flat )(Minor|Major),(| '(.*?)',) (Op\. |K|WoO )([1-9][0-9]{0,2}) - (I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV)\.")

Unfortunately not. I get the same results. It appears to be an issue with NOT and AND together. Any filter I try that is something like: "(title HAS Symphony) AND NOT (artist HAS Berlin)" does not filter results at all. It's displaying 3997/3997 tracks. If I drop the NOT, it filters correctly. If I have a query with a single parameter, e.g. "NOT artist HAS Berlin", it filters correctly. "(title HAS Symphony) AND (artist HAS Berlin)" also filters correctly.


Thanks for your thorough analysis. In the meantime I've reviewed the code and wrote some additional tests which revealed a non-deterministic behavior in operator precedence :crazy_face:

I'll work on a fix and will keep you posted.

Thank you so much! Sorry about the bug, that sounds like it will be a bit of a pain to fix. I love this app though, definitely the best I've found for finally getting my library in order!

1 Like

I've just released Mp3tag for Mac v1.5.1 which fixes the non-deterministic behavior in filter operator precedence.

All your expressions should now work as expected — if you notice anything you can't explain, please let me know.

1 Like