This page runs a JavaScript regular expression against sample text and lists every match with its position and capture groups. Type the pattern without surrounding slashes, tick the flags you need, and paste or load the text to search. Results update as you type, and an invalid pattern is reported rather than silently ignored.
It uses the browser's own RegExp engine. That is the same engine that will run the expression in a web page, so a pattern that works here will behave the same in Chrome, Firefox or Safari, subject to their support for newer syntax. It is not a PCRE, Python or Java tester, and patterns written for those engines may not compile.
Pattern and flags
The pattern field takes the expression only. Writing /\bword\b/g with the slashes and the flag will be treated as a literal slash, a word boundary, and so on, which is not what most people intend. Enter \bword\b and choose the flags from the checkboxes.
Global matching is always on. The g box is ticked and fixed, because the page is built to find every match; unchecking it could not change the result, so it is disabled rather than left looking adjustable. The other four flags work as selected. i ignores case, m makes ^ and $ match at line boundaries, s lets . match a newline, and u enables Unicode mode, which is required for property escapes such as \p{Emoji} and for correct handling of astral characters.
There is no y (sticky) checkbox and no d (indices) checkbox. If you need those, test in the browser console instead. The pattern is limited to 500 characters, and a longer one is refused with a warning rather than attempted.
Reading the match table
Each row shows a one-based match number, a zero-based index, the matched text and any capture groups. Numbered groups appear in order, and named groups appear as their captured values. The index is a JavaScript string index, so it counts UTF-16 code units: a match after an emoji can have an index two higher than the visible character count suggests.
The matched text is shown in quotes so leading and trailing spaces are visible. A zero-length match is shown as "" in the table. In the highlighted preview it is drawn as a thin amber caret rather than a character, so the text you pasted is not altered by a marker that was never in it.
The page records a zero-length match and then advances one character before searching again. In Unicode mode it advances a whole code point instead, so an emoji is not split and the same position cannot match twice. Without that rule, an empty pattern with u on could repeat the position inside an emoji until the list cap. That was a real bug, and it now returns 4 positions for a😀b instead of 1,000.
The list stops at 1,000 matches. If a 1,001st match exists, the status says the list was capped and the count carries a plus sign. Exactly 1,000 matches is reported as complete, because nothing was cut. The table shows the first 50 rows and says so; all matches are in the copied list and the download.
A worked example
The default pattern \b[A-Z][a-z]+\b against the two-sentence sample found 8 capitalised words: Ada, Lovelace, Analytical, Engine, Charles, Babbage, Grace and Hopper. The positions ran from 0 to 86, and the pattern length was 15.
| Pattern | Flags | Result |
|---|---|---|
\b[A-Z][a-z]+\b | g | 8 matches |
(?<year>\d{4})-(?<month>\d{2}) | g | 2 matches, year and month captured |
\p{Emoji} | gu | 2 matches, both emoji |
^ | gm | 3 zero-length matches |
a over 1,001 characters | g | 1,000 matches, list capped |
The named-group run found 2026-11 and 2025-01, with the year and month shown as separate captures. That is the quickest way to check that a date pattern groups the parts you expect before using it in code.
The Unicode run matched the two emoji in ok 👍 done 🚀 only when u was ticked. Without it, a property escape is a syntax error. The zero-length run produced three empty matches, one at the start of each line, and the page's advance rule kept the loop finite. A run of exactly 1,000 a characters reported 1,000 matches without a cap; adding one more character produced the capped result in the table.
Invalid patterns and slow patterns
An unclosed group, an unmatched bracket, a trailing backslash or a quantifier with nothing to repeat produces a syntax error with the engine's message. The page names the problem and does not attempt a repair. A group name that is not a valid identifier is another common cause.
Catastrophic backtracking is a real risk with nested quantifiers on long input. A pattern such as (a+)+$ against a long run of a followed by one other character can take exponential time and freeze the tab. The page warns about this in its note, but it cannot detect every dangerous pattern. If the page stops responding, close the tab; there is no timeout.
The 500-character pattern cap and the 1,000-match list cap are the only hard limits. The text itself has no stated length limit, though a very large paste will be slower to scan. Uploaded files are read as text and capped at 5 MB by the shared file reader.
JavaScript syntax, not PCRE
Lookbehind, named groups and Unicode property escapes are supported in current browsers, and the tests confirmed all three. Older engines may reject lookbehind or named groups. If the pattern must run in an old browser or a server-side language, test it in the target environment rather than assuming this result carries over.
PCRE features such as \A, \z, possessive quantifiers and recursion are not part of JavaScript. Python's (?P<name>.) group syntax is also different from JavaScript's (?<name>.). A pattern copied from another language often needs rewriting, not just flag changes.
For a broader syntax test or an explanation of each token, a dedicated multi-engine tester is the better tool. This page is for confirming that a JavaScript pattern matches the text you expect, with the exact engine your users will run. The Markdown to HTML converter and the JSON formatter are unrelated but often used in the same documentation workflow.