Chapter 2. Regular Expressions with Python
In the previous chapter, we've seen how generic regular expressions work. In this chapter, we walk you through all the operations Python provides us with to work with regular expressions and how Python deals with them.
To do so, we will see the quirks of the language when dealing with regular expressions, the different types of strings, the API it offers through the RegexObject
and MatchObject
classes, every operation that we can do with them in depth with many examples, as well as some problems generally faced by users. Lastly, we will see the small nuances and differences between Python and other regex engines and between Python 2 and Python 3.