procmail
[Top] [All Lists]

Re: FW: problems with subject replacement recipe

2001-03-16 17:59:27
Era wrote in Dallman's care,

|   CURSUB=`echo "$MATCH" | sed -e 's/^\(R[Ee]:[                ]*\)*//'`

(Surely the second pair of brackets should enclose a space and a tab rather
 than two tabs, but that's not my main point.)

I don't know of any sed version that will accept that target string.  The
only way I know -- stated in repeated -e syntax so that it can work inside a
procmail rcfile -- to do such a thing is this:

 CURSUB=`echo "$MATCH" | sed -e :a -e 's/^R[Ee]:[       ]*//' -ta`

or if you want to keep one leading Re: and normalize what follows it to one
space,

 CURSUB=`echo "$MATCH" | sed -e :a \
  -e 's/^R[Ee]:[        ]*R[Ee]:[       ]*/Re: /' -ta`

but I'll admit getting lost in the length of the discussion, so perhaps there
was some reason I missed for not keeping even one leading Re:.

_______________________________________________
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>