regexp word boundary characters

Have a suggestion for "Everything"? Please post it here.
juan
Posts: 16
Joined: Tue Feb 07, 2023 1:42 pm

regexp word boundary characters

Post by juan »

Hello, I just noticed that the underscore _ is considered as an alphabetic character by the word boundary wildcard \b when matching regexps. So, searching for
regexp:\bready\b
won't match
I_am_ready_for_it.txt (not matched),
while it marches
I-am-ready-for-it.txt (matched)
which I think isn't right, or expected.

Is there an option for considering _ a word-ending character, as the hyphen - is?
I think such an option should be considered.

Thanks for the most used utility on my system!
Windows 10, running Everything as a service.
void
Developer
Posts: 19899
Joined: Fri Oct 16, 2009 11:31 pm

Re: regexp word boundary characters

Post by void »

_ is alphanumeric in PCRE.

Please try:

regex:(\b|_)ready(\b|_)



Everything 1.5 has Tools -> Options -> Advanced -> filename_underscore_word_character=false

and

ww:ready
ww: = whole words
juan
Posts: 16
Joined: Tue Feb 07, 2023 1:42 pm

Re: regexp word boundary characters

Post by juan »

void wrote: Tue Mar 18, 2025 11:11 pm _ is alphanumeric in PCRE.
Please try:
regex:(\b|_)ready(\b|_)
This won't cut it, as I'm not looking explicitly for _ as opposed to -
Typically, I just remember I used some separator character between words...
void wrote: Tue Mar 18, 2025 11:11 pm Everything 1.5 has Tools -> Options -> Advanced -> filename_underscore_word_character=false

and

ww:ready
ww: = whole words
... while both of these are perfect and viable! I did look at the help, but I missed the ww: thing, or maybe I didn't think it would be independent of \b matching.

Thank you very much @void, for the wonderful utility (something like that should be built in Windows!) and for the quick and exhaustive reply.