Code tool

Validate Regex

Validate up to 2,048 UTF-16 units of pattern text using this browser’s RegExp constructor, then copy its normalized expression.

In-browser processingNo account requiredPrivacy details ↗

Enter the pattern body without / delimiters. Maximum 2,048 UTF-16 units. An empty pattern is valid.

Optional: d g i m s u v y, each once. u and v cannot be combined. Browser support varies.

Enter a pattern and flags, then validate.

Syntax check only: no text matching or ReDoS analysis. A valid expression can still cause catastrophic backtracking when used elsewhere.

A QUICK WALKTHROUGH

How to use this tool

  1. Enter the pattern body without slash delimiters.
  2. Enter optional flags and select Validate syntax.
  3. Review the syntax result and copy the normalized expression.

Syntax and flags

Checks syntax supported by the current JavaScript browser engine. Allowed flags are d, g, i, m, s, u, v and y, each once. u and v are mutually exclusive; newer features may be unsupported in older browsers. Empty patterns are valid.

Explicit safety scope

Only compilation is performed. There is no text input, match preview, structural analysis or ReDoS audit. A syntactically valid pattern can still be unsafe to match. Patterns are limited to 2,048 UTF-16 units and remain in your browser.

GOOD TO KNOW

Common questions

Does valid syntax mean the regex is safe?

No. Syntax validity says nothing about catastrophic backtracking, matching performance or correctness for your data.

Does this validate PCRE or Python syntax?

No. It uses the current browser’s JavaScript RegExp syntax. Check the target runtime separately.

Are expressions uploaded?

No. Syntax validation and copying happen locally.