procmail
[Top] [All Lists]

Re: How to remove some text in the middle of a subject line

2004-03-10 14:06:58
Christopher Benson wrote:

I'm looking for a way to remove some text from the middle of a subject line.

So for example, the text I need to remove is:

[TEX1]

But it might be in the middle of a subject line like:

 TPS20001-34987 [TEX1] How do I change my config?

and in the end I need it to say:

 TPS20001-34987 How do I change my config?


Probably not the most efficient solution but simple and flexible:

       :0 fhw
| /usr/bin/perl5 -n -p -e 's/^Subject:(.*?)\[TEX1\](.*)$/Subject: $1$2/'

--

Klaus Johannes Rusch
KlausRusch(_at_)atmedia(_dot_)net
http://www.atmedia.net/KlausRusch/



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