May 1987
Intermediate to advanced
680 pages
17h 3m
English

This section is divided into five major parts, describing the commands in the text editors vi, ex, sed, and awk, and the pattern-matching syntax common to all of them.
A number of UNIX text-processing programs, including ed, ex, vi, sed, and grep, allow you to perform searches, and in some cases make changes, by searching for text patterns rather than fixed strings. These text patterns (also called regular expressions) are formed by combining normal characters with a number of special characters. The special characters and their use are as follows:
| . | Matches any single character except newline. |
| * | Matches any number (including zero) of the single character (including a character specified by a regular expression) that immediately precedes it. For example, because . means “any character,” .* means “match any number of any characters.” |
| [...] | Matches any one of the characters enclosed between the brackets. For example, [AB] matches either A or B. A range of consecutive characters can be specified by separating the first and last characters in the range with a hyphen. For example, [A–Z] matches any uppercase letter from A to Z, and [0–9] matches any digit from 0 to 9. If a caret (^) is the first character in the brackets, the comparison is inverted: the pattern will match any characters except those enclosed in the brackets. ... |
Read now
Unlock full access