Python Regex Tester
Test Python re-module patterns against the real CPython regex engine — compiled to WebAssembly.
Free, no signup — runs entirely in your browser on RegexTester.dev.
Annotation
Unable to parse pattern
gglobal: Don't return after first matchiignore case: Case insensitive matchingMatch Results
0 matchesNo matches found
Quick Reference
Test your Python regex against the real engine below
Python regex: what makes it different
- (?P<name>…) groups
- Python named groups require the P — (?<name>…) without it is a compile error in Python.
- Fixed-width lookbehind
- (?<=…) must have a fixed width per branch; alternations of differing lengths are rejected.
- 3.11 atomic & possessive
- (?>…) and a*+ are supported in modern Python — validate them here before assuming your runtime has them.
- re.VERBOSE style
- Free-spacing mode (re.VERBOSE / (?x)) lets you write readable multi-line patterns with comments.
Python's re module has its own personality: named groups use (?P<name>…) with a P, lookbehind must be fixed-width, and raw-string interactions trip up even experienced developers. Since Python 3.11 the engine also supports atomic groups (?>…) and possessive quantifiers (a*+) — features most online testers never implemented.
This tester runs the actual CPython regex engine compiled to WebAssembly, so group numbering, (?P=name) backreferences, and 3.11+ syntax behave exactly as they will in your interpreter.
Python regex FAQ
Does Python regex support lookahead and lookbehind?
Yes to lookaheads (?=…) (?!…) and fixed-width lookbehind (?<=…) (?<!…). Each lookbehind branch must match a fixed number of characters — variable-length lookbehind like (?<=ab|cde) raises re.error. PCRE2 and .NET allow it; Python does not.
What is the difference between re.match, re.search and re.fullmatch?
re.match anchors at the start of the string only, re.search finds the first match anywhere, and re.fullmatch requires the entire string to match. The same pattern can behave differently under all three — test with the match mode you actually use.
Does Python support atomic groups and possessive quantifiers?
Yes, starting with Python 3.11 the re module supports atomic groups (?>…) and possessive quantifiers (a*+, a++). Older interpreters raise re.error on them, so check your minimum supported Python version.