procmail
[Top] [All Lists]

Re: Rejecting multiple names/subjects at once?

1996-07-08 09:09:51
On Mon, 8 Jul 1996 10:27:19 -0500 (CDT), dattier(_at_)wwa(_dot_)com (David W. 
Tamkin) 
wrote ("courtesy" Cc:s silently suppressed--we're on a mailing list):
I had suggested for Mike Rose:
| >Perhaps Mike would get better results if he escaped all the other periods
| >in the file, which apparently are supposed to match only literal periods:
| The problem I'm trying to solve is how to have one regexp per
| line, with an unlimited number of lines in the file.
That's precisely what fgrep's and egrep's -f option is for: reading a file to
get the text (for fgrep) or regexps (for egrep) that the program will look
for in the input.  So that's why Alan suggested using egrep -f in the first
place.

You can probably get a bit better results with POG (plain ole grep :-)
since it doesn't need the overhead of egrep's extended syntax. 
  But in the general case, "unlimited" is not in our vocabulary. We're
dealing with computers with limited memory. (I don't know what
"artificial" restrictions egrep has; it bails out fairly quickly so it
must have some preset threshold, I guess.)
  As a random data point, fgrep happily (and quickly!) slurps a 200k
/usr/dict/words for search strings with the -f option. This is GNU
fgrep 2.0. Obviously, grep and egrep can't handle such masses of
information. 
  Anyhow, this leads to the idea that maybe you could pre-expand your
regexps with some little preprocessor script and feed that to fgrep.

Real men, of course, use Perl :^)

/* era */

-- 
See <http://www.ling.helsinki.fi/~reriksso/> for mantra, disclaimer, etc.