This is an archived version of the course. Please find the latest version of the course on the main webpage.

Chapter 2: Regular expression basics

Diving straight in!

face Josiah Wang

Let’s get practical! Time to get your hands dirty with regular expressions! Reading will not get you anywhere when it comes to regular expressions!

I will start simple, and then start giving you more regular expression constructs to write more powerful regular expressions!

And remember that while we will use Python for our implementation, the concepts you will learn in this chapter can be applied anywhere from shell commands and text editors!

Please follow along and try things out yourself! Launch an interactive Python prompt, and import the re module from the Python Standard Library!

>>> import re

And let’s get started!