Skip to content

Instantly share code, notes, and snippets.

@Big-Vi
Last active February 28, 2023 21:36
Show Gist options
  • Save Big-Vi/61ccdf776a10253791d5ef5008114e16 to your computer and use it in GitHub Desktop.
Save Big-Vi/61ccdf776a10253791d5ef5008114e16 to your computer and use it in GitHub Desktop.
. - 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 - Not Whitespace (space, tab, newline)
# Anchors
\b - Word Boundary
\B - Not a Word Boundary
^ - Beginning of a String
$ - End of a String
[] - Matches Characters in brackets
[^ ] - Matches Characters NOT in brackets
| - Either Or
( ) - Group
\1 - Reference
(?:) - Non-Capturing Group
(?|(regex1)|(regex2)) - Branch Reset Groups
(?=) - Positive Lookahead
(?!) - Negative Lookahead
(?<=) - Positive Lookbehind
(?<!) - Negative Lookbehind
Quantifiers:
* - 0 or More
+ - 1 or More
? - 0 or One(Optional)
{3} - Exact Number
{3,4} - Range of Numbers (Minimum, Maximum)
Flags:
g - Global
m - Multiline
i - Ignore case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment