Developer

Regex Tester

Test JavaScript regular expressions with highlighted matches, capture groups and replacements, safely stopped if a pattern runs away.

Offline prerequisites

The installed app shell does not prepare every operation. Choose the resources you need, prepare while online, then recheck before disconnecting. Downloads below are approximate bundled sizes; network transfer can differ.

This tool has no separately downloaded codec/model prerequisite in this build. Its app code must still be installed, and browser APIs, file limits and supported formats still apply.

Checking this build’s offline resources…

/ /g

Tab moves to the next control. Ctrl+] or Command+] inserts a tab.

About this tool

Write a regular expression and see every match highlighted in your test text as you type. Click a match to see its position and capture groups, named ones included, and turn on replacing to preview the result with $1 or $<name> references.

Patterns run in a separate worker with a time limit. Some patterns, like (a+)+$, take exponentially longer on text that almost matches; instead of freezing the page, the run is stopped and you’re told why. Nested repeats are also flagged as you type.

These are JavaScript regular expressions with every flag your browser supports, including d, s, u, v and y. Other languages’ engines differ in places, so test with the engine you’ll use when it matters.

What is catastrophic backtracking?

When a pattern can match the same text in many ways, like (a+)+, a failing match tries every combination, which grows exponentially with the text length. Rewrite the pattern so each part of the text can only be matched one way.

esc
  • Opens in its own window, like any app
  • Works without an internet connection
  • Starts instantly from your home screen or dock

Look for the install icon at the right end of your browser’s address bar, or open the browser menu and choose Install Interformat.