Developer & Text Tools

Regex Tester — Live Regular Expression Testing

Build a regular expression the way you build code: write test cases that must match, must not match or must extract an exact value, see every case pass or fail as you edit the pattern, check which features other regex flavours lack, and copy ready-to-run code for JavaScript, Python, Java, Go, C#, PHP or Rust.
Runs in your browserNothing is uploaded

Pattern

Test cases

Cases are tested with the JavaScript engine, the same one the browser uses.

Code

No known compatibility issues for Python.
import json
import re

pattern = re.compile(r'^[\w.+-]+@[\w-]+(\.[\w-]+)+$', re.IGNORECASE)
samples = ["zoe.smith+news@example.com","ada@uni.edu.au","not-an-email","two@@example.com","space in@example.com"]

for text in samples:
    match = pattern.search(text)
    print(json.dumps(text), match.group(0) if match else None)

How to use this tool

  1. 1Pick a preset or type your pattern and flags.
  2. 2Add test strings and say whether each should match, not match, or extract an exact value.
  3. 3Edit the pattern until every case passes.
  4. 4Choose a language and copy the generated code; read the compatibility notes for that flavour.

Frequently asked questions

Your browser’s JavaScript engine. The compatibility notes list features that other flavours lack, such as lookaround and backreferences in Go (RE2) and \p{…} in Python’s re module.

Yes. It compiles the pattern with the right flags and escaping for that language and prints the first match for each test string. Named groups are converted to (?P<name>) for Python.

Matching runs in a background worker with a 1.5-second limit, so catastrophic backtracking stops with a warning instead of freezing the page.