Metacharacters
The characters in Table 22-3 have special meaning only in search patterns.
Table 22-3. Metacharacters used in search patterns
|
Character |
Pattern |
|---|---|
|
. |
Match any single character except newline. Can match newline in awk. |
|
|
Match any number (or none) of the single character that immediately
precedes it. The preceding character can also be a regular
expression; e.g., since . (dot) means any character,
|
|
|
Match the following regular expression at the beginning of the line or string. |
|
|
Match the preceding regular expression at the end of the line or string. |
|
|
Match any one of the enclosed characters. A hyphen
( |
|
|
Match a range of occurrences of the single character that immediately
precedes it. The preceding character can also be a metacharacter.
|
|
|
Just like
|
|
Turn off the special meaning of the character that follows. ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access