Annotation of 42BSD/usr.lib/learn/editor/L37.2e, revision 1.1.1.1

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.