tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: grep -r: add default "."



On Sun, 4 Sep 2022, Alistair Crooks wrote:

agcre was not really meant to be a drop-in replacement for grep:

- defaults to extended regexps
- does most (sane/useful) perl extensions
- does utf-8 searching and matching
- is built around a vm style of matching, rather than a dfa, or aho
corasick-style optimizations, so sacrifices performance for protection
against sociopathic expressions
- extends the api to do backwards searching (similar to memrchr in a byte
string, where memchr does the forward searching)

But certainly has none of the production-ready style of matching that would
be necessary for a full grep replacement, to say nothing of atf tests (it
has its own test suite, just not atf)


Neither OpenBSD's nor FreeBSD's grep use Aho-Corasick for fgrep: OpenBSD's
grep looks like the non-GNU version in `usr.bin/grep'. Both use the system
(Spencer?) regex for the heavy lifting; and, FreeBSD's fgrep is just
regcomp(REG_NOSPEC) :).

-RVP




Home | Main Index | Thread Index | Old Index