Re: sed documentation bug report

[email protected] (Jose E. Marchesi)
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <[email protected]>
Hi Nils.

    There's a minor omission in the sed documentation, at least as of
    4.2.1 (don't have 4.2.2 to check): it forgets to mention that | also
    needs to be escaped in basic regular expressions, but not in
    extended regular expressions.

The behavior of the | character in extended regular expressions is
documented in the latest version of the manual (git) as follows:

The only difference between basic and extended regular expressions is
in the behavior of a few characters: @samp{?}, @samp{+}, parentheses,
braces (@samp{@{@}}), and @samp{|}.  While basic regular expressions
require these to be escaped if you want them to behave as special
characters, when using extended regular expressions you must escape
them if you want them @emph{to match a literal character}.  @samp{|} is
special here because @samp{\|} is a GNU extension -- standard basic
regular expressions do not provide its functionality.

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.