Regex Tester
Test JavaScript regular expressions live: type a pattern, see matches, capture groups, and replacement output, plus cheat sheet.
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.