Python Regex Documentation: String Pattern Matching

Advertise Here

, ,

4.2 re — String Pattern Matching (regex)

This module provides a way to search/replace a string by a pattern, known as Regular Expression or regex.

Regex Functions

For vast majority of uses, you want the “search” and “sub” functions.

Regex Objects

For writing code using Object Oriented style.

Regex Match Objects

Some functions or methods return their results as object called “MatchObject”.

Regex Syntax

Documents the regex syntax for matching strings.

Note: This document is a rewrite of Python 2.4's Official Documentation of its RE module. The original document can be found at http://python.org/doc/2.4/lib/module-re.html

See also: Notes on Rewriting Python Regex Documentation

For copyright and terms of this page, see terms.html.

blog comments powered by Disqus