procmail
[Top] [All Lists]

Search & Replace (v.0.99) with 'just' procmail

2004-03-18 19:15:15
Project files:
  http://www.xs4all.nl/~rvtol/procmail/snr

snr_Test.rc:
  snr_Input = "Subject: [tag] test1 [tag] [tag] [[tag]tag] test2 [tag]"
  snr_Inp01 = "[tag]"   # search-value
  snr_Inp02 = ""        # replace-value

  LOG = "($snr_Input)$NL"
  INCLUDERC = snr.inc
  LOG = "($snr_Return)$NL"


log-output:
  (Subject: [tag] test1 [tag] [tag] [[tag]tag] test2 [tag])
  (Subject:  test1    test2 )


The search is re-done from the start after each replace. 
That is why "[[tag]tag]" disappears. 

A next version will allow you to choose between this behavior 
and 'the other one', that is safer and faster and would give
this result:

  (Subject:  test1   [tag] test2 )

-- 
Affijn, Ruud

_______________________________________________
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>
  • Search & Replace (v.0.99) with 'just' procmail, Ruud H.G. van Tol <=