Книга: Automate the Boring Stuff with Python: Practical Programming for Total Beginners
Назад: 1. Python Basics
Дальше: 8. Reading and Writing Files

]

In this chapter, you’ll start by writing a program to find text patterns without using regular expressions and then see how to use regular expressions to make the code much less bloated. I’ll show you basic matching with regular expressions and then move on to some more powerful features, such as string substitution and creating your own character classes. Finally, at the end of the chapter, you’ll write a program that can automatically extract phone numbers and email addresses from a block of text.

.