POSIX Regular Expressions
POSIX (Portable Operating System Interface) defines a set of standard operating system interfaces based on the UNIX OS. In POSIX Basic Regex Expression (BRE) syntax, most characters are treated as literals (for example, they match only themselves). However, some characters called metacharacters have special meaning.
This table describes common POSIX BRE metacharacters:
| Metacharacter | Description |
|---|---|
|
Matches any single character. For example, |
|
Used to define a range. For example, |
|
Matches a literal character |
|
Matches the beginning of a line |
|
Matches the end of a line |
|
Matches zero or more occurrences of the preceding element |
|
Matches exactly n occurrences of the preceding element |
|
Matches between n and m occurrences of the preceding element |