Page 1 of 1

Wildcards for Content Search.

Posted: 08 Jan 2011 21:58
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?).

Re: Wildcards for Content Search.

Posted: 08 Jan 2011 22:31
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?

Re: Wildcards for Content Search.

Posted: 08 Jan 2011 23:33
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".

Re: Wildcards for Content Search.

Posted: 09 Jan 2011 12:30
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).

Re: Wildcards for Content Search.

Posted: 09 Jan 2011 13:58
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...?

Re: Wildcards for Content Search.

Posted: 09 Jan 2011 14:04
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

Re: Wildcards for Content Search.

Posted: 09 Jan 2011 14:23
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.

Re: Wildcards for Content Search.

Posted: 09 Jan 2011 14:33
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.

Re: Wildcards for Content Search.

Posted: 09 Jan 2011 14:52
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!