Chapter 15. Regular Expressions

15.1 Introduction/Motivation

Manipulating text/data is a big thing. If you don’t believe me, look very carefully at what computers primarily do today. Word processing, “fill-out-form” Web pages, streams of information coming from a database dump, stock quote information, news feeds—the list goes on and on. Because we may not know the exact text or data that we have programmed our machines to process, it becomes advantageous to be able to express this text or data in patterns that a machine can recognize and take action upon.

If I were running an electronic mail (e-mail) ...

Get Core Python Programming, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.