Skip to main content

Regex Tester

Type a pattern, paste your text, and see every match highlighted instantly — with g/i/m/s flags toggleable and a live match count. Runs on the browser’s native regex engine, so results match your JavaScript code exactly.

How it works

The tool compiles your pattern with new RegExp(pattern, flags) — the same engine your Node.js and browser code uses — then walks every match and wraps it in a highlight. If the pattern is invalid, you get the exact error message instead of a silent failure.

Common patterns worth knowing

GoalPattern
Emails\b[\w.+-]+@[\w-]+\.[\w.]+\b
URLshttps?://[^\s]+
Dates (YYYY-MM-DD)\d{4}-\d{2}-\d{2}
Phone (loose)\+?\d[\d -]{7,}\d

Where regex shows up

  • Validation: form inputs, API payloads — validate before you send
  • Log parsing: extract timestamps and IDs with the timestamp converter nearby
  • Data cleanup: scrub fields before feeding the JSON to CSV converter

If your pattern produces different results in the tool than in production, the usual culprits are flag differences (g changes matchAll/exec behavior) or using a different regex flavor (PCRE vs JavaScript). The tool speaks the JavaScript flavor by design.