An s-expression is a sed-like transformation expression:

     s/REGEXP/REPLACE/[FLAGS]

where REGEXP is a regular expression, REPLACE is a replacement for each part of the input that matches REGEXP.  Both REGEXP and REPLACE are described in detail in The `s' Command (GNU sed).

As in sed, you can give several replace expressions, separated by a semicolon.

Supported FLAGS are:

g
     Apply the replacement to all matches to the REGEXP, not just the first.

i
     Use case-insensitive matching

x
     REGEXP is an extended regular expression (see Extended regular expressions (GNU sed)).

NUMBER
     Only replace the NUMBERth match of the REGEXP.

     Note: the POSIX standard does not specify what should happen when you mix the g and NUMBER modifiers.  Mailfromd follows the GNU sed implementation in this regard, so the interaction is defined to be: ignore matches before the NUMBERth, and then match and replace all matches from the NUMBERth on.

Any delimiter can be used in lieue of /, the only requirement being that it be used consistently throughout the expression.  For example, the following two expressions are equivalent:

     s/one/two/
     s,one,two,

Changing delimiters is often useful when the REGEX contains slashes.  For instance, it is more convenient to write s,/,-, than s/\//-/.