Bell 32V development
[unix-history] / usr / lib / learn / editor / L37.2e
CommitLineData
00b28f22
TL
1#print
2Here is something a bit trickier. We want to add
3an extra space after each word "lengthen". However,
4some of the instances of "lengthen" are followed
5by commas or right parentheses and we want the sapace
6after the comma or right parenthesis in that case. That
7is, the desired transformations are:
8 now new
9lengthen xx lengthen xx
10lengthen, xx lengthen, xx
11lengthen) xx lengthen) xx
12lengthen), xx lengthen), xx
13It should only take one substitute command to do this.
14Remember that "*" matches zero or more instances of
15whatever precedes it.
16Try those changes on the first six lines of the file
17"text" in this directory. Then rewrite the file and
18type "ready".
19#create Ref
20To lengthen this is easy,
21whereas to lengthen, rather
22than to shorten, on the previous line
23is hard. (To lengthen) is an
24infinitive. I said to him, (please lengthen), and
25he did so.
26Why not lengthen this word? Notice it is on line 7.
27#create text
28To lengthen this is easy,
29whereas to lengthen, rather
30than to shorten, on the previous line
31is hard. (To lengthen) is an
32infinitive. I said to him, (please lengthen), and
33he did so.
34Why not lengthen this word? Notice it is on line 7.
35#user
36#cmp text Ref
37#log
38#next
3937.2f 5