Last active
February 9, 2023 12:34
-
-
Save Surf-logic/2b755528575a643bc86e4e3bf48bd391 to your computer and use it in GitHub Desktop.
Regex cheat sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Regex Cheet Sheet | |
. - any character except new line | |
\d - digit (0-9) | |
\D - Not a digit (0-9) | |
\w - word character (a-z, A-Z, 0-9, _) | |
\W - Not a word character | |
\s - whitespace (space, tab, newline) | |
\S - non whitespace (space, tab, newline) | |
\b - word boundary | |
\B - Not a word boundary | |
^ - begining of a string | |
$ - end of a string | |
[ ] - matches caracters in brackets | |
[^ ] - matches caracters in Not brackets | |
| - either or | |
( ) - group | |
Quantifiers: | |
* - 0 or more | |
+ - 1 or more | |
? - 0 or 1 | |
{3} - exact number | |
{3,4} - range of numbers (minimum, maximum) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment