"Search by Wildcard" Suggestion

Discussion related to "Everything" 1.5 Alpha.
Post Reply
nooshstuff
Posts: 1
Joined: Wed Dec 22, 2021 12:55 am

"Search by Wildcard" Suggestion

Post by nooshstuff » Wed Dec 22, 2021 1:06 am

I'm not quite sure if this is possible, or would find any good use, but something I was interested in doing but was not able to do was order the list of files by what was contained in a specific wildcard in your search.

For example, if I was searching in a directory containing many .json files, all of which containing something along the lines of

Code: Select all

"var":123,
I would be able to make a search that would look something like

Code: Select all

ext:json content:quot:"var"quot:":*,"
(note: only way to search for quotes in file contents is to use "quot:" instead)

where the asterisk would be some special wildcard symbol specific for this sorting method, and then all of the results would be ordered by whatever number the variable "var" was set to.

Again, not quite sure of the practical usefulness of this, or whether it'd be possible, but I could think of a few convenient uses for this and it'd be a neat feature to have.

void
Developer
Posts: 9597
Joined: Fri Oct 16, 2009 11:31 pm

Re: "Search by Wildcard" Suggestion

Post by void » Wed Dec 22, 2021 7:29 am

Thank you for your feedback nooshstuff,

I am working on a solution for the next alpha update.

It will look something like:
ext:json regex:content:&quot:var&quot::(.)*,

Everything will capture the value inside ( and ) which can be recalled with the Regular Expression Match 1 property.

You could then sort by Regular Expression match 1.

I will make another post once this is available.
Thank you for the suggestion.

NotNull
Posts: 3721
Joined: Wed May 24, 2017 9:22 pm

Re: "Search by Wildcard" Suggestion

Post by NotNull » Wed Dec 22, 2021 11:34 am

If you want to avoid using quot:, you could use:

Code: Select all

ext:json wildcards:utf8content:"?var?:*,"

With regular expressions:

Code: Select all

ext:json regex:utf8content:"\"var\":(.+),"
although that doesn't give you a Regular Expression Match property (yet).

void
Developer
Posts: 9597
Joined: Fri Oct 16, 2009 11:31 pm

Re: "Search by Wildcard" Suggestion

Post by void » Thu Dec 30, 2021 5:31 am

Everything 1.5.0.1291a will now support regex captures when searching properties or content.

Regular expression captures can be accessed with the Regular Expression Match 0 to Regular Expression Match 9 properties.
Regular expression captures can also be accessed with the file-exists: and folder-exists: search functions.

For example:
ext:json regex:content:&quot:var&quot::(.)*, tonumber:regexmatch1:100..200



To sort results by a json value:
  • In Everything, search for:
    ext:json regex:content:&quot:var&quot::(.)*,
  • Right click the result list column header and click Add column....
  • Select Regular Expression Match 1 and click OK.
  • Click the Regular Expression Match 1 column header to set the sort.


Everything 1.5.0.1291a also adds a no-fast-regex: search modifier to disable regular expression optimizations.

This will be necessary to use the Regular Expression Match 0 property when a regular expression search does not contain a special regular expression character.

For example:
no-fast-regex:regex:abc123 regexmatch0:123

Post Reply