Em todos os endereços de contexto, você precisa escapar do delimitador abertura , a menos que esteja usando o padrão /
. Quaisquer ocorrências seguintes que são escapadas são tratadas como o caractere literal, não como o delimitador final.
-
delimitador padrão:
/start/,/end/{/pattern/d;}
-
delimitador personalizado:
\#start#,\#end#{\#pattern#d;}
Veja os documentos POSIX :
In a context address, the construction \cREc where c is any character
other than a backslash or newline character, is identical to /RE/ If
the character designated by c appears following a backslash, then it
is considered to be that literal character, which does not terminate
the RE. For example, in the context address \xabc\xdefx, the second x
stands for itself, so that the regular expression is abcxdef.
Descrição similar no GNU sed man
page:
/regexp/
Match lines matching the regular expression regexp.
\cregexpc
Match lines matching the regular expression regexp.
The c may be any character.
e FreeBSD sed man
page:
In a context address, any character other than a backslash (''\'')
or newline character may be used to delimit the regular expression.
The opening delimiter needs to be preceded by a backslash unless it
is a slash. For example, the context address \xabcx is equivalent
to /abc/. Also, putting a backslash character before the delimiting
character within the regular expression causes the character to be
treated literally. For example, in the context address \xabc\xdefx,
the RE delimiter is an ''x'' and the second ''x'' stands for itself,
so that the regular expression is ''abcxdef''.