procmail
[Top] [All Lists]

Re: Need help demunging Subject header

2002-08-29 16:07:36
:0fhW
* ^Subject:.*(\[[^]]+\]+)\/.*
| formail -I"Subject:$FRONT$MATCH"

I presume that's just a tpyo and you mean
  * ^Subject:.*(\[[^]]+\])+\/.*

with the '+' after the closing parenthesis rather than after the closing
literal square bracket.  To lose any spaces, just allow them to be
optionally matched before the '\/' and insist that the first thing after
the '\/' is a non-space character.
  * ^Subject:.*(\[[^]]+\][    ]*)+\/[^  ].*

note that there is one space and one tab in those whitespace sequences.

Because of the greedy-to-the-right,-stingy-to-the-left nature of '\/'
that could even be written as

  * ^Subject:.*(\[[^]]+\])+.*\/[^       ].*

The right option is the one you find most maintainable.

Hope that helps,
Martin
-- 
Martin McCarthy                 /</    http://procmail.non-prophet.org
    `Procmail Companion'        \>\
     Addison Wesley             /</                  PGP key available
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail