Skip to main content

Regex Tester

Test regular expressions live in your browser. See every match with groups and indices, with support for common flags.

Matches are computed in your browser against the text you supply, and neither the pattern nor the text is transmitted. Flags change the result: a pattern that works without /s often fails on multi-line input.

Tool workspace

Flags

Limit: 50,000 characters per run. Longer input is rejected before matching.

JavaScript replacement syntax: $1, $<name>, $&, $$. Leave empty to delete matches.

Matches

0 matches

No matches found. Check the pattern or try different flags.

How to Test a Regular Expression Online

Learn how to test regular expressions locally in your browser with live match results, flags, and group information.

  1. 1

    Enter your pattern

    Type or paste the regular expression you want to test.

  2. 2

    Select flags

    Toggle flags such as global, case-insensitive, multiline, dotall, or Unicode.

  3. 3

    Paste test text

    Add the text to match against. Results update as you type.

  4. 4

    Review matches

    Inspect each match, its index, and captured groups, then copy any value you need.

Common Use Cases
  • 1Debug regex patterns before using them in code or CI pipelines
  • 2Validate user input formats such as email, phone, or identifiers
  • 3Extract data from logs, configs, or test fixtures without uploading them
  • 4Build and verify regex for search, scraping, or transformation scripts

Frequently Asked Questions

Which regex flavors are supported?

The tester uses JavaScript's native RegExp engine, the same flavor used by Node.js and modern browsers. Quantifiers, groups, lookarounds, and Unicode properties behave as they do in JavaScript.

Are my pattern and test text uploaded?

No. Matching runs entirely in your browser with the native RegExp engine. Nothing is sent to a server, so you can safely test patterns against sensitive logs or configuration.

How do I avoid regex performance problems?

Keep patterns linear where possible and avoid nested quantifiers like (a+)+ which can cause catastrophic backtracking on certain inputs. Test against realistic input sizes before deploying.

Can I use named groups and replacement tokens?

Yes. Named groups such as (?<year>…) are listed with each match, and the replacement field accepts $1, $<year>, $& and $$. The result updates as you type.

Why is a pattern rejected before it runs?

Inputs above the per-run character limit are rejected before matching starts, and patterns that exceed the time budget are aborted. Both guards keep the tab responsive when a pattern backtracks heavily.

Related Guides

Related Tools

Your inputs remain on your device.

You are responsible for key management and output validation.