The "|" also needs a backslash to get its special meaning.
echo "blia blib bou blf" | sed 's/bl\(ia\|f\)//g'
will do what you want.
As you know, if all else fails, read the manual :-).
GNU sed user's manual, section 3.3 Overview of Regular Expression Syntax:
`REGEXP1\|REGEXP2'
Matches either REGEXP1 or REGEXP2.
Note the backslash...
Unfortunately, regex syntax is not really standardized... there are many variants, which differ among other things in which "special characters" need \ and which do not. In some it's even configurable or depends on switches (as in GNU grep, which you can switch between three different regex dialects).
This answer in particular is for GNU sed. There are other sed variants, for example the one used in the BSDs, which behave differently.
seddoes support alternation, but only with "extended" regex syntax (-E) - which means no backslashes on either the pipes or the parentheses:echo "blia blib bou blf" | sed -E 's/bl(ia|f)//g'– Mark Reed Sep 30 '14 at 17:42