I am using egrep (
grep -E) with a PATTERN file. (
This is done in an infinite loop on a stream of text. This implies that I cannot accumulate and pass ALL the input to grep at once (like
Is there a way to make grep "save" the NFA it is building from the PATTERN file to use for it's next run?
I have searched Google and read the documentation with no luck.
I'll try to explain it a little bit more. I need to locate a fixed number of strings with regexes (This is not a part of a question but feel free to suggest otherwise) such as IP addresses, domains etc. The search is done on a feed from the internet. You can think about it as a stream of text.
I can't use
grep on all of the input since it's a stream.
I can accumulate a chunk of stream and use
grep on it (thus not using
grep on each line) but this is also limited (let's say for 30 seconds).
grep is building an NFA from all of its patterns (in my case from a file).
So my question here is: can I tell
grep to save that NFA for the next run, since it is not going to change? That would save me the time of building that NFA every time.