Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Apr 2000 15:23:17 -0500
From:      Dan Nelson <dnelson@emsphone.com>
To:        Arcady Genkin <a.genkin@utoronto.ca>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: A sed question
Message-ID:  <20000414152317.A1743@dan.emsphone.com>
In-Reply-To: <87k8i0zbj8.fsf@tea.thpoon.com>; from "Arcady Genkin" on Fri Apr 14 16:13:15 GMT 2000
References:  <87k8i0zbj8.fsf@tea.thpoon.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000414152317.A1743>