Guides/Tool Guides

Regex Tester Guide

Test regex and highlight matches.

Overview

Test regular expressions with flags and inspect matches quickly. Useful for log parsing, data cleanup, and validating patterns before shipping them to production. Runs locally in your browser.

Pro time-savers

  • Per-line match summary

Use cases

  • Validate a regex before adding it to a backend validation rule.
  • Extract IDs/emails from logs using capture-friendly patterns.
  • Tune performance by simplifying overly greedy patterns.

Common pitfalls

  • Patterns that work in PCRE might fail in JavaScript (engine differences).
  • Nested quantifiers can cause catastrophic backtracking on long strings.
  • Remember to escape backslashes properly when copying from code into a regex literal/string context.

FAQs

Which flags should I use?

Common flags are g (global), i (ignore case), m (multiline). Combine them like gim depending on your needs.

Why does my regex error?

It’s usually invalid syntax or missing escapes. Remember to escape backslashes (\) properly.

Why does it match differently than my backend?

Different engines have different features (lookbehind, atomic groups, etc.). This tool uses JavaScript’s RegExp engine.

How do I avoid slow regex performance?

Avoid nested quantifiers like (a+)+ and prefer more specific character classes and boundaries when possible.

Examples

Input

pattern=\b\w+\b, flags=g

Output

Matches words