stefankueng / grepWin

A powerful and fast search tool using regular expressions
https://tools.stefankueng.com/grepWin.html
GNU General Public License v3.0
1.76k stars 182 forks source link

Find this but not that (search for a page that has a string, #379

Open wisemike2 opened 1 year ago

wisemike2 commented 1 year ago

Is it possible to add a new box for excluded words or something? (like the Exclude dirs box): Search for the this but not that..? I tried using regex for that but it doesn't seem to work, like: ^(?!.*not).*yes.*$ or (?=.*yes)(?!.*not)(.+)

What I need is to find files that has a certain word (ex: yes), and not the other (ex: not). So if the file has both words it doesn't show in the results (something like a 2-step inverse search), it shows only the file that has the main word, and if the other word is present, it doesn't show it in the search results.

stefankueng commented 8 months ago

first do an inverse search for the string you do NOT want. Then do the search for what you want with "search in found files" image

gcory-vertafore commented 7 months ago

It would be helpful if there was an option for "Inverse search in found files". That way, the inverse search would not have to be the first operation. You could search for files containing X, and then search those results for those that do not contain Y.