Development

Regex Tester

Test regular expressions against sample text.

//g
Flags

Test a regular expression

Enter a pattern and sample text to inspect matches, positions and captured groups.

Regular expressions are evaluated locally by your browser's JavaScript engine.

About this tool

What is Regex Tester?

A regular expression tester helps you validate patterns against sample text and inspect every match, position and captured group. BigForgeKit uses the browser JavaScript regular expression engine and performs all testing locally.

Features

Built for fast developer workflows

  • Test JavaScript-compatible regular expressions.
  • Enable global, case-insensitive and multiline flags.
  • Inspect match positions and captured groups.
  • Display named capture groups separately.
  • Detect invalid regular expression syntax.
  • Evaluate all patterns locally in the browser.

Frequently asked questions

Questions about Regex Tester

Which regular expression syntax does this tool use?

The tester uses the JavaScript RegExp implementation provided by your browser. Some syntax available in other engines, such as PCRE-specific features, may not be supported.

What does the global flag do?

The g flag finds every non-overlapping match. Without it, JavaScript normally returns only the first match.

What is a capture group?

A capture group is a parenthesized part of a regular expression whose matched value is returned separately from the complete match.

Can a regular expression freeze the browser?

Poorly designed expressions can cause excessive backtracking and become slow on certain inputs. Avoid testing untrusted or extremely complex patterns against very large text.

Related tools