@jamesjones
Those are good points.
Some of those cases are already addressed in the linked patch, while others could definitely use some refinement.
Empty values: The current implementation splits on |, trims whitespace, and explicitly skips empty values. So Rock||Country behaves the same as Rock|Country, and a completely empty list won't generate a match-everything condition.
Substring matching: I intentionally kept the behavior consistent with the existing contains operator. For example, searching for Rock would also match Classic Rock, Hard Rock, etc.
In my own music library, I've worked around that limitation by formatting multi-value Genre tags like this:
"; Rock ; Country ; Alternative Rock ;"
That allows me to search for "; Rock ;|; Country ;" and match individual genre values rather than arbitrary substrings. It's admittedly a library-specific convention, but it works well for my purposes.
Escaping: You're right about %, _, and literal delimiters. Those aren't explicitly handled in the current patch and would be worth addressing.
Case sensitivity: My intention was to retain the same behavior as Strawberry's existing contains operator. I agree that this should be verified, particularly for non-ASCII characters.
Operator compatibility: I appended the new operator enum value rather than inserting it among existing values, preserving their original IDs. Compatibility with older Strawberry versions encountering the new operator is worth considering separately.
Background: This was an AI-assisted proof of concept, and my initial goal was to see whether this relatively simple approach was viable. I borrowed the idea from Rockbox while working on its playlist configuration, where I discovered the @~ operator, which provides similar pipe-delimited matching functionality.
I've successfully compiled and tested the patch against Strawberry 1.2.31 with my own music collection, but haven't added automated tests or tried it against the current development branch.