The -r option in the sed command enables extended regular expressions. Here's a breakdown of the sed command and the -r option:
sed
: The stream editor utility for parsing and transforming text.-r
: Enables extended regular expressions. In some versions of sed, this option is-E
instead of-r
.
With the -r
option, you can use extended regular expressions in your sed commands.
Extended regular expressions provide additional functionality compared to basic regular expressions, such as:
- support for the
+
and?
quantifiers - the use of parentheses for
grouping expressions