X-Authentication-Warning: ixi.eng.ascend.com: meyering set sender to meyering AT ascend DOT com using -f Sender: meyering AT ascend DOT com To: Eli Zaretskii Cc: tr AT eth DOT net, djgpp-workers AT delorie DOT com Cc: autoconf AT gnu DOT org Subject: 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> From: Jim Meyering In-Reply-To: "Eli Zaretskii"'s message of "Fri, 11 Aug 2000 20:39:18 +0200" Date: 11 Aug 2000 20:11:25 +0200 Message-ID: Lines: 21 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.6.92 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Reply-To: djgpp-workers AT delorie DOT com "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. I tested on a few flavors of Suns (sunos4.1.4, 5.5.1, 5.6, 5.7), HPUX 10.20, Linux, irix 6.2 & 6.5, NetBSD 1.3.1, AIX 2.4. I saw the earlier thread (on the autoconf list) on this topic where someone found that `?' and \| were not portable. Has anyone found a system on which \{m,n\} is not portable?