Great Circle Associates Majordomo-Workers
(August 1997)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Further question on taboo_bodies, and suggestion
From: Jason L Tibbitts III <tibbs @ hpc . uh . edu>
Date: 19 Aug 1997 11:55:22 -0500
To: majordomo-workers @ greatcircle . com
In-reply-to: bill@ecology.bio.dfo.ca's message of Tue, 19 Aug 1997 13:21:35 -0300 (ADT)
References: <199708191621.NAA05000@ecology.bio.dfo.ca>

>>>>> "BS" == Bill Silvert <bill@ecology.bio.dfo.ca> writes:

BS> In looking at some recent exchanges, I find myself wondering whether
BS> there is any way to have Mj look for certain phrases in just the first
BS> text line of a message, rather than searching further down (I assume
BS> that I could easily hack the code to cover only the first line, but for
BS> most admintrivia I would rather be able to look further down.

2.0 lets you specify a line to stop searching at for every regex.

You specify things like this:

/naughty/i 5

to look for naughty in the first five lines.  The line number is optional,
and defaults to 10 for admin_body and 0 (unlimited) for taboo_body.  If all
regexes are line-limited, the search will stop without checking the entire
message.

This isn't actually all that hard to do, even in the 1.9x case.  Look at
_build_taboo_data in Resend.pm if you want to see how the matcher routines
are constructed.  The ones I use have much different return values, though,
because they give you back both the regex and the text that it matched.  I
also have to deal with the inverted matches.

 - J<


Follow-Ups:
References:
Indexed By Date Previous: Further question on taboo_bodies, and suggestion
From: bill@ecology.bio.dfo.ca (Bill Silvert)
Next: Re: Further question on taboo_bodies, and suggestion
From: Tom Neff <tneff@panix.com>
Indexed By Thread Previous: Further question on taboo_bodies, and suggestion
From: bill@ecology.bio.dfo.ca (Bill Silvert)
Next: Re: Further question on taboo_bodies, and suggestion
From: Tom Neff <tneff@panix.com>

Google
 
Search Internet Search www.greatcircle.com