OSX sed Does Regex A Bit Different
With GNU sed, \+
, \?
, \(...\)
and friends are considered extended regex characters. You can use them directly with the preceding backslashes. Or you can include the -r
flag to turn on extended regex and use them without.
With OSX sed, \+
, \?
, and \|
are not interpreted as part of the basic regex. To use them at all you need to include -E
to turn on extended regex. The capture characters (\(...\)
) are available with basic regex.
Last updated