A regex tester lets you write a regular expression, run it against sample text, and see exactly which substrings match. This tool builds the pattern using JavaScript's native RegExp constructor — the same engine that ships with V8 (Chrome, Node), JavaScriptCore (Safari), and SpiderMonkey (Firefox). That means the syntax, escape rules, and flag semantics here are the ECMAScript flavor: PCRE-style features like atomic groups and possessive quantifiers are not supported, but lookaheads, lookbehinds, named groups, and Unicode property escapes all work.
Highlighting and the match list are produced by repeatedly calling RegExp.prototype.exec on the test string. When the global flag is set, exec advances lastIndex on each call until no more matches are found. The tool always passes the g flag to its internal iteration even if you have not enabled it, so the highlight pass and the match list show every occurrence; your chosen flags still control case sensitivity, multiline anchors, dot-all behavior, and Unicode parsing.
All five common flags are exposed: g for global iteration, i for case-insensitive matching, m so that ^ and $ anchor at line boundaries instead of string boundaries, s (dot-all) so that . matches newline characters, and u to enable full Unicode mode including \p property escapes and surrogate-pair-aware matching. The y (sticky) flag is intentionally omitted because it complicates iterating from a stand-still UI; if you need it, paste your pattern into Node and step through manually.
The biggest pitfall in regex is catastrophic backtracking. Patterns like (a+)+$ or (.*)*x can take exponential time on inputs that almost match — a 30-character string might lock the page for minutes. JavaScript engines do not have a built-in regex timeout, so a runaway pattern entered in this UI can briefly freeze the tab. Use atomic-style rewrites (anchor your alternations, replace nested quantifiers with character classes) to avoid the problem; the tool's StatsBar will show whether your input is small enough to be safe.
Replacement uses String.prototype.replace under the hood. The replacement string supports the standard JavaScript escapes: $1 through $99 for numbered groups, $<name> for named groups, $& for the entire match, $` and $' for the text before and after, and $$ for a literal dollar sign. The preview pane updates as you type so you can confirm substitutions before running them on a real file.
The Common Patterns shelf loads tested-but-not-bulletproof starting points. The email pattern accepts most addresses but is far simpler than the official RFC 5322 grammar (which is famously almost impossible to express as a regex); the URL pattern handles common HTTPS shapes but not edge cases like punycode or URL fragments. Treat the presets as scaffolding to adapt, not as production validators.
Nothing leaves your browser. The pattern, flags, test string, and replacement are stored in component state and are never serialized or sent over the network. You can disconnect from the internet and the tool keeps working — RegExp is built into every modern JavaScript runtime.