[Suggestion] about Match start/end of filename with ^/$ sign

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Stamimail
Posts: 812
Joined: Sat Aug 31, 2013 9:05 pm

[Suggestion] about Match start/end of filename with ^/$ sign

Post by Stamimail » Tue Mar 30, 2021 8:31 am

about

Option 1
You could choose an Escape Character (or combination of) \ / : * ? " < > | to have special meaning and add it to Everything Search Syntax:

|||^startOfFilename
endOfFilename|||$

I guess it will require more discussion about solving syntax problems like this.

Option 2 - using regex differently:
viewtopic.php?f=2&t=6902#p22204
Last edited by Stamimail on Tue Mar 30, 2021 12:50 pm, edited 1 time in total.

void
Site Admin
Posts: 6678
Joined: Fri Oct 16, 2009 11:31 pm

Re: [Suggestion] about Match start/end of filename with ^/$ sign

Post by void » Tue Mar 30, 2021 10:55 am

Everything has the following search modifiers:
startwith:
endwith:

A shorter version might be useful, for example:
^:startOfFilename
$:endOfFilename

All of these \ / : * ? " < > | characters are currently used for the Everything syntax.

An option to toggle regex with a @regex-search: might work, where any text between @ and : is treated as regex.
for example:
@^:startOfFilename
endOfFilename@$:
"@^:C:\Program Files\Everything 1.@[4|5]:"
@ is probably not the right character, but you get the idea.. &...: is reserved for character entities, #...: is reserved for the preprocessor.
Ideally you would want to use a character that is not in the regex syntax: ~ @ %
-There needs a way to escape : for regex.. eg: @colon:
-A on/off toggle might work to avoid @...: matching a legitimate search, eg: @Q:regex-search@E:

If you enable match_end_of_filename_with_dollar_sign or match_start_of_filename_with_caret, you can always escape ^ and $ with double quotes.
The ^ must appear at the start of the term, and the $ at the end of the term, so these searches are unlikely to conflict with normal searches.

Thanks for the suggestions!

Stamimail
Posts: 812
Joined: Sat Aug 31, 2013 9:05 pm

Re: [Suggestion] about Match start/end of filename with ^/$ sign

Post by Stamimail » Tue Mar 30, 2021 1:00 pm

The ^ must appear at the start of the term, and the $ at the end of the term, so these searches are unlikely to conflict with normal searches.
Searching in my Everything:

Code: Select all

endwith:$|startwith:^
I got 11 (unimportant) items as results in my case.

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

Re: [Suggestion] about Match start/end of filename with ^/$ sign

Post by NotNull » Tue Mar 30, 2021 1:16 pm

... which you would be able to find with the following query
^^ | $$

if you had match_start_of_filename_with_caret and match_end_of_filename_with_dollar_sign enabled.

void
Site Admin
Posts: 6678
Joined: Fri Oct 16, 2009 11:31 pm

Re: [Suggestion] about Match start/end of filename with ^/$ sign

Post by void » Wed Mar 31, 2021 7:29 am

There's also:

startOfFilename*
*endOfFilename

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

Re: [Suggestion] about Match start/end of filename with ^/$ sign

Post by NotNull » Wed Mar 31, 2021 7:37 am

... when Match whole filename when using wildcards is enabled.

Stamimail
Posts: 812
Joined: Sat Aug 31, 2013 9:05 pm

Re: [Suggestion] about Match start/end of filename with ^/$ sign

Post by Stamimail » Wed Mar 31, 2021 10:18 am

How Web Search Engines handle Match start/end of keywords?

void
Site Admin
Posts: 6678
Joined: Fri Oct 16, 2009 11:31 pm

Re: [Suggestion] about Match start/end of filename with ^/$ sign

Post by void » Thu Apr 01, 2021 6:12 am

They usually don't support start-with/end-with.

I've seen other search engines use regex:^startOfFilename (the same as Everything)

There's the Search -> Match Prefix / Suffix option in Everything.
These options might give 'good enough' start-with/end-with results without having to know any Everything search syntax.

Post Reply