Regex Sandbox
Live pattern testing · match details · replace mode · built-in cheat sheet
⚠️ Your browser blocked the background safety worker, so pattern runs are no longer protected by the timeout described below. Avoid testing untrusted or very complex patterns.
/
/
Without the
g flag, only the first match is replaced — this matches standard JavaScript behavior.Enter a pattern and test string to see matches highlighted here.
- JavaScript regex only. This sandbox runs your browser's built-in
RegExpengine. It does not support PCRE/Python-only syntax such as possessive quantifiers, atomic groups, recursion, or\K— patterns using these will show a syntax error here even if valid elsewhere. - Runs are capped at 1.5 seconds. Every test or replace runs in a background worker with a hard-coded timeout. If a pattern hasn't finished in that time (usually a sign of catastrophic backtracking), the run is aborted and you'll see a "took too long" warning instead of a frozen tab.
- Matches are capped at 1,000 per run. If your pattern matches more than that, only the first 1,000 are highlighted and listed, for performance.
- Replace Mode follows standard JS rules: without the
gflag, only the first match is replaced — that's normalString.replace()behavior, not a bug. - Recent patterns are stored in your browser's local storage only. They aren't synced across devices and will disappear if you clear your browsing data or use a different browser.
- Everything runs on your device, not a server. Nothing you type is uploaded anywhere, but very large test strings (we'd suggest staying under ~50,000 characters) will be slower on lower-powered devices.
- The 1.5s timeout needs Web Workers to work. If your browser or a strict site policy blocks them, you'll see a warning banner above and patterns will run unprotected — avoid pasting untrusted patterns in that case.