Regex Tester

Test regular expressions with live match highlighting and capture groups for extraction and validation rules.

FreeBrowser

Pattern

Flags
/(\w+)/g

Test String

Matches

About Regex Tester

Test a JavaScript regular expression against sample text and inspect highlighted matches and capture groups. Adjust flags while comparing the result with the matching behavior your code needs.

How to use Regex Tester

  1. Enter the pattern and choose supported flags.
  2. Paste the sample text.
  3. Review highlighted matches and capture groups, then refine the pattern.

Input and output example

Input and settings
Pattern: (cat)
Flag: g
Text: cat and cat
Expected output
Two matches, each capturing cat in group 1.

When to use this tool

  • Debug a capture group before using it in code.
  • Compare global and case-insensitive matching behavior.

Limits to know before using it

The engine is JavaScript RegExp. PCRE, Python and other flavors may behave differently; complex patterns can also be slow on large inputs.

Data handling and cost

The main operation runs in your browser; tool input is not uploaded for processing. The site can still use session cookies and collect operational or usage data as described in the privacy policy.

Free to use in your browser, with no sign-in needed.

Frequently Asked Questions

It uses JavaScript's built-in RegExp engine, which follows the ECMAScript standard. This is the same engine used in Node.js and all modern browsers.

Add the i flag to your pattern. You can combine flags: gi for global case-insensitive, gim to also match across newlines. The flags input field accepts any combination of g, i, m, s, and u.

No. All matching runs locally in your browser. Your pattern and test text are never sent to any server.

Related Tools