-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
add support for reading patterns from a file #7
Copy link
Copy link
Closed
Labels
enhancementAn enhancement to the functionality of the software.An enhancement to the functionality of the software.
Description
It would be cool to support grep's -f/--file option, and it should be relatively easy for us to do so. The implementation strategy I have in mind is to just join all of the patterns/literals using a | and hand it off to the regex engine.
It might be faster to hand build an Aho-Corasick automaton (using the aho-corasick crate) if you know we have a bunch of literals. In fact, this is almost assuredly more memory efficient if the number of literals being searched is very large. Unfortunately, this is a harder thing to add, since it would require plumbing an Aho-Corasick automaton through all of the searching code so that either a Regex or an AcAutomaton could be used. Doable, but not straight-forward.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementAn enhancement to the functionality of the software.An enhancement to the functionality of the software.