MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | NAME |
| 2 | ed2 |
| 3 | |
| 4 | DESCRIPTION |
| 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 |
| 18 | The 'g' specifies that all occurences of apa on this line are |
| 19 | changed to bepa. |
| 20 | |
| 21 | The pattern that are supposed to be replaced, can be a regular |
| 22 | expression. See ed3 about that. |
| 23 | |
| 24 | SEE ALSO |
| 25 | ed3(LPC) |