Operator | Description |
---|---|
^ |
Match expr at the start of line |
$ |
Match expr at the end of line |
\ |
Turn off special meaning |
[ ] |
Match any of the enclosed chars |
[^ ] |
Match any char except the enclosed |
. |
Match a single char |
? |
Match zero or one chars |
+ |
Match one or more chars |
* |
Match zero or more chars |
\{x,y\} |
Match x to y occurrences of preceding expr |
\{x\} |
Match x occurrences of preceding expr |
\{x,\} |
Match x or more occurrences of preceding expr |
[:class:] |
Matches all chars in class (alnum, alpha, digit, space, upper, lower, etc.) |
[:alnum:], [:alpha:], [:cntrl:], [:digit:], [:graph:], [:lower:], [:print:], [:punct:], [:space:], [:upper:], and [:xdigit:]
📌 EXAM TIP
man 7 regex
to get information on regex