Py
PyNow

Run Regex (re) in Your Browser

Test Regular Expressions in Python

Test Python regular expressions online for free. Write, run, and debug regex patterns using Python's re module — no installation needed.

main.py
Ln 1, Col 1Spaces: 4
Python 3.13 (Pyodide)
Hit Run to see output here.

What You Get

Full re module support
Pattern matching & groups
findall, search, match, sub
Compile and test patterns

Regex (re) Examples

Named Groups

import re

pattern = r'(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})'
match = re.search(pattern, 'Today is 2024-03-15')
if match:
    print(f"Year: {match.group('year')}")
    print(f"Month: {match.group('month')}")
    print(f"Day: {match.group('day')}")