Literal operators

Discussion related to "Everything" 1.5 Alpha.
Post Reply
therube
Posts: 5003
Joined: Thu Sep 03, 2009 6:48 pm

Literal operators

Post by therube »

Literal Operators

- are CaSe sensitive
intended or not?

i suppose if
a or b, then allows you to use "or" in search
where
a OR b, does an a | b

(anyhow, as they're case sensitive, maybe ?... ought to say so ;-))
(if it doesn't say,
you say, oh, it works, yeah!
then, you say, what? why isn't it working [the next time]?!)
NotNull
Posts: 5468
Joined: Wed May 24, 2017 9:22 pm

Re: Literal operators

Post by NotNull »

In 1.4 they were case insensitive; in 1.5 they are indeed case-sensitive.

Can't tell you if this is intentional, but I like the 1.5 behaviour better.
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Literal operators

Post by void »

Literal operators are case sensitive.

This is by design.

They are case sensitive for 1.4 and 1.5.



Literal operators:
AND
OR
NOT

Can be enabled from Tools -> Options -> Search -> Allow literal operators.
Literal operators are disabled by default.

You can use double quotes to escape literal operators and match filenames.
ChrisGreaves
Posts: 688
Joined: Wed Jan 05, 2022 9:29 pm

Re: Literal operators

Post by ChrisGreaves »

void wrote: Tue Jan 10, 2023 4:57 am Literal operators are case sensitive.
Hi Void; you can tell where I am up to by the content of my questions!

When checked OFF, the setting ”Allow literal operators” could be reworded as “Allow and, or and not to match parts of filenames” and as well “Allow AND, OR and NOT to match parts of filenames”.

That is, it is not so much a case of case-sensitivity as much as in/excluding the three operator [alphabetic] strings from contention.

Is the above text correct?

My feeling is for me to continue to use <space> to represent AND, ! to represent NOT, and | to represent OR.
Cheers, Chris
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Literal operators

Post by void »

When checked OFF, the setting ”Allow literal operators” could be reworded as “Allow and, or and not to match parts of filenames” and as well “Allow AND, OR and NOT to match parts of filenames”.

That is, it is not so much a case of case-sensitivity as much as in/excluding the three operator [alphabetic] strings from contention.

Is the above text correct?
Yes.

If enabled, AND, OR and NOT are case sensitive.
You can also use double quotes to escape operators.

For example:
"AND"
ChrisGreaves
Posts: 688
Joined: Wed Jan 05, 2022 9:29 pm

Re: Literal operators

Post by ChrisGreaves »

void wrote: Thu Mar 30, 2023 7:19 am You can also use double quotes to escape operators.
"AND"
.... so in this example, logic would go out the window (grin) and we would find

Code: Select all

Command Line Interface
and

Code: Select all

Prefix and Suffix Search Options
pop up in the result List..
The leading quotes tells the preprocessor(???) to treat the following characters as a literal string.
I think that is right.
Thanks, Chris
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Literal operators

Post by void »

"AND" will match those examples.

No preprocessing is done here.

It's the Everything search term parser that will treat the quoted operators as literal.
Post Reply