December 2000
Intermediate to advanced
816 pages
16h 57m
English
We will now introduce the most popular of the metacharacters, special characters and symbols, which give regular expressions their power and flexibility. You will find the most common of these symbols and characters in Table 15.1.
| Notation | Description | Example RE |
|---|---|---|
| Symbols | ||
| re_string | match literal string value re_string | foo |
| re1|re2 | match literal string value re1 or re2 | foo|bar |
| . | match any character (except NEWLINE) | ::.+:: |
| ^ | match start of string | ^Dear |
| $ | match end of string | /bin/\w*sh$ |
| * | match 0 or more occurrences of preceding RE | [A-Za-z]\w* |
| + | match 1 or more occurrences of preceding RE | \d+\.|\.\d+ |
| ? | match 0 or 1 occurrence(s) of preceding RE | goo? |
| {N} | match N occurrences ... | |
Read now
Unlock full access