[TUHS] BRE Grouping in Sed?

Chet Ramey via TUHS tuhs at tuhs.org
Fri May 22 07:43:18 AEST 2026


On 5/21/26 5:01 PM, segaloco via TUHS wrote:

> For the record, in GNU sed this warning is triggered, when POSIXLY_CORRECT, under any s command where an escaped character other than '&', '\\', '[0-9]', '\n', or the separator character ('/' default) is found.  Testing this, it'll also balk at, for instance, '\?'.

The standard does say:

"The meaning of an unescaped <backslash> immediately followed by any
character other than '&', <backslash>, a digit, <newline>, or the delimiter
character used for this command, is unspecified."

but I think they're referring to the replacement string, not the pattern.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet at case.edu    http://tiswww.cwru.edu/~chet/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <http://www.tuhs.org/pipermail/tuhs/attachments/20260521/b4bad8b8/attachment.sig>


More information about the TUHS mailing list