Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 840 Bytes

File metadata and controls

30 lines (21 loc) · 840 Bytes

Module 067: Regular Expressions

  • Phase: 7. Modules, Stdlib & Testing
  • Duration: 2.5 hours

Learning Objectives

  • Build and use regular expressions with the re module
  • Search, match, find all, split, and substitute text
  • Use metacharacters, character classes, and quantifiers
  • Work with raw strings and compiled patterns
  • Extract groups and named captures

Topics Covered

  • re.search(), re.match(), re.findall(), re.finditer()
  • re.sub(), re.split()
  • Metacharacters: . ^ $ * + ? {} [] \\ | ()
  • Character classes: \d, \w, \s, \D, \W, \S
  • Raw strings (r"...") to avoid escape issues
  • re.compile() for performance
  • Groups () and named groups (?P<name>...)

Prerequisites

Module 066: The Python Standard Library Tour

Next Module

Module 068: Working with Dates and Times