Hacker News new | ask | show | jobs
by TheGrassyKnoll 584 days ago
I recommend giving ripgrep a try. (it's been around awhile now) https://github.com/BurntSushi/ripgrep
2 comments

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?
To me, ripgrep is an improvement and the differences are a good thing.
It'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)
So much faster than grep for these things! Love ripgrep! I also use it to rip apart directories of log files. Super convenient