The Util Box

Regex Tester

Free online regex tester for developers. Live regex testing with match highlighting. Fast and private.

Embed this tool

Copy and paste the code below into your website to embed this tool for free. An attribution link to The Util Box is required.

<iframe src="https://www.theutilbox.org/embed/regex-tester" width="600" height="500" frameborder="0" style="border: none; max-width: 100%;" title="Free Regex Tester tool from The Util Box"></iframe>
<!-- Free tool by The Util Box — https://www.theutilbox.org/tools/regex-tester -->
<a href="https://www.theutilbox.org/tools/regex-tester">Regex Tester by The Util Box</a>

Frequently Asked Questions about Regex Tester

Regex Tester — Live Matches With Their Positions

This regex tester runs a JavaScript regular expression against your test text and lists every match as you type — no "run" button. Each result is tagged with its character offsets in the form [start-end] followed by the matched text, so you can see not just what matched but exactly where. Long matches are truncated at 100 characters to keep the list readable.

The pattern box takes the expression only — no slashes — and the flags box takes JavaScript flag letters such as g, i, m, s and u. The g flag is the important one: without it, only the first match is ever returned, which is the single most common reason a pattern that "should" match everything appears to match once.

Reading the Results

  • A count and a list — the number of matches, then one row per match with its offsets.
  • "No matches" — the pattern is valid but nothing in the text matched it.
  • A red error message — the pattern itself is syntactically invalid, and the message is the engine's own explanation, e.g. an unterminated group.

The engine is the same ECMAScript RegExp your browser runs at runtime, which makes the results directly transferable: a pattern that works here works in JavaScript without modification. Note that it does not use the named-group UI of some desktop tools, and it does not model PCRE-only features such as recursion or atomic groups.

Patterns Worth Testing Here

  • Email — [\w.+-]+@[\w-]+\.[\w.]{2,} for a quick sweep of a text file.
  • URLs — https?://[^\s"'<>]+ to extract links from prose.
  • Dates — \d{4}-\d{2}-\d{2} for ISO dates, then tighten for validity.
  • Duplicated words — \b(\w+)\s+\1\b with the gi flags, a classic proofreading check.

Related Developer Tools

  • Diff Checker — compare two texts line by line rather than by pattern.
  • JSON Formatter — validate and pretty-print structured data.
  • URL Encoder — escape the special characters a regex often chokes on.
  • Text Diff Checker — character- and word-level comparison for prose.

Patterns and test text are evaluated entirely in your browser — nothing is sent anywhere, which matters when the text is a log or a customer record.