4 ms·
It's not compatible with grep though. How do you search for a square bracket? $ grep '[][]' </dev/null $ rg '[][]' </dev/null rg: regex parse error
by oguz-ismail 2y ago
It's not compatible with grep though. How do you search for a square bracket?
$ grep '[][]' </dev/null
$ rg '[][]' </dev/null
rg: regex parse error:
(?:[][])
^^
error: unclosed character class
$
And why does it search the current directory when its input is redirected from /dev/null? What other surprises are there?
- blueflow 2y agohttps://manpages.debian.org/testing/ripgrep/rg.1.en.html https://manpages.debian.org/testing/ripgrep/rg.1.en.html
- nicoburns 2y agoIt's compatible or close enough with more modern regex syntaxes. Which are probably familiar to a lot more people than grep. Want to search for square brackets, then escape them (or do a a string literal search with -F)
- pletnes 2y agoTo me, ripgrep is an improvement and the differences are a good thing.