^ |
Beginning of line. |
$ |
End of line. |
^$ |
Empty line. |
\< |
Start of word. |
\> |
End of word. |
Grep regular expressions
Position
Character
- | - |
---|---|
[A-ZÂa-z] |
Any lower and upper case letter. |
[0-9] |
Any number. |
[0-9ÂA-ZÂa-z] |
Any lower and upper case letter or digit. |
POSIX
- | - |
---|---|
[:alpha:] |
Any lower and upper case letter. |
[:digit:] |
Any number. |
[:alnum:] |
Any lower and upper case letter or digit. |
[:space:] |
Any whitesÂpace. |
Quantifiers
- | - |
---|---|
{n} |
Previous item appears exactly n times. |
{n,} |
Previous item appears n times or more. |
{,m} |
Previous item appears n times maximum. |
{n,m} |
Previous item appears between n and m times. |
Wildcards
- | - |
---|---|
. | Any character. |
? |
Optional and can only occur once. |
* |
Optional and can occur more than once. |
+ |
Required and can occur more than once. |
Refer
- Regex syntax (quickref.me)
- Regex examples (quickref.me) Please refer to the full version of the regex cheat sheet for more complex requirements.
Comments