diff options
author | Ian Darwin <ian@cvs.openbsd.org> | 1998-09-28 16:01:46 +0000 |
---|---|---|
committer | Ian Darwin <ian@cvs.openbsd.org> | 1998-09-28 16:01:46 +0000 |
commit | 8d70bdbdf6fd88bf88b9a384cfaafb6668c804ec (patch) | |
tree | 034fd6a68d5b6928d6fe4e51de71c9868bb460b1 /usr.bin/learn/lib/editor/L35.2e | |
parent | e9be7faad5fbf61edcad3700142615e315e407bc (diff) |
import BTL learn(1) lessons/editor
Diffstat (limited to 'usr.bin/learn/lib/editor/L35.2e')
-rw-r--r-- | usr.bin/learn/lib/editor/L35.2e | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/usr.bin/learn/lib/editor/L35.2e b/usr.bin/learn/lib/editor/L35.2e new file mode 100644 index 00000000000..cd3a6a0f776 --- /dev/null +++ b/usr.bin/learn/lib/editor/L35.2e @@ -0,0 +1,33 @@ +#print +A very powerful construction is ".*", +which matches any character (remember '.') +repeated any number of times. For example + +s/a.*b/.../ + +replaces anything of the forms + +axyzb, aaaaaab, a1234b, abbbb + +since it requires just an 'a' and a 'b' +at the ends of the string, with +anything at all in between. +Or, to throw away everything +on a line after the word "stop", you could try + +s/stop.*/stop/ + +In this directory is a file "sentence". +Delete everything after +the word "last" on the second line of the file. +#create Ref +This file has a sentence in which +this is the last +#create sentence +This file has a sentence in which +this is the last word which should be left. +#user +#cmp sentence Ref +#next +36.1a 10 +36.2a 5 |