From owner-freebsd-questions Fri Apr 14 13:20: 9 2000 Delivered-To: freebsd-questions@freebsd.org Received: from picusnet.com (mail.picusnet.com [207.7.90.2]) by hub.freebsd.org (Postfix) with ESMTP id AB07E37B75E for ; Fri, 14 Apr 2000 13:19:59 -0700 (PDT) (envelope-from wdf@picusnet.com) Received: from picusnet.com [209.96.235.136] by picusnet.com with ESMTP (SMTPD32-5.05) id AD33170152; Fri, 14 Apr 2000 16:18:59 -0400 Received: from picusnet.com (localhost.picusnet.com [127.0.0.1]) by picusnet.com (8.9.3/8.9.3) with ESMTP id QAA01229; Fri, 14 Apr 2000 16:12:44 -0400 (EDT) (envelope-from wdf@picusnet.com) Message-ID: <38F77BBC.A8F87F05@picusnet.com> Date: Fri, 14 Apr 2000 16:12:44 -0400 From: William Freeman X-Mailer: Mozilla 4.61 [en] (X11; I; FreeBSD 3.4-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: Arcady Genkin Cc: freebsd-questions@FreeBSD.ORG Subject: Re: A sed question References: <87k8i0zbj8.fsf@tea.thpoon.com> Content-Type: multipart/alternative; boundary="------------4294A24A6F1F27630C57EC4E" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --------------4294A24A6F1F27630C57EC4E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Perhaps Perl would work better? Arcady Genkin wrote: > I'm setting up a procmail rule to filter message through sed to remove > mailing list ids in subject line. I miss "|" in sed's syntaxis. For > example I have a rule: > > ,----[ .procmailrc ] > | :0 f > | * ^mailing-list:.*\/(php3-help|php4beta) > | |sed '/^Subject:/ s/\[PHP[34]\(BETA\)*\] *//g' > | > | :0 A: > | lists/programming/$MATCH > `---- > > But the regexp in the sed's command above is not *exactly* the > language that I meant. I wanted to match [PHP3] or [PHP4BETA]. Or, in > other words \[PHP(3|4BETA)\]. But the above would allow a match on > [PHP3BETA], as well as [PHP4] and [PHP4BETABETABETA]. I know this is > silly, but I feel defeated because I can't express exactly what I > need. > > Is there a way around this missing "|" metacharacter? > > Can I specify *two* commands per line? > > Thanks! > -- > Arcady Genkin http://www.thpoon.com > Nostalgia isn't what it used to be. > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- William D. Freeman (wdf@picusnet.com) http://members.xoom.com/EvilGNU -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GU d- s+:+ a--- C++ UB+++ P+ L- E--- W+ N o-- K- w--- O- M- V-- PS+ PE++ Y-- PGP-- t++ 5-- X+++ R tv- b+ DI++++ D--- G- e- h! r-- !y+ ------END GEEK CODE BLOCK------ --------------4294A24A6F1F27630C57EC4E Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Perhaps Perl would work better?
 
 
 

Arcady Genkin wrote:

I'm setting up a procmail rule to filter message through sed to remove
mailing list ids in subject line. I miss "|" in sed's syntaxis. For
example I have a rule:

,----[ .procmailrc ]
| :0 f
| * ^mailing-list:.*\/(php3-help|php4beta)
| |sed '/^Subject:/ s/\[PHP[34]\(BETA\)*\]  *//g'
|
| :0 A:
| lists/programming/$MATCH
`----

But the regexp in the sed's command above is not *exactly* the
language that I meant. I wanted to match [PHP3] or [PHP4BETA]. Or, in
other words \[PHP(3|4BETA)\]. But the above would allow a match on
[PHP3BETA], as well as [PHP4] and [PHP4BETABETABETA]. I know this is
silly, but I feel defeated because I can't express exactly what I
need.

Is there a way around this missing "|" metacharacter?

Can I specify *two* commands per line?

Thanks!
--
Arcady Genkin                                http://www.thpoon.com
Nostalgia isn't what it used to be.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message

-- 
William D. Freeman (wdf@picusnet.com)
http://members.xoom.com/EvilGNU
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GU d- s+:+ a--- C++ UB+++ P+ L- E--- W+ N o-- K- w--- O- M- V-- PS+ PE++ Y-- PGP-- t++ 5-- X+++ R tv- b+ DI++++ D--- G- e- h! r-- !y+ 
------END GEEK CODE BLOCK------
  --------------4294A24A6F1F27630C57EC4E-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message