procmail
[Top] [All Lists]

Regexps make all our brains hurt.

1998-08-21 11:24:45
Hedley Robertson asked twice,

| I don't want it to match on things like this:
| 
| subscribe signet person(_at_)mindspring(_dot_)com
| subscribe signet "Hedley Robertson" <robertsh11(_at_)hotmail(_dot_)com>
| 
| But I do want it to match on thngs like this
| 
| subscribe signet "Hedley Robertson" 
robertsh(_at_)emh(_dot_)gordon(_dot_)army(_dot_)mil
| subscribe signet "Hedley Robertson" 
<robertsh(_at_)emh(_dot_)gordon(_dot_)army(_dot_)mil>
| 
| Basically I want to filter out anything that doesn't end in a .mil, .dod, or
| .gov.
| 
| One problem I have with my recipie is that it will match
| someperson(_at_)system(_dot_)government(_dot_)mil(_dot_)au since it matches a 
.mil.

* HB ?? ^^(.+$)*(Subject:|$(.*$)*)[     ]*subscribe signet \
        .*\.(dod|gov|mil)(>|$)

might do the trick of checking subject and body for the command, and then
the next thing to the right of .mil, .dod, or .gov would have to be the end
of the line or a greater-than sign.

The square brackets enclose a space and a tab.

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