bug#40868: Grep C library for multi-string pattern matching?

2020-04-26 Thread Jeffrey Walton
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,

bug#40868: Grep C library for multi-string pattern matching?

2020-04-26 Thread Paul Eggert
On 4/26/20 6:58 AM, Jeffrey Walton wrote: > Does Grep provide a library that exposes its multi-string pattern > matching? No, and that's partly by design: Grep is GPLed rather than LGPLed. I don't know of any free library that does anything similar.

bug#40868: Grep C library for multi-string pattern matching?

2020-04-26 Thread Paul Jackson
Perhaps you could use fork, exec, pipe, read, write, and similar system calls, to execute grep and feed data through it, without resorting to any shell or any shell wrapper such as the system(3) library call. Or, if that would work, except for being rather fussy to code, then consider Colin Watson

bug#40868: {SPAM 04.0} bug#40868: Grep C library for multi-string pattern matching?

2020-04-26 Thread Paul Jackson
P.S. -- on multi-core systems (which most are these days), piping data between executables working in parallel can be a good way to reduce the elapsed clock time of a job, albeit at the expense of higher system CPU utilization. -- Paul Jackson p...@usa.net

bug#40868: Grep C library for multi-string pattern matching?

2020-04-26 Thread Shlomi Fish
Hi Mr. Walton! On Sun, 26 Apr 2020 09:58:10 -0400 Jeffrey Walton 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).