Extended Regex and Bash variables

So it seems that lots of people have posted about how to use regex when invoking sed, however they forget that most of the good things are restricted to extended regular expressions, so here is a quick illustration of how to get extended regex and bash variables in the same line for sed.

The important part is that -r, which lets you use extended regex. Also by enclosing the pattern in double quotes instead of single you can use system variables which makes this very handy for doing replacements on incorrect config files that automation might have mangled.

Bitnami