Test Regex Find and Replace Online
Switch to Find and Replace mode, enter a pattern and a replacement using $1 or $&, and watch the substituted output update live. All processing runs in your browser.
Regex Playground
LOCAL · Browser-OnlyBuild, test, and debug regular expressions with real-time match highlighting
Quick Start
- 1Enter your regex pattern and flags
- 2Switch to Find and Replace mode
- 3Type the replacement string using $1, $2, or $&
- 4Copy the replaced output
What This Tool Does
Switch to find and replace and a second field appears for the replacement. The substituted text updates as you type, so you can watch what a pattern does to real content instead of reasoning about it.
Replacements use the standard dollar-sign references: $1 and $2 for numbered groups, $& for the whole match, and the angle bracket form for named groups. Watch the global flag, because without it only the first match is replaced.
A cheat sheet sits on the page covering character classes, anchors and boundaries, quantifiers, and groups and lookaround, which saves a tab switch halfway through building a pattern. A flavor note explains where the behavior you are seeing differs from other engines.
Limits Worth Knowing
- Matching always runs on the browser's regular expression engine. The flavor selector explains differences, it does not switch engines.
- Six flags are offered here. The indices flag lives on the regex tester rather than on this page.
- A pattern that takes too long is stopped and reported rather than being left to hang the page.
- Eight starter patterns are available, and unlike the tester's presets they fill in the pattern only, not a sample string.
- Pattern, flags, test string, replacement and mode are all kept locally and restored on your next visit.
Common Questions
Why did only the first match get replaced?
How do I reference a named group in the replacement?
How is this different from the regex tester?
More Test Tools
All testers →Test Website Load Time and TTFB
Test how fast a website loads, including time to first byte, page size, and request count. Free website speed test with optimization tips, no signup.
Test Webhooks Online - Inspect HTTP Requests
Generate a temporary webhook URL and inspect incoming HTTP requests. Free online webhook tester.
Test JavaScript Regex Online
Test a JavaScript regular expression with live match highlighting and capture groups. Free online regex tester, runs in your browser, no signup.
Looking for FAQs and advanced options? Visit the full Regex Playground page →