Substitute (s/) all instances globally (/g) of foo with bar in the document:
sed "s/foo/bar/g"
Match any characters from a list [] of characters:
sed "s/[Ff]oo/bar/g"
Remove all whitespaces globally. (*) replaces zero or more of the preceding character:
sed "s/ *//g"
Search and print lines with the word foo, case insensitive:
sed "/[Ff]oo /p"
Append a line after foo:
sed '/foo/ a\\ bar'
Insert a line before foo:
sed '/foo/ i\\ bar'
At its base, a shell is simply a macro processor that executes commands. The term macro processor means functionality where text and symbols are expanded to create larger expressions. (Bash Reference Manual 2022, p.1)