All Tools › Developer & Data › Regex Validator

Regex Validator

Test regular expressions with live match highlighting and detailed results.

Validate a regular expression with live feedback

A regex can be syntactically broken or simply not match what you intended. This validator checks that your pattern is well-formed and tests it against sample text, highlighting matches as you refine it. Seeing the matches in real time is the quickest way to confirm a pattern does exactly what you need before you rely on it in code.

How to use it

  1. Enter your pattern and flags.
  2. Paste sample text to test against.
  3. Watch matches highlight, and adjust until it's correct.

Tips

Questions people ask

Why does my pattern match too much? Quantifiers are greedy by default; add a ? to make them match as little as possible.

Is my text uploaded? No — validation runs locally in your browser.