Skip to main content

Regex Tester

Test regular expressions, capture groups, and replacement output in real time.

0 / 200,000

An empty value removes matches. Use $1 or $<name> to reference capture groups.

Match Results

0 matches

Enter a pattern to start evaluating.

Evaluation runs in an isolated worker and stops after 1.2 seconds to keep the page responsive. Input is limited to 200,000 characters and output to 500 matches. Positions use JavaScript UTF-16 indexes.

How to Use

  1. 1

    Enter pattern and flags.

  2. 2

    Paste your target text.

  3. 3

    Review matches and optional replacement result.

Features

  • Time-limited worker prevents expensive patterns from freezing the page
  • Numbered and named captures plus zero-width match handling
  • Live replacement and match-position previews
  • TSV copy and structured JSON download

FAQ

Q. Can I test without global flag?

A. Yes. Without g, only the first match is evaluated.

Q. Which flags are supported?

A. It follows the browser JavaScript RegExp implementation. Current major browsers support d / g / i / m / s / u / v / y, while newer flags such as v depend on browser support.

Technical Notes

Matching and replacement run in a Web Worker isolated from the main interface and are terminated after a fixed time limit.

Global zero-width matches advance by a Unicode-aware string index to prevent infinite loops.

Security & Privacy

All text and regex processing stays in your browser.

No external API calls are used for matching logic.

Examples, Validation Cautions, and Common Mistakes

Examples

  • Test patterns for email addresses, postal codes, URLs, and form validation.
  • Extract error codes or timestamps from logs with a sample regex.
  • Check what will match before using a pattern for replacement.

Cautions

  • Regex syntax differs by runtime, so confirm the final pattern in the target language too.
  • Overly broad patterns can match more text than intended.
  • Complex repetition can become slow on certain inputs.

Common Mistakes

  • Testing with too few samples and missing production edge cases.
  • Overusing `.*` and capturing much more than intended.
  • Forgetting `^` or `$` and mistaking partial matches for full matches.