procmail
[Top] [All Lists]

Re: Modifying the body of emails

2007-07-07 16:23:51
* Jim Syler wrote:
Speaking of tests, I'm having a problem there, too. The test

* ^Subject: [Genius/Idiot.*

is not matching

Subject: [Genius/Idiot—Current Thoughts] getting

or anything similar. Any ideas why?

Brackets have a special meaning in regular expressions: "[ab]"
matches "a" or "b". Use "\[" to match a literal bracket.

   :0fwB
   | sed 's/\d:\d\d:\d\d .M/&</p>/'

Alright, the reason this isn't working is that sed was interpreting '/'
as a delimiter and 'p' as a command in '</p>'. How do I escape '/'?
With '\'? I can't tell from the sed manpage.

Either that, or use a different delimiter for the "s" command, for
instance:

  sed 's_\d:\d\d:\d\d .M_&</p>_'

Whatever follows the "s" is used as the delimiter automatically, it
doesn't have to be "/".

Also, \d isn't listed as a synonym in grep(1). Will sed recognize
it?

I don't think so; mine doesn't. You can test for yourself on the
command line:

  echo 1 | sed 's-\d-x-'

This prints "x" if sed recognizes "\d", otherwise "1".

/HW
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>