Commit | Line | Data |
---|---|---|
3eb5d546 C |
1 | |
2 | The fact that the system remembers the last regular expression | |
3 | it had is particularly useful when the regular expression is | |
4 | complex. Suppose, for example, you know that the | |
5 | words "first" and "second" appear on the same line and you wish | |
6 | to delete them and everything between them. You could write | |
7 | /first.*second/s/first.*second//p | |
8 | but isn't it easier to do | |
9 | /first.*second/s///p | |
10 | Edit the file "passage"; the words "twentieth" and "impending" appear | |
11 | on the same line. Replace them and everything between | |
12 | them by the word "impending" (i.e. delete from "twentieth" | |
13 | up to but not including "impending"). One command, if you can. | |
14 | Then rewrite the file and type ready. | |
15 | #create Ref | |
16 | America's rise to world power is a consequence of the nation's | |
17 | geographic position, natural resources, and dynamic energy. For | |
18 | the first century and more of national history, however, continental | |
19 | expansion and internal developments largely absorbed the energies | |
20 | of the American people. Every dictate of public interest emphasized | |
21 | the importance of avoiding all entanglements that might involve the | |
22 | young republic in foreign rivalries and foreign wars. Only with the | |
23 | impending shifts | |
24 | in the European balance of power, and the growth of American economic | |
25 | and industrial strength create a situation that made impossible a | |
26 | continued aloofness from international affairs. | |
27 | #create passage | |
28 | America's rise to world power is a consequence of the nation's | |
29 | geographic position, natural resources, and dynamic energy. For | |
30 | the first century and more of national history, however, continental | |
31 | expansion and internal developments largely absorbed the energies | |
32 | of the American people. Every dictate of public interest emphasized | |
33 | the importance of avoiding all entanglements that might involve the | |
34 | young republic in foreign rivalries and foreign wars. Only with the | |
35 | twentieth century did a rapidly contracting world, impending shifts | |
36 | in the European balance of power, and the growth of American economic | |
37 | and industrial strength create a situation that made impossible a | |
38 | continued aloofness from international affairs. | |
39 | #user | |
40 | #cmp passage Ref | |
41 | #log | |
42 | #next | |
43 | 55.1a 10 |