doc: clarify ** GNU extension scope in BRE vs ERE

* doc/sed.texi (BRE syntax): Note that --posix disables this GNU
extension, and clarify that in ERE mode ** is not a GNU extension.
Reported in https://debbugs.gnu.org/70476
This commit is contained in:
Jim Meyering authored and Jim Meyering committed 2026-04-11 10:42:27 -07:00
1 parent 7c375a2477
commit 4679c4ab6b
1 file changed
+5 -2
+5 -2
View File
@@ -2652,9 +2652,12 @@ A single ordinary character matches itself.
Matches a sequence of zero or more instances of matches for the
preceding regular expression, which must be an ordinary character, a
special character preceded by @code{\}, a @code{.}, a grouped regexp
(see below), or a bracket expression. As a GNU extension, a
(see below), or a bracket expression. As a GNU extension (disabled by @option{--posix}), a
postfixed regular expression can also be followed by @code{*}; for
example, @code{a**} is equivalent to @code{a*}. POSIX
example, @code{a**} is equivalent to @code{a*}.
In extended regular expression mode (@option{-E}), @code{**} is also
accepted, but that is not considered a GNU extension (POSIX leaves it
undefined), so @option{--posix} does not affect it. POSIX
1003.1-2001 says that @code{*} stands for itself when it appears at
the start of a regular expression or subexpression, but many
non-GNU implementations do not support this and portable