Regex Tester

Test a JavaScript regular expression against sample text locally.

How it works

The engine is the browser JavaScript RegExp implementation. Use safe sample data and remember that regex syntax differs across languages.

new RegExp(pattern, flags).matchAll(sample).

Debugging scenario

Reduce a parsing failure to representative matching and non-matching lines. Test the JavaScript pattern and flags, inspect every returned substring and add an adversarial long input before transferring the expression to application code.

How to interpret the result

Matches describe JavaScript RegExp behavior in this browser. Other engines differ in lookbehind, Unicode, escaping, named groups and replacement rules. This result lists full matches, not capture-group semantics, and automatically uses global matching to enumerate occurrences.

Input reference

Pattern
Example default: Sample input included
Flags
Example default: Sample input included
Sample text
Example default: Sample input included

Common mistakes

  • Pasting secrets, credentials, customer records or other production data into a browser tool or shareable URL.
  • Deploying a pattern without checking catastrophic backtracking, anchoring and the target engine flavor.
  • Treating a convenient preview as validation by the target runtime, parser, database or security control.

Before using the result

  1. Reduce the input to a synthetic example that still reproduces the behavior.
  2. Run positive, negative, Unicode, empty and worst-case length tests in the target runtime.
  3. Add the accepted input and expected output to the project regression tests before release.

Questions to check before production use

Which regex flavor is used?

This tool uses the JavaScript RegExp flavor in your browser.

Can I test secrets?

Do not paste passwords, tokens or production data into any online tool.

Independent developer utility. Review output before using it in production.

Detailed developer guide

Regex, diff and text debugging: build evidence from minimal fixtures

Text tools are most useful when their algorithm and limits are explicit. This guide separates match evidence, positional changes, formatting and true syntax validation.

Read the guide