blob: 22277b8c26077b9d9406b7400c05d1a883a61826 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001NAME
2 ed2
3
4DESCRIPTION
5 Substitutions are very advanced.
6
7 First a simple example:
8
9 s/apa/bepa/
10 This will substitue the 'apa' in current line to 'bepa'.
11 If an 'p' is appended, you will also immediately see the result.
12
13 1,$s/apa/bepa/
14 Same, but all lines in file. Only first occurence on every line.
15
16 Any character can used instead of '/':
17 s!apa!bepa!g
Zesstra7ea4a032019-11-26 20:11:40 +010018 The 'g' specifies that all occurrences of apa on this line are
MG Mud User88f12472016-06-24 23:31:02 +020019 changed to bepa.
20
21 The pattern that are supposed to be replaced, can be a regular
22 expression. See ed3 about that.
23
24SEE ALSO
25 ed3(LPC)