
Bulk replace text with optional regex and case matching.
Test regular expressions live with match highlighting and replace preview.
Your files never leave your device. Everything runs in your browser.
Regex Tester runs a JavaScript regular expression against sample text and shows every match highlighted in place. The pattern, flags, test text and an optional replacement are all editable, and the results update as you type.
It is built for the fiddly part of writing regular expressions: checking that a pattern matches the right things and that it does not match the wrong ones. Paste a log line, a list of email addresses, a snippet of HTML or test data, then refine the pattern and watch the highlights and match list change. A pattern such as “\b\w+@\w+\.\w+\b” over “Contact [email protected] or [email protected]” reports two matches, at indexes 8 and 27.
The match counter shows how many matches were found, each row in the match list shows the matched text, its starting index and any captured groups, and adding a replacement previews the substituted result. Everything runs on the browser's regular expression engine.
The browser's JavaScript engine — ECMAScript regular expressions, the same syntax used in web development and Node.js. Python, PCRE, Java and .NET support different syntax and additional features, so patterns do not always transfer.
The g (global) flag is off. With g ticked, every non-overlapping match is found; without it the engine stops at the first. The flag also decides whether a replacement affects one match or all of them, and g is on by default.
i ignores case, m makes ^ and $ match at line breaks rather than only the start and end of the whole text, s lets the dot match newline characters, and u switches on Unicode mode. g finds all matches instead of just the first.
Yes. JavaScript regex has no execution limit and the tester does not run patterns in a worker or with a timeout, so a pattern that backtracks catastrophically — nested quantifiers applied to a long, nearly matching string — can freeze the tab until the browser stops it. Keep the test text short while developing such patterns.
Patterns are passed straight to your browser's engine, so support follows the browser: current versions of Chrome, Firefox, Safari and Edge support named groups and lookbehind.
Yes. Type into Replace with and the replaced text appears in a read-only preview; Copy result copies it. Capture-group references such as $1 and the whole-match reference $& follow JavaScript substitution rules.
Related text tools: Find & Replace, Text Diff Checker, Line Tools, Word Counter.
Patterns and test text are processed in your browser; nothing is uploaded.