Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. Python Fundamentals

Lesson 24 of 55 · Python

Regular Expressions

Duration: 20 minutes

Regular Expressions\n\nThe re module enables powerful pattern‑matching with regular expressions. Patterns are defined as raw strings (r'...') to avoid escaping backslashes.\n\npython\nimport re\ntext = 'The price is $45.99.'\npattern = r'\d+\.\d{2}' # matches numbers like 45.99\nmatch = re.search(pattern, text)\nif match:\n print('Found price:', match.group())\n\n\nCommon functions: re.search(), re.match(), re.findall(), re.sub().\n

Previous: Working with JSONNext: OOP Basics – Classes