GNU bug report logs -
#40868
Grep C library for multi-string pattern matching?
Previous Next
Reported by: noloader <at> gmail.com
Date: Sun, 26 Apr 2020 13:59:01 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Mr. Walton!
On Sun, 26 Apr 2020 09:58:10 -0400
Jeffrey Walton <noloader <at> gmail.com> wrote:
> Hi Everyone,
>
> I need to perform multi-string pattern matching in C. The problem I am
> working on does not allow a shell script. I'm looking for a library
> that implements Aho–Corasick or Commentz-Walter (or similar).
>
> Does Grep provide a library that exposes its multi-string pattern
> matching? If not, can someone recommend an implementation?
>
There is an impl of Aho-Corasik in C++ here:
https://www.geeksforgeeks.org/aho-corasick-algorithm-pattern-searching/ (under
CC-by-sa).
Furthermore, you may wish to look at FOSS grep-like tools:
* https://wiki.freebsd.org/BSDgrep
* https://github.com/ggreer/the_silver_searcher
* https://beyondgrep.com/more-tools/
> Thanks in advance.
>
>
>
--
Shlomi Fish https://www.shlomifish.org/
Let’s talk about restores instead of backups - https://is.gd/WatQqu
“Stop reinventing wheels, start building space rockets.”
— The motto of the Comprehensive Perl Archive Network
Please reply to list if it's a mailing list post - https://shlom.in/reply .
This bug report was last modified 4 years and 240 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.