On 2025-08-30 18:16, Collin Funk wrote:
In the normal case when @option{-E} is not used, +portable @command{sed} regular expressions should use @samp{\} only to escape +characters in the string @samp{$*.123456789[\^n}. For example, +POSIX.1-2024 says it is implementation-defined +whether @samp{\|} means alternation or simply matches @samp{|}, +so it should be avoided in portable scripts.Shouldn't '&' also be added to that list of characters?
No, '&' stands for itself in REs. The substitution string (which is what you're thinking of) is not an RE, and is covered in the next paragraph.
