DataHub Tools Regex Tester

Regex Tester

Local-first

Test regular expressions against sample text locally and inspect matches for debugging and validation.

What is Regex Tester?

Test regular expressions against sample text locally and inspect matches for debugging and validation.

  • Test JavaScript regex patterns
  • List matches and groups
  • Use flags such as g, i, and m

How to use it

  1. Put the JavaScript pattern on line 1 without surrounding delimiters.
  2. Put flags such as gi or gm on line 2.
  3. Paste the test text from line 3 onward.
  4. Review every match, index, and capture group against positive and negative edge cases.

Quick example

Example input

\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b
gi
Contact: ada@example.com

Expected output

#1: ada@example.com
index: 9

The tester uses JavaScript RegExp semantics and ensures global matching. Patterns from other engines may behave differently.

Best use cases

  • Debug JavaScript-compatible regular expressions.
  • Inspect match indexes and capture groups.
  • Test validation and extraction patterns against edge cases.

Reference standards and behavior

This page uses the browser's JavaScript RegExp implementation. Regex syntax and features can differ from PCRE, RE2, Python, Java, and server-side engines.

Sources checked July 24, 2026. Standards can change; review the source pages before formal integration.

Notes

  • A successful sample match does not prove a validator is complete.
  • Complex backtracking patterns can become slow on large input.
  • Do not paste sensitive production logs unless local handling is appropriate.

FAQ

Should I include /pattern/ delimiters?

They are optional. A valid /pattern/flags form is recognized; otherwise line 1 is used exactly as the pattern.

Where do flags go?

Put flags such as gi or gm on line 2. If omitted, the tool uses g for global matching.

Does foo/bar remain intact?

Yes. A slash inside a plain pattern is preserved and is not mistaken for flags.

Why are results different from Python or PCRE?

The page uses the browser's JavaScript RegExp engine, whose syntax and features differ from other engines.

Can a pattern freeze the page?

A pattern with catastrophic backtracking can become slow on large text, so test with bounded samples.