
| Matches any character except line terminators like \n. It matches every such instance before each \n in the string. $ | Matches the expression to its left at the end of a string. ^ | Matches the expression to its right at the start of a string. Regular Expressions for Data Science (PDF)ĭownload the regex cheat sheet here Special Characters If you’re interested in learning Python, we have free-to-start interactive Beginner and Intermediate Python programming courses you should check out. This regex cheat sheet is based on Python 3’s documentation on regular expressions.


While at Dataquest we advocate getting used to consulting the Python documentation, sometimes it’s nice to have a handy PDF reference, so we’ve put together this Python regular expressions (regex) cheat sheet to help you out! The tough thing about learning data science is remembering all the syntax.
