Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Aug 2000 20:44:29 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Gregory Bond <gnb@itga.com.au>
Cc:        clefevre@citeweb.net, freebsd-bugs@FreeBSD.ORG
Subject:   Re: bin/20449: strange behaviour of sed 's/ */ /' w/ or w/o g 
Message-ID:  <Pine.BSF.4.21.0008082038210.10193-100000@besplex.bde.org>
In-Reply-To: <200008080256.MAA20948@lightning.itga.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <space><space><space><star>)
> (i.e. two spaces followed by 0 or more spaces).
> 
> or 's/  */ /' (<space><space><star>) 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0008082038210.10193-100000>