Wildcards for Content Search.

Features wanted...
Post Reply
SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Wildcards for Content Search.

Post by SkyFrontier »

It would be extremely useful being able to search for "a???????" and have "absolute" as result - only if "a" is followed by 7 other characters, and not present anywhere in the word. "cat" and "bulgaria" would be ignored.
Also, a minimum preview on where in the file the word is located could be a big plus (right click on matching results could open a preview port, like currently Thumbnails View does for images?).
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

nas8e9
Posts: 2232
Joined: 21 Jun 2008 14:50

Re: Wildcards for Content Search.

Post by nas8e9 »

SkyFrontier wrote:It would be extremely useful being able to search for "a???????" and have "absolute" as result - only if "a" is followed by 7 other characters, and not present anywhere in the word. "cat" and "bulgaria" would be ignored.
Also, a minimum preview on where in the file the word is located could be a big plus (right click on matching results could open a preview port, like currently Thumbnails View does for images?).
? as a wildcard is already supported in content search. In your example, do you mean you want to find the whole word "absolute" and thus the Whole words and Wildcards options not to be exclusive?

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Wildcards for Content Search.

Post by SkyFrontier »

The number of question marks could act as a delimiter, telling the length of a word that is a match. Perhaps the explicit letters could help to filter results even more, narrowing down matching documents containing a given word.

"?a?" could match "bat" and "cat".
But "b??" would only deliver "bat".
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

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

Re: Wildcards for Content Search.

Post by admin »

SkyFrontier wrote:The number of question marks could act as a delimiter, telling the length of a word that is a match. Perhaps the explicit letters could help to filter results even more, narrowing down matching documents containing a given word.

"?a?" could match "bat" and "cat".
But "b??" would only deliver "bat".
What you can do is the following (Wildcards = ON, Whole Words = OFF):

Code: Select all

[!A-Za-z]b??[!A-Za-z]
[!A-Za-z] means "not any character A-Z or a-z" which is roughly the same as a word boundary (at least in English).

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Wildcards for Content Search.

Post by SkyFrontier »

It finds "cat": c??[!A-Za-z].
But doesn't find "Xavier"/"xavier": X?????[!A-Za-z]/x?????[!A-Za-z] (just in case I tried, despite "match case" being off).
Thanks for the tip and hope you find something related to what I described...

P.S.: ...so I can rightly assume that [!1-9A-Za-z] will do part of the job, just in case...?
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

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

Re: Wildcards for Content Search.

Post by admin »

SkyFrontier wrote:It finds "cat": c??[!A-Za-z].
But doesn't find "Xavier"/"xavier": X?????[!A-Za-z]/x?????[!A-Za-z] (just in case I tried, despite "match case" being off).
Thanks for the tip and hope you find something related to what I described...

P.S.: ...so I can rightly assume that [!1-9A-Za-z] will do part of the job, just in case...?
Your "Xavier" pattern is probably wrong. What are you expecting to find?

[!1-9A-Za-z], yes you got it.
[!0-9] = no digits

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Wildcards for Content Search.

Post by SkyFrontier »

Same logic as for "cat".
I have a file with only "xavier" and "cat" as content (CRLF-ed) in ways of a guinea pig.
:idea: But now I found a little pattern!
If "xavier" is the first word of that file, XY finds it - but ignores "cat" when I try c??[!A-Za-z].

Code: Select all

Xavier
<CRLF>
cat
But if I have something like:

Code: Select all

wrong
Xavier
<CRLF>
cat
-it will NOT display the file with the "c??[!A-Za-z]" pattern but it will do it with "x?????[!A-Za-z]".
If I swap "cat" and "Xavier" positions, then the opposite will occur: "Xavier" will not produce a hit but "cat" will.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

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

Re: Wildcards for Content Search.

Post by admin »

SkyFrontier wrote:Same logic as for "cat".
I have a file with only "xavier" and "cat" as content (CRLF-ed) in ways of a guinea pig.
:idea: But now I found a little pattern!
If "xavier" is the first word of that file, XY finds it - but ignores "cat" when I try c??[!A-Za-z].

Code: Select all

Xavier
<CRLF>
cat
But if I have something like:

Code: Select all

wrong
Xavier
<CRLF>
cat
-it will NOT display the file with the "c??[!A-Za-z]" pattern but it will do it with "x?????[!A-Za-z]".
If I swap "cat" and "Xavier" positions, then the opposite will occur: "Xavier" will not produce a hit but "cat" will.
if cat is the last word in the file then "c??[!A-Za-z]" must fail because [!A-Za-z] does not match nothing.

Well, it is not perfect, just a makeshift thing. A real combination of Whole Words and Wildcards is not possible: the pattern matching does not return a position, but just compares a string with a pattern and returns match or no match. Without a position I cannot test for word boundaries.

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Wildcards for Content Search.

Post by SkyFrontier »

It's enough to see that there's a limit, Don, and I believe it's fair enough to learn how to live with that.
Mind note: start finishing my documents with a period (it seems to suffice). :wink:
Thank you!
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Post Reply