Message-Id: <200008120844.EAA11828@delorie.com> Date: Sat, 12 Aug 2000 11:47:13 +0200 To: meyering AT ascend DOT com X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b From: "Eli Zaretskii" CC: tr AT eth DOT net, djgpp-workers AT delorie DOT com, autoconf AT gnu DOT org In-reply-to: (message from Jim Meyering on 11 Aug 2000 20:11:25 +0200) Subject: Re: portability of sed's \{0,1\}? References: <200008110941 DOT CAA29407 AT drawbridge DOT ascend DOT com> <200008111728 DOT KAA12810 AT drawbridge DOT ascend DOT com> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: Jim Meyering > Date: 11 Aug 2000 20:11:25 +0200 > > "Eli Zaretskii" writes: > | > | Also, is \{0,1\} supported in all versions of > | > | Sed? > | > > | > I'm almost positive that it's not portable. > | > | Then what is the portable repacement for the ? operator (which isn't > | part of the basic regexps, and therefore isn't supported by Sed)? > > I'm not so sure now. > I've tested on a pretty wide range of systems > (did this: for i in $(type -a -p sed); do echo bc |$i 's/a\{0,1\}bc/x/';done) > and it worked fine (printed `x') for each version of sed on each of those > systems. Accordng to my references, \{ and \} belong to the basic REs supported by ed(1), and that's what Sed uses. > I saw the earlier thread (on the autoconf list) on this topic where > someone found that `?' and \| were not portable. That's true: ? and \| are *not* part of BREs. That's why I didn't use ? in the first place.