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