Skip to content
SmaftyTools

Regex Tester

Test regular expressions against sample text with live match highlighting, flags and capture groups. Free online regex tester.

//g

Matches (0)

Matches will be highlighted here

About Regex Tester

The Regex Tester lets you build and debug regular expressions against real sample text with live match highlighting. Type a pattern, pick your flags (global, case-insensitive, multiline and more) and see every match highlighted instantly, along with capture groups.

Regular expressions are powerful but notoriously easy to get wrong. Testing interactively — instead of trial-and-error inside your code — shows exactly what a pattern matches and, just as importantly, what it doesn't. Invalid patterns are reported with the browser's actual error message so you can fix syntax issues immediately.

The tester uses JavaScript's native RegExp engine, so results match exactly what you'll get in Node.js or browser code.

How to Use the Regex Tester

  1. Enter your regular expression pattern in the pattern field.
  2. Select flags such as g (global), i (ignore case) or m (multiline).
  3. Paste sample text in the test area — matches highlight instantly.
  4. Inspect the match list and capture groups, then refine the pattern.

Features

  • Live match highlighting as you type
  • Full flag support: g, i, m, s, u, y
  • Capture group inspection for each match
  • Native JavaScript RegExp engine — results match your code

Frequently Asked Questions

Which regex syntax does this tester use?

JavaScript (ECMAScript) regular expressions — the same engine as Node.js and all browsers. Most patterns are portable, but some features differ from PCRE (Python/PHP), such as lookbehind support and named group syntax.

Why does my pattern match too much?

Usually greedy quantifiers. * and + match as much as possible; add ? (e.g. .*?) to make them lazy, or use a more specific character class instead of the dot.

Is the Regex Tester free?

Yes, the Regex Tester is completely free with no usage limits. No signup, no account and no installation required.

Is my data safe?

Yes. All processing happens locally in your browser using JavaScript — nothing you type is uploaded or stored on our servers.