Toolvist

Regex Tester

Test regular expressions against your own text with live match highlighting and capture groups. Free online regex tester with flags and replace.

/ /

0 matches

Free Online Regex Tester

The Regex Tester checks your regular expressions against sample text and highlights every match. Toggle flags like global, case-insensitive, and multiline, then review the results.

A pattern that needs to run against a body of text is easier to build with the Find & Replace Text tool, and the matches it produces can be inspected with the Diff Checker / Text Compare. For extracting structured values, the Extract Emails from Text and Extract URLs from Text tools are the practical cases.

How to use the Regex Tester

  1. 1 Type your pattern into the expression field, without the surrounding slashes.
  2. 2 Set the flags you need — g for global, i for case-insensitive, m for multiline, s for dot-matches-newline.
  3. 3 Paste sample text into the test area; matches are highlighted live as you type.
  4. 4 Open the match list to see each capture group and its position, which is how you debug a pattern that almost works.

Regular expression pattern evaluation and grouping

The Regex Tester provides real-time pattern matching and capture group inspection across sample input text. It evaluates standard ECMAScript regular expressions, highlighting matching text spans, reporting total match counts, and separating full matches from indexed capture groups and named captures.

Testing patterns with varied inputs is crucial to eliminate common regex pitfalls such as unintended greedy capture, unescaped metacharacters, or catastrophic backtracking. The tool allows developers to configure standard regex flags including global search (g), case-insensitivity (i), and multiline mode (m).

  • Visualizes matching substrings and capture groups within the sample text.
  • Validates pattern syntax against modern ECMAScript RegExp specifications.
  • Supports standard execution flags including global, multiline, and insensitive modes.
  • Assists in testing boundary conditions and input validation rules before deployment.

Frequently asked questions

Why is my pattern matching more than I expect?

Quantifiers are greedy by default — ".*" consumes as much as possible. Add a "?" after the quantifier (".*?") to make it lazy so it stops at the first valid match instead of the last.

What does the global flag actually change?

Without "g", matching stops at the first hit. With it, every match is found. It also affects stateful behaviour in JavaScript, where a global regex remembers its position between calls — a common source of confusing bugs.

Which regular expression engine dialect is supported?

The tester uses the ECMAScript RegExp specification, which supports modern syntax including lookahead assertions (?=), lookbehind assertions (?<=), named capture groups (?<name>), non-capturing groups (?:), and unicode property escapes (\p{...}). Dialect-specific features like PCRE possessive quantifiers (++), atomic grouping, and recursive patterns are not supported.

Related Developer Tools

Browse all Developer Tools →