|
deleting-words.rex |
Pipelines v2.1 |
.....|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....10... |
**** Top of file **** 12 /* The following pipeline reads the file: winston.txt and deletes the word 'the' from any
3 record that contains the word.
45 Note. The search for the word 'the' is not case sensitive, and any combination of
6 uppercase and lowercase characters that spell the word will match, for example; the
7 following words match: 'The', 'tHe', 'thE ' and 'THE ' – notice the space! – the
8 regular expression /the[^a-z]|the/ (line: 15) ensures that a match may also include a
9 trailing delimiting space. */
1011 Address Rxpipe
1213 'pipe (stagesep ! reg 3)',
14 '< &installdrive:\&installpath\examples\input\winston.txt',
15 '! change anycase reg /the[^a-z]|the/ //', /* Delete the word 'the'. */
16 '! console' /* Display on the console. */
1718 Say 'Hit Enter to close..'
19 Parse Pull
2021 Exit 0
**** End of file ****
|
Console
output |
.....|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....10... 1 2 34 It was a bright cold day in April, and clocks were striking thirteen.
5 Winston Smith, his chin nuzzled into his breast in an effort to escape vile
6 wind, slipped quickly through glass doors of Victory Mansions, though not
7 quickly enough to prevent a swirl of gritty dust from entering along with him.
89 hallway smelt of boiled cabbage and old rag mats. At one end of it a
10 coloured poster, too large for indoor display, has been tacked to wall. It
11 depicted simply an enormous face, more than a metre wide: face of a man
12 about forty-five, with a heavy black moustache and ruggedly handsome features.
13 Winston made for stairs.
1415 It was no use trying lift. Even at best of times it was seldom working,
16 and at present electric current was cut off during daylight hours. It was
17 part of economy drive in preparation for Hate Week. flat was seven
18 flights up, and Winston, who was thirty-nine and had a varicose ulcer above his
19 right ankle, went slowly, resting several times on way. On each landing,
20 opposite lift shaft, poster with enormous face gazed from wall.
21 It was one of those pictures which are so contrived that eyes follow you
22 about when you move.
2324 BIG BROR IS WATCHING YOU, caption beneath it ran.
25 26 27 2829 Hit Enter to close..
|
|