GNU bug report logs - #74065
documentation suggestion for caret

Previous Next

Package: sed;

Reported by: Greg Minshall <minshall <at> umich.edu>

Date: Mon, 28 Oct 2024 16:15:01 UTC

Severity: normal

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Greg Minshall <minshall <at> umich.edu>
To: bug-sed <at> gnu.org
Subject: documentation suggestion for caret
Date: Mon, 28 Oct 2024 09:13:34 -0700
in the info node
----
5.3 Overview of basic regular expression syntax
----

in the discussion of caret (^), there is this (totally correct, afaik)
text:
----
     ‘^’ acts as a special character only at the beginning of the
     regular expression or subexpression (that is, after ‘\(’ or ‘\|’).
     Portable scripts should avoid ‘^’ at the beginning of a
     subexpression, though, as POSIX allows implementations that treat
     ‘^’ as an ordinary character in that context.
----

on the other hand, POSIX *EREs* allow caret in a subexpression.  this
isn't mentioned in the info node about EREs (which, as that node treats
GNU sed EREs, probably needn't be).  would it be worth mentioning it
here?
----
     ‘^’ acts as a special character only at the beginning of the
     regular expression or subexpression (that is, after ‘\(’ or ‘\|’).
     Portable scripts should avoid ‘^’ at the beginning of a
     subexpression, though, as POSIX allows implementations that treat
     ‘^’ as an ordinary character in that context.  (Note that POSIX
     *extended* regular expressions, as well as those of GNU sed, do
     allow '^' at the beginning of a subexpression.)
----

cheers.




This bug report was last modified 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.