Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Literal double quotes in query syntax (Read 1755 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Literal double quotes in query syntax

Double quotation marks are a special character in foobar2000 query syntax, so how can I compare a metadata field with a string that includes literal double quotes? For example what should the query expression be in order to return all library items where the artist is Richard "Groove" Holmes?
I'm late

Re: Literal double quotes in query syntax

Reply #1
Going out on a guess here but did you try $char()? For " it's $char(34). So perhaps Richard "$char(34)"Groove"$char(34)" Holmes.

Re: Literal double quotes in query syntax

Reply #2
Going out on a guess here but did you try $char()? For " it's $char(34). So perhaps Richard "$char(34)"Groove"$char(34)" Holmes.
I just tried your suggestion and I got an "invalid filter expression" warning.
I also tried "$char(34)Groove$char(34)" which did not trigger the warning, but still no items were returned.
I'm late



Re: Literal double quotes in query syntax

Reply #5
This works:
Code: [Select]
"$if($strstr(%artist%,$char(34)),1,0)" IS 1


Re: Literal double quotes in query syntax

Reply #7
Interesting what hits I get if I follow my own tip up there ... of course, precisely the query I entered, returned the right hits :-/   But
' "A" Train'
does not return any Take the "A" Train. Why it returns the track it does return, beats me.

Re: Literal double quotes in query syntax

Reply #8
Double quotation marks are a special character in foobar2000 query syntax, so how can I compare a metadata field with a string that includes literal double quotes? For example what should the query expression be in order to return all library items where the artist is Richard "Groove" Holmes?
You do know that you can just enter:

Richard Groove Holmes

And it will return Richard "Groove" Holmes. If you leave out the ", it will just match the words, which works just fine for me. It doesn't need the exact string.

Mike

Re: Literal double quotes in query syntax

Reply #9
You do know that you can just enter:

Richard Groove Holmes

And it will return Richard "Groove" Holmes. If you leave out the ", it will just match the words, which works just fine for me. It doesn't need the exact string.

Yes, but that compares the search keywords with all metadata fields, which would return, for example, tracks where Richard Groove Holmes is just a sideman, or the composer.
I'm late