From owner-freebsd-bugs Tue Aug 8 3:44:41 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from gidora.zeta.org.au (gidora.zeta.org.au [203.26.10.25]) by hub.freebsd.org (Postfix) with SMTP id 6B6EE37B710 for ; Tue, 8 Aug 2000 03:44:37 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: (qmail 7724 invoked from network); 8 Aug 2000 10:44:33 -0000 Received: from unknown (HELO bde.zeta.org.au) (203.2.228.102) by gidora.zeta.org.au with SMTP; 8 Aug 2000 10:44:33 -0000 Date: Tue, 8 Aug 2000 20:44:29 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Gregory Bond Cc: clefevre@citeweb.net, freebsd-bugs@FreeBSD.ORG Subject: Re: bin/20449: strange behaviour of sed 's/ */ /' w/ or w/o g In-Reply-To: <200008080256.MAA20948@lightning.itga.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tue, 8 Aug 2000, Gregory Bond wrote: > > so, the right way to do what I want is something like sed 's/ \{1,\}/ /' > > or 's/ */ /' (that is ) > (i.e. two spaces followed by 0 or more spaces). > > or 's/ */ /' () which is the same outcome but less > efficient (because unlike the previous two versions this will match and replace > single space characters). > > or or 's/ +/ /' in other applications (such as perl) that use egrep-like REs. sed now supports "extended" REs when it is invoked with the -E flag. This is unportable (it was added to FreeBSD-current last March). > Gotta love REs! Especially when they aren't limited to the "basic" regular expressions in plain sed -). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message