Page 1 of 1

How find folders whose name is NOT delimited by symbol

Posted: Sat Feb 10, 2024 12:20 pm
by burgundy
I wish to find a file with a wholeword name that is NOT delimited by a punctuation symbol.

For example, I wish to find a file called
railway
but NOT see hits of files whose name contains
european.railway
I had hoped the search menu options for "Match Whole Words" and "Ignore Punctuation" may have helped but unfortunately not.

Can anyone advise how to formulate my search correctly?

Re: How find folders whose name is NOT delimited by symbol

Posted: Sat Feb 10, 2024 12:53 pm
by NotNull
You need to be more specific than the example you provided.
To me european.railway is not NOT delimited by a punctuation symbol as it does not end with a punctuation character.
Furthermore: how should filenames like european.railway.txt be handled?

Re: How find folders whose name is NOT delimited by symbol

Posted: Sat Feb 10, 2024 1:40 pm
by burgundy
Essentially, I wish to find files whose wholeword name is neither immediately preceded nor immediately followed by a punctuation symbol.

The example I gave of "railway" earlier is the full name of the files I seek, not a part of it. So I do not want the following.
european.railway
european-railway
railway.travel
railway-travel
european.railway.travel
european-railway-travel
etc
Is it possible to formulate a search to obtain this result?

Re: How find folders whose name is NOT delimited by symbol

Posted: Sat Feb 10, 2024 2:56 pm
by NotNull

Code: Select all

folder:   !regex:\p{P}
Basically this will find all folders that do not have any punctuation character in their name.


For mode details, see Menu => Help => Regular Expression Syntax


EDIT: Missed the "folders" part in your question. Adapted the search query accordingly.

Re: How find folders whose name is NOT delimited by symbol

Posted: Sun Feb 11, 2024 1:28 am
by void
Please consider:

folder:regex:(^|\s)railway($|\s)


^ = match start of filename
| = OR
\s = match a 'space' character
$ = match end of filename



Do you want to allow .extension after railway?

If so:

regex:stem:(^|\s)railway($|\s)

(only useful if you wanted to match files)



For Everything 1.4, please use:

folder:regex:"(^|\s)railway($|\s)"

(use double quotes to escape | )