JSON Formatter
Format, minify and validate JSON with clear error positions.
Test a regular expression against your text and see every match, group and replacement.
Matches are highlighted here.Enter a pattern and some text.
Your files stay on your device
Everything runs in your browser. What you paste is never sent to a server. Test data such as logs or customer lists stays on your device.
JavaScript, as built into your browser. Most syntax matches other languages, but lookbehind, named groups and \p classes differ between flavours, so check the one you will ship with.
The test runs in a separate worker. If it takes more than 1.5 seconds, it is stopped and you get a message. Patterns with nested repeats such as (a+)+$ are the usual cause.
Each match in the list shows numbered groups, and named groups written as (?<name>...) by their name.
Patterns such as a* can match zero characters. Those matches are listed as empty and the search moves one character on so it never loops.
Use $1 for the first group, $<name> for a named group, $& for the whole match and $$ for a literal dollar sign.