❓ Content search, regex search

Discussion related to "Everything" 1.5 Alpha.
Post Reply
wise_mike
Posts: 14
Joined: Thu Mar 21, 2024 9:52 am

❓ Content search, regex search

Post by wise_mike »

I am trying to find this inside html files:

Code: Select all

<p dir="RTL" align="justify" dir="rtl"><span lang="en-us"><font size="5">&nbsp;
So I put them inside quotes

Code: Select all

"<p dir="RTL" align="justify" dir="rtl"><span lang="en-us"><font size="5">&nbsp;"
But it gets 0 results. I try to escape the inside quotes and other symbols and search using regex, but it get 0 results too.

I remove some words and it finds just when I search for:

Code: Select all

"<p dir="RTL" align=""
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: ❓ Content search, regex search

Post by NotNull »

The following works here. Make sure there are no extra characters after &nbsp; (like a <space>) as regex*: treats all text after that as literal.

Code: Select all

regex*:content:<p dir="RTL" align="justify" dir="rtl"><span lang="en-us"><font size="5">&nbsp;


I expected the following to work too, but it doesn't as double quotes get eaten before being used in the serach:

Code: Select all

regex:content:"[regex-escape:<p dir="RTL" align="justify" dir="rtl"><span lang="en-us"><font size="5">&nbsp;]"
void
Developer
Posts: 16754
Joined: Fri Oct 16, 2009 11:31 pm

Re: ❓ Content search, regex search

Post by void »

Use regex*: to eat the rest of the search text as literal. (recommended)



-or-



Use &quot: for literal quotes:

regex:content:"<p dir=&quot:RTL&quot: align=&quot:justify&quot: dir=&quot:rtl&quot:><span lang=&quot:en-us&quot:><font size=&quot:5&quot:>&nbsp;"



-or-



regex:content:literal:<p dir="RTL" align="justify" dir="rtl"><span lang="en-us"><font size="5">&nbsp;!literal:
Post Reply