From owner-freebsd-questions Fri Apr 14 13:24:14 2000 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 1438F37B7A0 for ; Fri, 14 Apr 2000 13:24:06 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.3/8.9.3) id PAA05250; Fri, 14 Apr 2000 15:23:17 -0500 (CDT) (envelope-from dan) Date: Fri, 14 Apr 2000 15:23:17 -0500 From: Dan Nelson To: Arcady Genkin Cc: freebsd-questions@FreeBSD.ORG Subject: Re: A sed question Message-ID: <20000414152317.A1743@dan.emsphone.com> References: <87k8i0zbj8.fsf@tea.thpoon.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.1.9i In-Reply-To: <87k8i0zbj8.fsf@tea.thpoon.com>; from "Arcady Genkin" on Fri Apr 14 16:13:15 GMT 2000 X-OS: FreeBSD 5.0-CURRENT Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Apr 14), Arcady Genkin said: > 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? I don't think so. Even the re_format manpage says: Obsolete (``basic'') regular expressions differ in several respects. `|' is an ordinary character and there is no equivalent for its functionality. > Can I specify *two* commands per line? Sure; to specify more than one command, you need to pass them with the -e flag: sed -e 's/etc/etc/' -e 's/etc/etc/' -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message