QNS: How to exact match?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
binocular222
Posts: 1424
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

QNS: How to exact match?

Post by binocular222 »

I search for
Light show,
But it match
Highlights of previous show,
Then, how to do exact match? (I tried double quote, but search result shows nothing)
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: QNS: How to exact match? Quick Name Search

Post by Stefan »

I don't know if I get you correctly? Please describe yourself more clearly and provide better examples


How do you utilize Quick Name Search (QNS)?


To do an exact match from the address bar, just write the exact name into the address bar like:
C:\Temp\exactname.txt

and exactname.txt will be highlighted.




Read the help under "Main Topics" about "Quick Name Search" to discover more examples with jokers and regex.
C:\Temp\?>^exactname.*.txt$



.

binocular222
Posts: 1424
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Re: QNS: How to exact match?

Post by binocular222 »

The problem is the space chacracter. Searching for Light show, should not match Highlights of previous show, but in XY, it's a match.
I want to do exact match for Light show, (with the space in between).
Regex does the trick, but it's much slower than QNS
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: QNS: How to exact match?

Post by TheQwerty »

Searching for just ?light show tells XY to search for anything containing light AND show which can be useful at times. For details on what is going on check out Loose Boolean Match under the Name section of the Find Files page in the documentation. (Or included below...)

You say double-quotes didn't work for you, but they seem to work for me:
screenshot.13.png
Another option would be to surround it with wildcards (?*light show*) so XY treats it as a single query, but this might still match more than you want:
screenshot.14.png
You also get similar results to the last one by telling XY to treat the pattern as boolean (?:light show) or regular expression (?>light show).


Help wrote:Loose Boolean Match (LBM)

Mimics Windows Explorer behavior, where you can enter two or more strings separated by blanks and find al items that match ALL of the strings (i.e. they are AND-combined logically).

For example, "work 2006" (without the quotes) will find all items that have "work" and "2006" somewhere in their name (regardless of the order). In other words, "work 2006" is internally-smartly-automatically-conveniently transmutated into the Boolean expression "*work* AND *2006*".

- LBM does only work in Standard Mode (see above)

- Note that OR-combining patterns (using ";", see Simple multiple pattern search above) has precedence over LBM, so the following search term

Code: Select all

a;b c
is interpreted as

Code: Select all

"*a*" OR "*b c*"
and not as

Code: Select all

"*a;b*" AND "*c*"
- To avoid LBM and find all items containing "work 2006" somewhere in their name enclose it in asterisks: "*work 2006*".

- To avoid LBM and find all items matching "work 2006" exactly put it in quotes (a leading quote is enough).

- Note that LBM can be inverted by "!", and it does work from the Address Bar as well, for example:

Code: Select all

Desktop?a b c    Find all items that contain the characters a, b, and c in their name.
Desktop?!a b c   Find all items that do not contain all the characters a, b, and c in their name (but only some or none of them).
[/size]
To see the attached files, you need to log into the forum.

binocular222
Posts: 1424
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Re: QNS: How to exact match?

Post by binocular222 »

Thanks,
Wrapping around asterisk works, but it's strange that the double quote refuse to work for me
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: QNS: How to exact match?

Post by armsys »

Thanks binocular222 for raising a functional question beneficial to our XY daily usage. :appl:
Thanks Stehan & TheQwerty's painstaking effort to shed light on the QNS. :appl:
Stefan wrote:Read the help under "Main Topics" about "Quick Name Search" to discover more examples with jokers and regex.
:blackstorm: BTW, Stehan, by 'jokers,' do you mean Batman? I'm confused! :roll:

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: QNS: How to exact match?

Post by Stefan »

armsys wrote:
Stefan wrote:Read the help under "Main Topics" about "Quick Name Search" to discover more examples with jokers and regex.
:blackstorm: BTW, Stehan, by 'jokers,' do you mean Batman? I'm confused! :roll:
No, I meant "wildcard character" like '*' and '?', in german called 'Joker', and I was assuming that's true in english too :roll:


:arrow: In computer (software) technology, a wildcard character can be used to substitute for any other character or characters in a string.

:arrow: Wildcard (vom englischen Wildcard, einer Spielkarte im Poker), Joker (nach Joker, einer Spielkarte)
oder Platzhalter ist ein Fachausdruck aus dem Computer-Bereich und bezeichnet einen Platzhalter für andere Zeichen.

(from wikipedia)


.

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: QNS: How to exact match?

Post by armsys »

Stefan wrote: :arrow: Wildcard (vom englischen Wildcard, einer Spielkarte im Poker), Joker (nach Joker, einer Spielkarte)
oder Platzhalter ist ein Fachausdruck aus dem Computer-Bereich und bezeichnet einen Platzhalter für andere Zeichen. .
Es tut mir leid. Ich spiele nicht Karte. Das ist, warum ich den Joker verpassen. :oops:
Vielen Dank für Ihre Klarstellung. :appl:

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: QNS: How to exact match?

Post by armsys »

TheQwerty wrote:Searching for just ?light show tells XY to search for anything containing light AND show which can be useful at times. For details on what is going on check out Loose Boolean Match under the Name section of the Find Files page in the documentation. (Or included below...)
Hi TheQuerty,
Thank you for your moving heaven & earth effort :blackstorm: in graphically elucidating the nuances of various LBM patterns which were foggy to me. In particular, I'm impressed by your illustrious example:

Code: Select all

a;b c is interpreted as "*a*" OR "*b c*"
and not as "*a;b*" AND "*c*"
Usually other apps (such as Ultra Recall) take AND precedence over OR.
But you remind us the reverse.
Question:
I wonder if Don has optimized the OR operator to speed up the comparison.
For example, for "?A;B", if A is TRUE (found in a filename), will XY skips B?


Appreciate your enormous contribution to the XY community. :appl: :appl: :appl:

admin
Site Admin
Posts: 67223
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: QNS: How to exact match?

Post by admin »

armsys wrote:I wonder if Don has optimized the OR operator to speed up the comparison.
For example, for "?A;B", if A is TRUE (found in a filename), will XY skips B?
Of course! :ugeek:

Post Reply