O'Reilly logo

Core Python Applications Programming, Third Edition by Wesley J. Chun

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 1. Regular Expressions

Some people, when confronted with a problem, think, “I know, I’ll use regular expressions.” Now they have two problems.

—Jamie “jwz” Zawinski, August 1997

In this chapter...

Introduction/Motivation

Special Symbols and Characters

Regexes and Python

Some Regex Examples

A Longer Regex Example

1.1. Introduction/Motivation

Manipulating text or 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 might not know the exact text or data that we have programmed our machines to process, it becomes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required