Regex Tester — Online Regular Expression Tester Test regular expressions live
100% offline
//
Test string
Matches
Enter a pattern and a test string to see live matches.

About Regex Tester — Online Regular Expression Tester

Regular expressions are a concise language for matching patterns in text — validating input, extracting fields, and search-and-replace. They're also notoriously hard to get right, so testing against real sample text is the fastest way to build one with confidence.

This free regex tester runs your JavaScript pattern against a test string live, highlighting every match and listing capture groups and positions. It supports the common flags and runs entirely in your browser.

Features

  • Live matching with highlighted results as you type
  • Capture groups and match positions for every match
  • Toggle flags: global, ignore-case, multiline, dotall
  • Clear errors for invalid patterns; fully offline

How to use

  1. Type your pattern between the slashes and toggle any flags.
  2. Enter sample text in the test-string pane.
  3. Review highlighted matches plus the match list with indices and groups.

Frequently asked questions

Which regex flavor does this use?

It uses JavaScript's native RegExp engine, so the syntax matches what runs in browsers and Node.js. Most patterns are portable, but features differ slightly from PCRE or Python's re.

What does the global (g) flag do?

Without g, only the first match is returned. With g, the tester finds every non-overlapping match in the text — which is what you usually want when extracting or replacing.

What are capture groups?

Parentheses in a pattern create capture groups, letting you extract sub-parts of a match. The tester lists each group ($1, $2, …) for every match it finds.

Why isn't my regex matching?

The usual culprits are unescaped special characters (. * + ? ( ) [ ] need a backslash to match literally), a missing global flag when you expect multiple matches, or case sensitivity — add the i flag to ignore case. Paste your real text here and watch the live highlighting to see exactly where the pattern stops matching.

Can I test search and replace?

This tester focuses on matching and capture groups, which are the foundation of any replacement. Once your pattern matches the right text and the groups capture the parts you need, you can use $1, $2, … as backreferences in a String.replace call in your own code.

Is my data sent anywhere?

No. The pattern and test string are evaluated entirely in your browser with the native RegExp engine. Nothing is uploaded, so the tester works offline and keeps your data private.

Everything runs locally in your browser — your input is never uploaded.