About this tool
Test and validate regular expressions instantly with live results.
The Regex Tester compiles your pattern with the browser's own new RegExp(pattern, flags) — the same ECMAScript engine your JavaScript runs on — and re-evaluates it on every keystroke. With the global flag on it walks the test string with repeated exec() calls, collecting each match's text, its zero-based start index and its numbered capture groups; with the flag off you get the first match only. An invalid pattern surfaces the browser's own SyntaxError message in a red alert instead of failing silently. Everything happens inside the page: your pattern and test text never leave the browser.
Open Regex Tester on AltFTool — it loads instantly in your browser.
Type or paste your expression into the Pattern field between the two slashes — the delimiters are part of the UI, so you don't escape them. Or click one of the eight Common Patterns to load it instantly.
Toggle the flags you need: g (find all matches), i (ignore case), m (^ and $ match at line breaks), s (dot matches newlines), u (Unicode).
Paste your sample text into Test String, then switch to the Result tab to see matches highlighted or scroll to Match Details for positions and groups. Use Copy report or Download JSON to save the output.
Patterns run through the same ECMAScript RegExp your JavaScript uses, so what matches here matches in your code — no PCRE or Python dialect surprises.
The Result tab highlights all matches inline in your test string, while Match Details lists each hit with its matched text, zero-based start position and numbered capture groups.
Email, URL, Phone (US), Hex Color, IPv4, Date (YYYY-MM-DD), Credit Card and HTML Tag load complete with the right flags already toggled on.
The tool is a client-side React component with no network calls; the JSON report is built in memory and saved as a local Blob download.
JavaScript (ECMAScript). Patterns are compiled with the browser's native new RegExp(), so lookahead, lookbehind, named groups and \d behave exactly as they will in your JS code. Perl/PCRE-only constructs such as \A, \z, possessive quantifiers and recursion will raise a syntax error, and Python's re or .NET syntax differs in places — test those in their own runtimes.
The global flag (g) is off. Without g the tester calls exec() once and reports only the first match; switch g on and it loops exec() across the whole string, collecting every match with its own start index. The big number above the Test String is the running match count.
g finds all matches instead of just the first; i makes the pattern case-insensitive; m makes ^ and $ match at every line break rather than only at the string boundaries; s (dotAll) lets . match newline characters; u enables full Unicode mode, including \u{...} escapes. Those five are the flags this tester exposes — the sticky (y) and indices (d) flags are not offered.
Yes — (?<name>...) compiles fine, but the Match Details panel lists groups by number, not by name. Group values come from match.slice(1), so a named group appears as [1], [2] and so on in the order it opens, and optional groups that didn't participate in the match are skipped rather than shown as undefined.
No. Compilation, matching, highlighting and report generation are all client-side JavaScript running in your tab, and the tool makes no API or upload calls. The download is created from an in-memory Blob saved as altftool-regex-report.json. It's free and requires no signup.
Four keys, pretty-printed with 2-space indentation: pattern (your expression as a string), flags (the enabled letters, e.g. "gi"), total (the match count) and matches — an array in which each entry has match (the matched text), index (zero-based start position) and groups (an array of captured values).
A zero-length match doesn't advance the search position on its own, so with the global flag on the tester manually moves one character ahead after any empty match before searching again — that's how it reports every position a pattern like a* matches (including the gaps between other characters) without ever getting stuck. If you only want matches with real content, require at least one character with + instead of *, or anchor the pattern.
Click Email or IPv4 in the Common Patterns column and the pattern loads with its flags applied. Eight presets ship with the tool — Email, URL, Phone (US), Hex Color, IPv4, Date (YYYY-MM-DD), Credit Card and HTML Tag — and each is an editable starting point, not a validation standard. The page opens with the email pattern and a sample sentence already filled in.