2.2. Combining Regular Expression Metacharacters

Now that the basic regular expression metacharacters have been explained, they can be combined into more complex expressions. Each of the regular expression examples enclosed in forward slashes is the search string and is matched against each line in the text file.

Example 2.9.
					Note: The line numbers are NOT part of the text file. The vertical
bars mark the left and right margins.
   ------------------------------------------------------------------
1  |Christian Scott lives here and will put on a Christmas party.|
2  |There are around 30 to 35 people invited.|
3  |They are: |
4  |                               Tom|
5  |Dan|
6  |   Rhonda Savage|
7  |Nicky and Kimberly.|
8  |Steve, Suzanne, Ginger and Larry.|
   ------------------------------------------------------------------ ...

Get Linux Shells by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.