www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/03/12:58:05

From: pjfarley AT banet DOT net (Peter J. Farley III)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: BUG REPORT: sed v3.02
Date: Thu, 03 Sep 1998 14:44:31 GMT
Message-ID: <35eea9e4.5650447@news1.banet.net>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980903092836 DOT 6220A-100000 AT is>
NNTP-Posting-Host: 32.100.77.185
Organization: IBM.NET
Lines: 33
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
<Snipped>
>It's not a bug in Sed, it's a bug in your script.  It uses the \+
>meta-character that isn't supported by the basic regular expressions
>employed by Sed.  (The library reference page of the function
>`regcomp' in libc.inf explains near the end the differences between
>the basic and the extended regular expressions; read it carefully.)
>
>The reason why sed 1.18 works in this case is that Sed 1.18 was built
>with the GNU regexp library which is very lenient in enforcing strict
>Posix regexp specifications; it also supports many extensions of Posix
>regexps by default.  If you try running your script with gsed.exe
>(which was also built with GNU regexp library), you will see that your
>script works in Sed 3.02 as well.
>
>Here's how your script should look like to work with all versions of
>Sed:
>
>  s/^\([ 	][ 	]*\)\($(RMF)\)/\1-\2/

Thanks, Eli.  I didn't know that the \+ meta-character wasn't
supported.  I'll read the info as you suggest.

BTW, in the absense of a worker to add more info on regexps to the sed
info file, it would be very good to update the "Regular Expressions"
section to at least tell the reader to go look at the libc/regcomp
info for more detail, don't you think?  At least it might help to
prevent more questions like mine, I would hope (for those that
actually RTFM, of course).

----------------------------------------------------
Peter J. Farley III (pjfarley AT nospam DOT dorsai DOT org OR
                     pjfarley AT nospam DOT banet DOT net)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019