procmail
[Top] [All Lists]

Re: Regexp fails in scoring recipe

2003-04-30 11:28:59
On Wed, Apr 30, 2003 at 01:44:41PM +0200, Dallman Ross wrote:
On Tue, Apr 29, 2003 at 04:45:01PM -0700, Kevin Wu wrote:

LOCATIONS="(dumbarton|(east )?palo alto|stanford|menlo park|\\
         redwood city|mountain view)"

Another thing I forgot to mention is that I can't see where you'd
even need to list East Palo Alto separately from Palo Alto.  If
the email ever says Palo Alto, you're going to match on it, period.
If it says "East" or "South" or "outside of" or "nowhere near"
just beforehand, it won't make any difference to the regex matching.

Also, the words could easily break at the ends of lines, and then
you'd miss the report.

        CALTRANS ADVISES MOTORISTS NEAR MENLO
        PARK TO AVOID I-237 EASTBOUND.

So you probably should just have single words in your $LOCATIONS.
I think "Menlo" will do for Menlo Park, and will avoid matching
on Rhonert Park, which could happen if you select "Park" as the
one word to use.  And use "Palo" or "Alto" for those; and "Redwood"
for RC.  Of course, you'll get mismatches on The Redwood Highway,
Redwood Road, etc., but heh.

And let's pray CalTrans doesn't start hyphenating the reports!

        CALTRANS ADVISES MOTORISTS NEAR MEN-
        LO PARK TO AVOID I-237 EASTBOUND.

If you insist on the double words, you could use

        |Redwood( |$)City|

and so on.

-- 
dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>