Regular expressions
See also
Information about M4 preprocessor
| Symbol |
Description |
ed |
vi/ ex |
sed/ grep |
awk/ egrep |
| . |
Match any character |
+ |
+ |
+ |
+ |
| * |
Match zero or more |
+ |
+ |
+ |
+ |
| ^ |
Match beginning of the line |
+ |
+ |
+ |
+ |
| $ |
Match end of the line |
+ |
+ |
+ |
+ |
| \ |
Escape next charater |
+ |
+ |
+ |
+ |
| [ ] |
Match one from a set |
+ |
+ |
+ |
+ |
| \( \) |
Store pattern for replay |
+ |
+ |
+ |
|
| \n |
n-th stored pattern |
+ |
+ |
+ |
|
| { } |
Match a range of instances |
|
|
|
P |
| \{ \} |
Match a range of instances |
+ |
|
+ |
|
| \< \> |
Match a word |
+ |
+ |
|
g |
| + |
Match one or more |
|
|
|
+ |
| ? |
Match zero or one |
|
|
|
+ |
| | |
Separator for choices |
|
|
|
+ |
| { } |
Group expressions |
|
|
|
+ |
- + : implemented feature
- P : POSIX standard feature
- g : gawk feature
Books about the subject:
|