Regex Tester

Test JavaScript regular expressions

Enter a pattern, choose flags, and inspect matches against sample text. The test runs locally in your browser.

0Matches
0Capture groups
WaitingStatus

Matches

Matched text, indexes, and capture groups are listed below.

Regex testing guide

Regex Tester runs JavaScript regular expressions against sample text and lists matches, indexes, and capture groups. It is useful before using a pattern in code, spreadsheet formulas, text cleanup, or log analysis.

Build patterns safely

Test a pattern on representative sample text before applying it to real data.

Inspect capture groups

Confirm whether parentheses capture the exact parts you intend to reuse.

Debug flags

Compare global, case-insensitive, and multiline behavior in a controlled input area.

Sample review notes for regex testing

Regex review should prove that a pattern matches the intended text and rejects similar-looking text before the pattern is used for cleanup or extraction.

Expected result

Positive examples match, negative examples fail, capture groups contain the intended values, and edge cases are visible in the sample text.

Failure signals

A broad pattern captures across multiple records, similar IDs match unintentionally, or the destination system uses a different regex engine.

Reviewer action

Retest the final pattern in the target application and apply replacements in small reviewed stages rather than one broad pass.

Real workflow note: cleanup patterns for tickets

Regex is useful for finding ticket IDs, error codes, dates, or filenames in copied text. A good pattern is tested against examples that should match and examples that must not match.

Build a small test set

Include real positive examples, near misses, blank values, punctuation, and lines from adjacent fields.

Review captures before replacement

Capture groups are powerful but easy to misread. Confirm each group before using it in a replacement workflow.

Retest in the target app

This tester uses JavaScript regex behavior. Other tools may handle escaping, Unicode, and multiline flags differently.

Case study: matching ticket IDs safely

A support engineer needs to find BUG-104 and DOC-221 in release notes without matching DEBUG-104 or incomplete IDs. They test positive and negative examples, review capture groups, and then retest the pattern in the destination tool.

  • Include examples that should match and examples that must fail.
  • Review capture groups before using replacement output.
  • Retest in the app where the regex will actually run.

Recommended workflow

  1. Paste a small but representative sample of the text you want to match.
  2. Enter the regex pattern without surrounding slashes unless the interface asks for them.
  3. Choose flags deliberately, especially global and multiline.
  4. Review every match and capture group before using the pattern elsewhere.
  5. Test negative examples to make sure the pattern is not too broad.

Quality checks before using the result

  • Keep positive examples, negative examples, and edge cases in the sample text while adjusting the pattern.
  • Review capture groups by index before using them in a replacement or data extraction workflow.
  • Retest the pattern in the target language or application when it does not use JavaScript regex behavior.

Questions about this tool

Why does my pattern work in another language but not here?

Regex dialects differ. This tool follows JavaScript behavior.

What makes a regex too broad?

A broad pattern matches text you did not intend to capture, especially when using dot-star or optional groups.

Can regex parse every format?

No. Structured formats such as JSON, HTML, and CSV are often better handled by parsers.