Inverse grep

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Wed, 8 Jun 2011 23:01:57 +0000 (UTC)

          From comp.compilers

Related articles
Inverse grep gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-06-08)
Re: Inverse grep cfc@shell01.TheWorld.com (Chris F Clark) (2011-06-12)
Re: Inverse grep dot@dotat.at (Tony Finch) (2011-06-13)
Re: Inverse grep torbenm@diku.dk (2011-06-14)
Re: Inverse grep anton@mips.complang.tuwien.ac.at (2011-06-15)
Matching very large patterns, was Re: Inverse grep cfc@shell01.TheWorld.com (Chris F Clark) (2011-06-19)
Re: Matching very large patterns, was Re: Inverse grep gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-06-20)
[1 later articles]
| List of all articles for this month |

From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Wed, 8 Jun 2011 23:01:57 +0000 (UTC)
Organization: A noiseless patient Spider
Keywords: question, comment
Posted-Date: 11 Jun 2011 13:53:14 EDT

I suppose this is a strange question, but I was wondering if
there was ever something like an inverse grep. That is,
match a string against a file full of regular expressions.


Now, one could just read the file, compile the regex one at
a time, and do the match, but maybe there is another way.


-- glen
[If you want to know which pattern it was, there's flex which turns all
the patterns into one DFA with tags to know which one it was, or else
there's the perl "study" operator which pre-scans a string to make its
NFA matcher faster on subsequent runs against the same string. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.