[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Confusing/unclear documentation of Sed back references
From: |
Bob Proulx |
Subject: |
Re: Confusing/unclear documentation of Sed back references |
Date: |
Wed, 26 Nov 2014 12:54:57 -0700 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Eric Blake wrote:
> Bob Proulx wrote:
> > The invocation section documents the -r option.
> >
> > https://www.gnu.org/software/sed/manual/sed.html#Invoking-sed
> >
> > -r
> > --regexp-extended
> > Use extended regular expressions rather than basic regular
> > expressions. Extended regexps are those that egrep accepts;
> > they can be clearer because they usually have less backslashes,
> > but are a GNU extension and hence scripts that use them are not
> > portable. See [Extended regular expressions].
>
> This is no longer entirely true. POSIX has proposed standardizing the
> -E synonym of -r, which means that it IS portable to use 'sed -E' to get
> extended regular expressions in modern sed implementations, and that it
> is no longer a GNU-only extension:
> http://austingroupbugs.net/view.php?id=528
> (However, it is still true that the spelling 'sed -r' is still a GNU
> extension, and you should get used to 'sed -E' instead)
I don't see how you can see that isn't entirely true. As I read
things the -E is still a proposal. At this time no sed -E option yet
exists in GNU sed.
https://www.gnu.org/software/sed/manual/sed.html#Invoking-sed
And that doesn't even mention the traditional Unix systems. Not even
in the current standards docs.
http://pubs.opengroup.org/onlinepubs/009695399/utilities/sed.html
It certainly can't be considered portable. Not even in bleeding edge
systems.
Bob
Re: Confusing/unclear documentation of Sed back references, Peter Kehl, 2014/11/26