How to use the Regex Tester
- Type a pattern without the surrounding slashes and tick the flags you need.
- Paste test text: every match is highlighted and listed with its position and capture groups.
- Enter a replacement using
$1,$2or named groups to previewString.replace(). - Start from a common pattern (email, URL, date, hex color, phone, price, slug, IPv4) and adjust it.
Tips
- Without the
gflag only the first match is found, exactly like in JavaScript. - Use
(?<name>...)for named groups; they appear in the match table. - Patterns are checked as you type and errors are explained, so you can fix them before using them in code.
Everything runs in your browser: nothing you type or paste is sent to a server.