how to search content with exact terms?
how to search content with exact terms?
Is there currently implemented a way to search for 2 exact words in a file? So for instance, if I wanted to search for "class xyz" but wasn't sure how many spaces were between class and xyz and also there were other class names like xyz_interface how could I define this search?
Re: how to search content with exact terms?
Regex will give you the most control:
regex:content:\bclass\b\s+\bxyz\b
regex: = enable regular expressions
\b = word break
\s = space
\s+ = one or more spaces
Alternatively:
ww:content:class ww:content:xyz
ww: = whole words
ww:content:xyz_interface
regex:content:\bclass\b\s+\bxyz\b
regex: = enable regular expressions
\b = word break
\s = space
\s+ = one or more spaces
Alternatively:
ww:content:class ww:content:xyz
ww: = whole words
ww:content:xyz_interface
Re: how to search content with exact terms?
I had NO idea you could chain together macros like this!!! Awesome!void wrote: Mon Dec 11, 2023 10:18 pm Regex will give you the most control:
regex:content:\bclass\b\s+\bxyz\b
regex: = enable regular expressions
\b = word break
\s = space
\s+ = one or more spaces
Alternatively:
ww:content:class ww:content:xyz
ww: = whole words
ww:content:xyz_interface
Also ww:content: does not appear to work at all. It still treats it as a partial match.
Re: how to search content with exact terms?
Please make sure regex is unchecked under the Search menu.
regex will override whole words.
Please make sure no other search options are checked under the Search menu.
Everything 1.5 treats _ as punctuation.
Is this what you are seeing?
-I have on my TODO list to treat _ as a word when using ww: with content:
regex will override whole words.
Please make sure no other search options are checked under the Search menu.
Everything 1.5 treats _ as punctuation.
Is this what you are seeing?
-I have on my TODO list to treat _ as a word when using ww: with content:
Re: how to search content with exact terms?
Please see attached pics proving that ww is being ignored.
- Attachments
-
- 3.png (21.02 KiB) Viewed 5302 times
-
- 2.png (39.47 KiB) Viewed 5302 times
-
- 1.png (33.69 KiB) Viewed 5302 times
Re: how to search content with exact terms?
Oh duh, I see the problem is exactly what you said! Hoping your modification to make '_' part of words comes soon!
TY for help!
Re: how to search content with exact terms?
1 more question on this -> ww:content:class ww:content:xyzvoid wrote: Mon Dec 11, 2023 10:18 pm Regex will give you the most control:
regex:content:\bclass\b\s+\bxyz\b
regex: = enable regular expressions
\b = word break
\s = space
\s+ = one or more spaces
Alternatively:
ww:content:class ww:content:xyz
ww: = whole words
ww:content:xyz_interface
Does this search for both terms on the same line or in the same file? If the same file, is there a way (without a regex) to have both terms match on the same line for it to be considered a successful search?
Re: how to search content with exact terms?
Yes, by using the eachline: search modifier:Skrell wrote: Tue Jan 02, 2024 10:28 pm If the same file, is there a way (without a regex) to have both terms match on the same line for it to be considered a successful search?
Code: Select all
eachline:content:<class xyz>eachline: