[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removeing RE and Prefix



On February 28, 2002 at 19:35, "Birger Mortensen" wrote:

> Is there a way to remove old prefix'es ?
> I am using :
> 
> <SUBJECTSTRIPCODE>
> s/^\[sftest\]://;
---------------^
	      Is this a typo?
> </SUBJECTSTRIPCODE>
> 
> 
> But it don't get subjects like this one :Re: [sftest] Hmm Og var til denne
> via WEB

The '^' in the regex anchors the expression to the beginning of the
string.  Therefore, subjects starting with "Re: [sftest]" will
not get matched.

A simple solution is to just remove the first occurance of "[sftest]"
from the subject, regardless of its location:

<SUBJECTSTRIPCODE>
s/\[sftest\]\s//;
</SUBJECTSTRIPCODE>

Otherwise, you will need to something more complicated to make sure
you only get the "[sftest]" at the beginning of a subject.  A
possible solution:

<SUBJECTSTRIPCODE>
s/^((?:Re|Fw):\s+)\[sftest\]\s/$1/;
</SUBJECTSTRIPCODE>

Note, the SUBJECTSTRIPCODE settings have not been tested.

BTW, SUBJECTSTRIPCODE is applied as messages are read into MHonArc.
For existing messages in the archive, SUBJECTSTRIPCODE has no affect.
If you have the original messages, just recreate the archive
using the original messages.

--ewh


[Index of Archives]     [Bugtraq]     [Yosemite News]     [Mhonarc Home]