Skip to main content
Uddatak

Regex Tester

Write a regular expression and test it against your own sample text, with matches highlighted live as you type — helpful for debugging a pattern before dropping it into your code. Runs entirely in your browser.

Developer Tools Runs entirely in your browser

The pattern is tested on your device (in an isolated Web Worker) — no text is sent to a server.

The test runs in a separate Web Worker with a timeout, so a pattern with catastrophic backtracking stops automatically instead of freezing the page.

Pattern breakdown

Enter a pattern to see it explained piece by piece.

What this tool does

Runs a regular expression against text and shows the matches immediately with their positions and capture groups, alongside a breakdown of the pattern and a ready code snippet. It also has a replace mode.

When to use it

  • Writing a pattern and wanting to try it on real text before putting it in your code.
  • A pattern turned up in a code review and you cannot tell what it does.
  • Extracting patterns from text — numbers, dates, identifiers.
  • Trying a regex replacement before running it on real data.

How to use it

  1. Type the pattern into the pattern field.
  2. Paste the text you want to test it against.
  3. Choose "Match" or "Replace", and enter the replacement if you chose the latter.
  4. Click "Test" and read the match count, the table of matches with positions and groups, the pattern breakdown, and the code snippet.

A practical example

Input

The pattern \d{4}-\d{2}-\d{2} against text containing several dates.

Output

A table of every matching date with its position in the text, plus a breakdown explaining that the pattern wants four digits, a hyphen, two digits, a hyphen and two digits.

Limitations

  • A pattern with catastrophic backtracking is terminated after a hard timeout and you get a clear "this pattern is too slow" message — rather than a frozen tab.
  • The expressions here use JavaScript's dialect; some features from other dialects such as PCRE are unavailable.
  • The pattern breakdown covers common constructs and does not explain every possible construction.

Privacy and processing

The pattern is tested on your device in an isolated web worker, and no text is sent to a server.

Technical notes

  • Execution happens in a dedicated worker with a hard timeout, because a pattern with catastrophic backtracking freezes whatever thread it runs on — running it on the main thread with no way to interrupt would mean a hung tab with no way out.
  • On timeout the worker is terminated outright rather than waited on.

Explore our other tools

Dozens of everyday tasks made easier with Uddatak.

Browse all tools