From owner-freebsd-questions Fri Apr 14 13:13:22 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail2.rdc3.on.home.com (mail2.rdc3.on.home.com [24.2.9.41]) by hub.freebsd.org (Postfix) with ESMTP id 34C5237B756 for ; Fri, 14 Apr 2000 13:13:20 -0700 (PDT) (envelope-from antipode@thpoon.com) Received: from tea.thpoon.com ([24.114.152.71]) by mail2.rdc3.on.home.com (InterMail vM.4.01.02.00 201-229-116) with ESMTP id <20000414201315.FTHB910.mail2.rdc3.on.home.com@tea.thpoon.com> for ; Fri, 14 Apr 2000 13:13:15 -0700 Received: from antipode by tea.thpoon.com with local (Exim 3.12 #1 (Debian)) id 12gCSp-0008KR-00 for ; Fri, 14 Apr 2000 16:13:15 -0400 To: freebsd-questions@FreeBSD.ORG Subject: A sed question X-Face: 0=A/O5-+sE[Tf%X>rYr?Y5LD4,:^'jaJ!4jC&UR*ZrrK2>^`g22Qeb]!:d;}2YJ|Hq"LHdF OX`jWX|AT-WVFQ(TPhFVak)0nt$aEdlOq=1~D,:\z5QlVOrZ2(H,mKg=Xr|'VlHA="r Organization: Wgaf From: Arcady Genkin Date: 14 Apr 2000 16:13:15 -0400 Message-ID: <87k8i0zbj8.fsf@tea.thpoon.com> Lines: 28 User-Agent: Gnus/5.0803 (Gnus v5.8.3) XEmacs/21.1 (Bryce Canyon) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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