sed Replacement Builder

Command

In-place editing has no undo, so the backup stays on unless you turn it off. File names and globs are left as you typed them so the shell can expand them; quote a name yourself if it contains spaces.

About this tool

Build the sed command you would otherwise look up again. Choose between a substitution, deleting matching lines or printing only the matches, then set the regex style, the delimiter and the flags. The page escapes the delimiter inside the pattern and quotes the whole expression, so a copy-paste into the shell behaves the same way it did here.

Questions

Is an in-place edit reversible?
Only with the backup. With -i.bak on, sed leaves the original next to the file with a .bak suffix; turn the backup off and there is no undo.
What does the I flag do?
It makes the pattern match without regard to case. It is a GNU extension, so it works with GNU sed on Linux but not with the old BSD sed on macOS.
Why does it quote the expression in single quotes?
A sed expression is full of characters the shell would otherwise interpret, like spaces, pipes, stars and dollar signs. Single quotes hand the whole expression to sed untouched.