TextArray
100% local

Regex tester

Test a regular expression against your text and see every match and capture group.

Input
Output

Regex tester

Type a regular expression, paste the text you want to try it on, and the matches appear as you type. Every match gets its own block: the line and column it starts on, its position in the string, the matched text itself, and the value of each capture group, numbered the way a replacement refers to them as $1 and $2. Named groups are labelled with the name you gave them, and a group that took no part in the match says so instead of quietly showing nothing.

Switch the mode to "Replace matches" to see what the pattern would actually do to the text. The replacement field uses the same syntax as JavaScript's String.replace, so $1 inserts the first group, $<name> a named one and $& the whole match. It is the quickest way to check a bulk rename across a log file or a CSV export before running it for real.

The five flags are plain checkboxes. Global, on by default, finds every match rather than stopping at the first — turn it off and only the first match is listed, or in replace mode only the first is replaced. Ignore case makes Cat match cat. Multiline points ^ and $ at the start and end of each line instead of the whole text. Dot matches line breaks lets a period cross a newline. Unicode enables property escapes such as \p{L} and matches by code point, which you need for emoji and non-Latin scripts.

Two limits keep the tab responsive: a pattern over 500 characters is refused, and the scan stops after 10,000 matches, which the tally tells you about. Your pattern and your text stay on your device — nothing is uploaded, so production logs and customer records are safe to test against.

FAQ

Which flags can I use?
g, i, m, s and u, each as a checkbox. Global is on by default; the rest are off. Flags like y (sticky) and d (indices) are not exposed, because a tester that lists all matches from the start has no use for them.
How do I preview a replacement?
Set the mode to "Replace matches" and fill in the replacement field. It accepts $1 and $2 for numbered groups, $<name> for named ones and $& for the whole match — the same syntax JavaScript uses.
Why do the column numbers differ from my editor?
Positions are counted in JavaScript string offsets, so a character outside the basic plane — most emoji — counts as two. The index shown is exactly what match.index returns in code, which is what you want when debugging a pattern.
What happens with a very large number of matches?
The scan stops after 10,000 matches and the tally shows a plus sign along with a note. In replace mode the whole text is still replaced; only the counting stops. A pattern that backtracks badly can still be slow, since the browser does the matching and a single attempt cannot be interrupted.
Is my text uploaded anywhere?
No. The pattern and the text are matched entirely in your browser and never leave your device. Your last pattern is kept in local storage on this device only, so it is still there when you come back.