Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 889 Bytes

Regex.md

File metadata and controls

32 lines (26 loc) · 889 Bytes
.       - 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)

\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

Quantifiers:
*       - 0 or More
+       - 1 or More
?       - 0 or One
{3}     - Exact Number
{3,4}   - Range of Numbers (Minimum, Maximum)

Sourced: https://github.com/CoreyMSchafer/code_snippets/blob/master/Regular-Expressions/snippets.txt

* Note captured group and be recombined with the # followed by the group number

To test out regex use regex101.com