Skip to content
I Hate Online Tools

Regex tester

Live match highlights and capture groups for a pattern you type.

Highlights

No matches.

This runs in your browser. Nothing is uploaded.

About Regex tester

Tests a regular expression against a string in your browser, with live highlights and a breakdown of capture groups.

Online regex testers are useful and I still do not paste production log lines into them. Those lines have emails, request ids, and sometimes tokens. The pattern I am debugging is usually three characters away from working, and I do not need a third party to hold the haystack while I nudge the needle.

The pattern and flags sit in the side panel. The test string is the big field. Matches highlight as you type. Capture groups are listed as 'Match N group M' so a pattern with several groups stays readable. The engine is the one in your browser — JavaScript regular expressions, including the flags you already know: g, i, m, s, u, y. An invalid pattern or an illegal flag combination shows as an error instead of hanging the tab.

I did not add a cheatsheet that duplicates MDN, or a 'generate code in eight languages' panel. If you need Python's regex, this will lie to you about lookbehind and about what \w means. Use it to debug the expression you will actually run in JavaScript, or as a first pass that you re-check in the target language.

How to use Regex tester

  1. 1Enter a pattern and any flags you need.
  2. 2Paste the test string.
  3. 3Read the highlights and the capture group list as they update.

What it won't do

  • JavaScript regex only — not PCRE, not POSIX.
  • No replace, split, or 'explain this pattern' output.

Common questions

Which regex engine does the tester use?

The JavaScript engine in this browser, via new RegExp. Flags are the standard ones. Flavour differences versus PCRE or Python will show up as 'works here, fails there', which is information, not a bug in the page.

Why did my regex tester freeze on a nested star?

Catastrophic backtracking is real. I cap the number of matches collected so a greedy pattern cannot loop forever in the highlighter, but a hostile expression can still make the tab hitch. If the page stalls, simplify the pattern. I will not add a timeout worker for a tester this small.

Are regex replacements supported on this page?

No. This is match, highlight, and groups. Replacement belongs in the editor that will run it, where you can see the surrounding code. A replace box here would imply I apply it to a file I do not have.

Related tools

Why this one doesn't upload your file

There is no server to upload to. This page is a static file, and the work happens in your browser using the same graphics and WebAssembly code that renders every other site you visit. Your file is read from disk into memory, processed, and handed back as a download. Once the page has loaded you can disconnect from the network entirely and it keeps working. The longer explanation

Install the app