Regex Tester
Try a regular expression against sample text, with JavaScript’s own RegExp engine. See match positions, capture groups and a replacement preview. This is not PCRE, .NET or Python regex.
Pattern, flags and test text
Limits
- The input is limited to 2 MB of UTF-8 text (8 MB if you load a file). Larger files can run out of memory in a phone browser tab.
- The engine is JavaScript RegExp, not PCRE, POSIX, .NET or Python.
- At most 10,000 matches are listed. Very slow patterns may freeze this tab; there is no separate timeout worker.
- Flags are g, i, m, s, u, v and y only. u and v cannot be combined.
- Replacement uses JavaScript rules ($1, $&, $`, $’). It does not use Perl’s /e or similar.
Matches and replacement
| # | Index | Match | Groups |
|---|
How to use Regex Tester
- Write the patternEnter a JavaScript regular expression and the flags you need (g, i, m, s, u, v, y).
- Paste the test textMatches are highlighted and listed with their groups.
- Optional replacePreview a replacement string. $1 and $& work as in JavaScript.
JavaScript regex only
The pattern is compiled with new RegExp and run in this tab. Syntax, flags and Unicode handling are exactly what your browser implements. Look-behind, named groups and the v flag depend on the browser.
PCRE features such as possessive quantifiers, recursion, or (?i) inline flags are not supported. A badly written pattern can be slow (catastrophic backtracking). Keep the test text within the size limit and avoid heavily nested quantifiers on large inputs.
Frequently asked questions
Is my text or file uploaded?
No. Everything runs in your browser tab with JavaScript. Nothing you type, paste or drop is sent to a server, logged or stored by ALink Tools.
Why does this not match what regex101 or a server shows?
Those tools often default to PCRE or another flavor. This page is deliberately JavaScript-only, which is what your front-end code will do.
Do I need slashes around the pattern?
No. Type the pattern only, and set flags in the flag boxes. Slashes would be treated as literal characters.
Can a regex lock up my browser?
A pathological pattern on a long string can. Stay within the 2 MB limit and test incrementally if a pattern uses nested repetition such as (a+)+.
Related tools
All toolsText Diff Checker
Compare two texts and highlight added, removed and changed lines and words.
Case Converter
UPPERCASE, lowercase, Title Case, Sentence case, camelCase, snake_case and more.
Word & Character Counter
Instant word, character, sentence, reading time, and keyword counts.
JSON Formatter & Validator
Format, minify, sort keys, and catch syntax errors cleanly.