</>

WebDevTools

Regex Tester

Test and validate regular expressions

Test regular expressions with real-time match highlighting. Configure flags (global, case insensitive, multiline) and view captured groups. Perfect for validating and debugging regex.

Regex Pattern

Test String

Matches

Enter a regex pattern

Highlighted Text

Enter a test string

Guide: test regular expressions with highlighted matches

Validating emails, mining log IDs, or refactoring parsers means iterating regex against real samples. Testing only in app code requires deploys — here you see matches, capture groups, and flags (`g`, `i`, `m`) instantly.

Sample text and patterns stay in the browser; nothing is uploaded. Best for sanitized logs or synthetic form strings, not production PII.

Use for input validation, `.replace()` pipelines, or search filters. Watch for catastrophic backtracking on nested quantifiers before shipping.

Step by step

  1. Enter pattern and flagsType the regex and enable global, case-insensitive, or multiline flags as needed.
  2. Paste sample textUse log lines, URLs, or fake forms. Each match highlights with index and numbered groups.
  3. Inspect groups and replacementCheck `$1`, `$2` for chained replace. Use non-capturing `(?:…)` when you do not need the value.
  4. Move to codeCopy the escaped pattern into JavaScript `RegExp`, PCRE, or schema validators — test empty and Unicode edge cases.

Frequently asked questions