▲ | cormacrelf 10 hours ago | |
How about -F -regexthatlookslikeaflag? Verbatim, that errors out as the command line parsing tries to interpret it as a flag. If you don’t have -F, then you can escape the leading hyphen with a backslash in a single quoted string: '\-regex…', but then you don’t get fixed string search. And -F '\-regex…' is a fixed string search for “backslash hyphen r e g e x”. The only way is to manually escape the regex and not use -F. I think maybe a syntax like -F=-regex would work. | ||
▲ | burntsushi 9 hours ago | parent [-] | |
Yeah, that's a good call out. You would need `rg -F -e -pattern`. |