Skip to content
masterclass Buddy

Python · Module

re

Python’s re module performs regular expression matching and text replacement. Patterns can be compiled and reused, or passed directly to module functions.

Last updated

Syntax

re.compile(pattern, flags=0)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • re.compile
  • re.search
  • re.match
  • re.fullmatch
  • re.findall
  • re.finditer
  • re.split
  • re.sub

Source: re — Regular expression operations — Python 3.15.2 documentation. Checked 2026-11-03.