Chris Collins

Tools · encoding

Regular expression tester

Test JavaScript regular expressions live — highlighted matches, capture groups, replace and split previews, a plain-English explanation, and a pattern library.

Added

How to use it

Type a pattern and toggle flags (g i m s u y d); matches are highlighted in the test text and listed with their positions and every numbered and named capture group. Switch to Replace to preview a replacement using $1, $<name>, $&, and $$, or to Split.

The explanation breaks the pattern into tokens — groups, classes, quantifiers, anchors, lookarounds — and says what each does. The pattern library has ready-made patterns (email, URL, IPv4/IPv6, UUID, ISO dates, semantic versions, log lines…​), and Save keeps your own patterns in this browser.

Matching runs in a background worker with a 1.5-second limit, so a pattern with catastrophic backtracking stops instead of freezing the page. Patterns use JavaScript’s regular-expression syntax. Press Cmd/Ctrl + Enter to re-run.

Sharing

Share link copies a URL that opens this tool exactly as you have it. Hand-written links work too: ?re=<pattern>&flags=gi&text=…, and mode=replace&repl=… or mode=split. For example ?re=(%5Cd%2B)-(%5Cd%2B)&flags=g&text=10-20%2C%203-4.

Runs entirely in your browser; nothing you type leaves this page.