rdgozum / regex-notebooks

Sample usage of the Python module for regular expressions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regular Expressions

Sample usage of the Python module for regular expressions.

Cheat Sheet

.       - Any Character Except New Line
\d      - Digit (0-9)
\D      - Not a Digit
\w      - Word Character (a-z, A-Z, 0-9, _)
\W      - Not a Word Character
\s      - Whitespace (space, tab, newline)
\S      - Not Whitespace

\b      - Word Boundary (whitespace or non-alphanumeric character)
\B      - Not a Word Boundary
^       - Beginning of a String
$       - End of a String

[]      - Matches Characters in brackets (only match on one character)
[^ ]    - Matches Characters NOT in brackets
|       - Either Or
( )     - Group (match several diff patterns)

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

Credit

Watch the original video from Youtube: Regular Expressions Tutorial

About

Sample usage of the Python module for regular expressions.


Languages

Language:Jupyter Notebook 100.0%