Regex Tester

Test JavaScript regular expressions, inspect capture groups, and highlight matches without leaving your browser.

Private by default. Your input stays in your browser.Learn more
Flags
Patterns run in an isolated worker with a 1-second timeout. Input is limited to 50,000 characters. Expensive patterns can still time out; no detector catches every unsafe pattern.

What does this tool do?

A regex tester shows where a pattern matches your sample text and what its capture groups contain. This tool uses your browser's JavaScript regular expression engine.

When to use this tool

Try a regular expression against sample text before using it in JavaScript. Match highlighting and capture groups help explain what the pattern selects. Choose flags deliberately: a pattern tested in another language may behave differently in your browser's JavaScript engine.

How to use Regex Tester

  1. Enter a JavaScript regex without surrounding slashes.
  2. Choose flags and add your test text.
  3. Run the pattern to inspect highlighted matches and capture groups.

A quick example

Pattern: \b\w+@\w+\.\w+\b
Text: hello@example.com
Match: hello@example.com

How to test regular expressions safely

Common questions

Which regex flavor is supported?

This tool uses the JavaScript RegExp engine in your browser. Syntax may differ from Python, PCRE, or .NET.

What happens with zero-length matches?

They are listed with their positions, and the engine advances safely to avoid an infinite loop. Results are capped at 1,000 matches.

Working with a large input? Text converters accept up to 1,000,000 characters. Regex test text is limited to 50,000 characters and JWTs to 100,000.