Test a regular expression against your text and see every match highlighted, with its capture groups. It uses your browser's JavaScript engine, so results match what your code will do.

How It Works

  1. Enter a Pattern: Write the expression without the surrounding slashes. Mistakes are reported as you type.
  2. Choose Flags: Turn on global, ignore case, multiline, dot matches new lines, or Unicode.
  3. Add Test Text: Matches are highlighted, and the table lists each match with its position and groups.
  4. Replace: Optionally enter replacement text to see the result, using $1 or $<name> for groups.

Key Features

Frequently Asked Questions

Which regex flavor does this use?

JavaScript's, as built into your browser. Most syntax is shared with Python, Java, C#, and PCRE, but some features differ, such as lookbehind support in older browsers and the absence of possessive quantifiers.

Why does my pattern only find one match?

Without the global flag, JavaScript stops at the first match. Turn on Global to find them all.

Why was my pattern stopped for taking too long?

Nested repeats such as (a+)+ or (.) can try a huge number of ways to match text that almost matches. This is called catastrophic backtracking. Rewrite the pattern so each part can only match in one way, for example a+ instead of (a+)+.

How do I match a literal dot or bracket?

Put a backslash before it, such as . for a dot or ( for an opening bracket.

Regex Tester

JavaScript Regular Expressions

You can also come chat with us on the Stoic Dreams discord server.

If this tool saved you time today, please consider supporting the project via [GitHub Sponsors](https://github.com/sponsors/StoicDreams). Every contribution helps me build more utilities for the community. About Ap Tul Contact Stoic Dreams Privacy Terms & Conditions