glyphcount

Regex Tester

Test JavaScript regular expressions live: type a pattern, see matches, capture groups, and replacement output, plus cheat sheet.

Type a JavaScript regular expression and a test string, and matches highlight live with capture groups numbered, match count updated on every keystroke, and an optional global/search flags panel.The engine is your browser's native RegExp — the exact same engine Node.js and Chrome use — so a pattern that works here behaves identically in your code, unlike testers that run a server-side dialect.
0 matches

Written by Nan Liang · Updated November 2026

Frequently asked questions

Which regex flavor does this use?

JavaScript's native RegExp engine (the same one in Chrome and Node.js). It supports named groups (?<name>…), lookbehind (?<=…), and unicode flags u and v — but not PCRE-only syntax like (?P<name>).

Why does my pattern show an error?

Common causes: an unescaped / in the pattern (write \/), an unmatched (, [, or {, or a flag your browser does not support (only d g i m s u v y are valid). The error message shows the exact position.

What do the flags do?

g finds all matches instead of the first; i ignores case; m makes ^ and $ match line starts/ends; s lets . match newlines; u enables Unicode mode; y anchors to lastIndex for sticky matching.

How do I match an email address?

A practical starting point: ^[\w.+-]+@[\w-]+\.[\w.-]+$ — it covers most real addresses but not every RFC 5321 edge case. Treat email regex as a smoke test, not proof of deliverability.

Next steps

Cleaning text with regex? The Text Cleaner applies common cleanup rules in one pass, no pattern required.

Open the Text Cleaner →