how do I invert a search with multiple patterns? #2628
-
For the following to be processed:
my command is:
This command doesn't actually work, but the ChatGPT answer works like this. Is there a feature like this? But I'm using it in wrong way? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Fwiw, two alternative ways to achieve what you want would be either: rg -v ab "input-file" | rg -v 12 or (more efficient): rg -v 'ab|12' "input-file" |
Beta Was this translation helpful? Give feedback.
-
Yes, the second method is more efficient, but it doesn't seem to appear in the man page of ripgrep One question is, who told ChatGPT about the Way that doesn't exist???? |
Beta Was this translation helpful? Give feedback.
-
(I've converted this to a Discussion since this is more Q&A than anything else. I've also marked @s-p-turner's response as the answer. I'll provide a bit more context here.) ripgrep's man page doesn't contain all possible forms of composition. Instead, it documents how to compose things. For example, multiple I myself will use both As for ChatGPT, I don't know why it says the things it does. If you want to talk ChatGPT, please do that somewhere else. |
Beta Was this translation helpful? Give feedback.
Fwiw, two alternative ways to achieve what you want would be either:
rg -v ab "input-file" | rg -v 12
or (more efficient):
rg -v 'ab|12' "input-file"