It depends. Strictly speaking, the standard compatible sed should only use regular regular expressions for which the standard is :
Special BRE characters and contexts in which they have special meaning are as follows:
.[\ The period, the left square bracket, and the backslash must be special, unless they are used in a bracket expression (see RE Bracket Expression expression). An expression containing '[', which is not preceded by a backslash and is not part of the bracket expression, produces undefined results.
* asterisk must be special, unless it is used in a parenthesis expression, as the first character of the whole BRE (after the initial “^”, if any) or as the first character of the subexpression (after the initial '^', if any) ; see BRE matching multiple characters
^ The envelope must be special when used as an anchor (see BRE Expression Anchoring) or as the first character of a bracket expression (see bracket expression)
$ The dollar sign must be special when used as an anchor.
So the complete list is .[\*^$ , But context matters. In addition, many sed provide options for using extended regular expressions (EREs), which expand the list and change the context in which characters are special. For example, without ERE, groups are formed using \( and \) , but with EREs ( and ) themselves are special and must be escaped literally to match.
source share