Python Regex Tester

Test regular expressions in real-time with Python-flavored syntax. See matches highlighted, capture groups extracted, and get ready-to-paste Python code.

100% browser-based · No data stored · No sign-up required
//
Match Results

Enter a regex pattern above to see matches highlighted here

Frequently Asked Questions

Is this compatible with Python's re module?

Yes. JavaScript regex is ~95% compatible with Python's re module. Named groups use (?P<name>...) syntax in the generated Python code. The tool tests in JavaScript for instant feedback but generates valid Python code.

Does this support named capture groups?

Yes. Use (?<name>...) syntax in the pattern (JavaScript named groups). The generated Python code will use Python's (?P<name>...) syntax automatically.

Is my data sent to a server?

No. All regex matching happens entirely in your browser using JavaScript's built-in RegExp engine. Nothing is sent over the network.