Substitutions are very advanced.
First a simple example:
This will substitue the 'apa' in current line to 'bepa'.
If an 'p' is appended, you will also immediately see the result.
Same, but all lines in file. Only first occurence on every line.
Any character can used instead of '/':
The 'g' specifies that all occurrences of apa on this line are
changed to bepa.
The pattern that are supposed to be replaced, can be a regular
expression. See ed3 about that.