Validate Email Regex
Implement a function that validates email addresses using regex with specific rules.
Validate phone number
Write a function that uses regular expressions to determine if a given string is a valid US phone number.
Match IPv4 Address
Write a function that uses a regular expression to check if a string is a valid IPv4 address.
Match IPv6 Address
Write a function that uses a regex to validate whether a string is a fully expanded IPv6 address.
Match Credit Card Pattern
Write a function that validates a credit card number string against a set of formatting rules.
Validate Hex Color Code
Write a function that validates hex color codes using regular expressions.
Multiline anchor match
Extract lines beginning with a plain-text prefix from multiline strings using Python's re module.
Showing 7 challenges · Regular Expressions
Regular Expressions — Python coding challenges
What you will find here
This page lists regular expressions challenges — real Python problems you solve in the browser IDE with instant test feedback. Each challenge includes a clear brief, starter code, and automated checks.
Challenges vs tutorials and quizzes
Challenges test what you can build under constraints. For guided teaching, use our Python tutorials. For quick checks, try quizzes or copy snippets from code samples.