Chapter 7. Processing XML with Regular Expressions

Regular expressions arose in the mathematical community in the fifties and came to prominence in the software development world with the Unix operating system in the seventies. When we think of regular expressions for text processing, especially in the context of Unix, the Perl programming language naturally springs to mind. Perl is rightly acknowledged as having wonderfully powerful regular expression capabilities. Python's regular expression support has been highly influenced by Perl; in particular, Perl 5.

In this chapter, we explore Python's regular expression support. On the way, we will build a useful utility program, xgrep.py, that can be used to find patterns in text files by using regular ...

Get XML Processing with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.