>>>>> "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:
|
|