csvjson

Regex Tester

Test regular expressions live with match highlighting, capture groups, named groups, all JS flags, and a replace mode.

🔧

Regex Tester is coming soon. In the meantime, try the JSON → CSV converter, which has flattening built in.

How it works

Live match highlighting

As you type the pattern, all matches are highlighted in real time using different colors. Each match is numbered and expandable in the details panel below, showing the full match value, index, and all capture groups.

Replace mode with backreferences

Toggle replace mode to test substitutions. Use $1, $2 for numbered groups and $<name> for named groups in the replacement string — the same syntax as JavaScript's String.replace().

Example

Extracting all email addresses from a block of text

Input
Contact us at hello@example.com or support@csvjson.tools
Output
Match 1: hello@example.com @index 14
Match 2: support@csvjson.tools @index 38

The global (g) flag is required to find all matches. Without it, only the first match is returned.

Frequently asked questions

Which regex flavor does this use?

JavaScript's built-in RegExp. JavaScript regex is close to PCRE but has some differences: no possessive quantifiers, no atomic groups, no \K. Named groups use (?<name>) syntax. Lookbehind assertions require a modern browser (ES2018+).

What are capture groups?

Parentheses in a regex create capture groups. The text matched by each group is extracted separately. /(\d{4})-(\d{2})-(\d{2})/ on '2024-01-15' gives groups: ['2024', '01', '15']. Named groups (?<year>\d{4}) give match.groups.year.