Files never leave your device
Regex Tester
Test JavaScript regular expressions with live match highlighting, group capture display, and replacement preview.
//
3 matches
Send mail to alice@example.com or bob@test.org. Try also: charlie@foo.io.
#1 @13 alice@example.com
#2 @34 bob@test.org
#3 @58 charlie@foo.io
How to use Regex Tester
- Enter your regular expression in the pattern box.
- Add flags (g, i, m, s, u, y) — the global flag is on by default for match-all behaviour.
- Paste the text you want to test against in the larger area below.
- Matches highlight in real time. Capture groups and named groups appear underneath.
Regex flag cheatsheet
- g — global, return all matches instead of just the first
- i — case-insensitive
- m — multiline; ^ and $ match at line boundaries
- s — dotAll; "." also matches newline characters
- u — Unicode; enables
\p{...}property escapes - y — sticky; matches only at lastIndex (advanced)
Patterns worth memorizing
Email-ish: /^[\w.+-]+@[\w-]+\.[\w.-]+$/. URL-ish: /https?:\/\/\S+/g. Whitespace squash: /\s+/g. None are perfect — real-world inputs always contain edge cases. Use this playground to confirm before shipping a pattern to production.