← Back to tools

Regex Tester

Test regular expressions with flags and inspect all matches with capture groups.

Enter a pattern and text.

What is Regex Tester?

Regex Tester lets you write and test regular expressions against any text in real time. It shows all match positions and capture groups so you can debug patterns quickly without running code.

How to use

  1. Enter your regex pattern in the Pattern field (without leading/trailing slashes).
  2. Optionally add flags in the Flags field. Common flags: g (global), i (case-insensitive), m (multiline).
  3. Paste the text you want to test in the Test Text area.
  4. Matches and their character positions appear in the result area immediately.

Notes

  • Uses JavaScript's built-in RegExp. Syntax follows the ECMAScript standard.
  • Without the g flag, only the first match is returned.
  • Backslashes in the pattern field do not need to be doubled (e.g., use \d, not \\d).

FAQ

What regex flavor does this use?
JavaScript ECMAScript regex. This is compatible with most modern languages for basic patterns, but advanced features like lookbehind with variable length may differ from PCRE (Python, PHP).
How do I match a literal dot?
Escape it with a backslash: \.. An unescaped dot matches any character except a newline.
What are capture groups?
Parentheses create capture groups, e.g. (\w+)@(\w+). The result shows extracted group values alongside the full match.

Overview

Test regular expressions with sample text and flags. Useful for validation rules, log parsing, and extraction checks.

How to use

  1. Enter pattern and test text.
  2. Set flags such as g/i/m.
  3. Run and inspect matches and groups.

Examples

Notes

FAQ

Why no match found?
Check anchors, flags, and escaping first.
What does g flag do?
It searches all matches, not just the first.
Can regex freeze input?
Complex backtracking patterns can be expensive.

Embed this tool

Paste this iframe into any HTML page to embed Regex Tester on your site:

Related Tools