SmartQueryTools

Extract with Regex from JSON Files Online

Extract text matching a regular expression from JSON files directly in your browser. Pull out emails, URLs, phone numbers, or any pattern into a new column — no upload required.

How to extract with Regex from JSON files

  1. Drop your file onto the upload area. The first 200 rows are shown, and the first text column is selected for you.
  2. Pick the text column to search. Only text (VARCHAR) columns are listed, so a column the reader loaded as numbers or dates will not appear.
  3. Type a regular expression, such as [A-Z]+-\d+, and name the new column. The default name is extracted.
  4. Choose First match, or All matches to join every match in a cell with a comma and a space. Click Extract.
  5. Check the new column at the end of the preview, then download the result in the same format you uploaded.

Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.

Worked example

A release manager exports the commit log for a sprint and wants a list of the Jira issue keys each commit mentions, so the release notes can link to the tickets.

Input (JSON)

[
  {
    "commit": "a41f9c2",
    "author": "priya",
    "message": "PAY-212 fix rounding in invoice totals"
  },
  {
    "commit": "7be03d1",
    "author": "tom",
    "message": "Merge PAY-215 and WEB-88 hotfixes"
  },
  {
    "commit": "c9d2e47",
    "author": "priya",
    "message": "Bump lodash to 4.17.21"
  },
  {
    "commit": "e18a6b0",
    "author": "sam",
    "message": "web-91: tidy header spacing"
  }
]

Settings

  • Text column: message
  • Regex pattern: [A-Z]+-\d+
  • Output column name: issue_keys
  • Match mode: All matches (comma-separated)

Result

commitauthormessageissue_keys
a41f9c2priyaPAY-212 fix rounding in invoice totalsPAY-212
7be03d1tomMerge PAY-215 and WEB-88 hotfixesPAY-215, WEB-88
c9d2e47priyaBump lodash to 4.17.21NULL
e18a6b0samweb-91: tidy header spacingNULL

All original columns are kept and issue_keys is added at the end. The merge commit mentions two tickets, so both are joined with a comma and a space. The lodash bump has no match and gets NULL. So does web-91, because matching is case-sensitive and the pattern only allows capital letters. Start the pattern with (?i) to ignore case.

Working with JSON files

Each top-level key in the JSON array becomes a column, and only keys whose values are all strings are offered. A key that holds a number in some objects and a string in others is typed as raw JSON and is left out of the list. Cast it to VARCHAR first if you need to search it. Objects that do not have the key get NULL, and a NULL input always gives a NULL result. Escapes inside JSON strings, such as \n or \u00e9, are decoded before matching, so the pattern sees a real line break or é.

Nested objects load as struct columns and arrays as list columns, and neither can be searched directly. Flatten the file first so the nested text becomes its own key. The output is a JSON array with the new key added as the last field of every object. In All matches mode its value is one string, such as "PAY-215, WEB-88", not a JSON array of matches.

Frequently Asked Questions

Is the All matches result a JSON array?

No. It is a single string with the matches separated by a comma and a space. Run Split Column on the new key with ", " as the delimiter if you need the matches in separate fields.

Can I run a regex on a nested key such as user.bio?

Not directly. Flatten the JSON first so user.bio becomes a top-level column, then extract from it.

What happens when a cell has no match?

The new column holds NULL, in both First match and All matches mode. Cells that were already NULL stay NULL.

Can I extract only a capture group?

Yes. If the pattern has a capture group, the text inside the first group is returned. SKU-(\d+) returns 4471 from SKU-4471. Without parentheses the whole match is returned. Use (?:...) for grouping that should not capture.

Which regex syntax is supported?

RE2 syntax. Character classes, quantifiers, alternation, anchors and inline flags such as (?i) all work. Lookaheads, lookbehinds and backreferences are not supported and return an error. Matching is case-sensitive unless you add (?i).

Related Tools

Split Column in JSON Files Online

Split a column into multiple columns by delimiter in JSON files directly in your browser. Turn "First Last" into separate first and last name columns — no upload required.

Count Values in JSON Files Online

Group and count rows by any column in JSON files directly in your browser. Sort by frequency or value to find the most common entries — no upload required.

Filter JSON Files Online

Filter rows in JSON files by column value, directly in your browser. Your data stays on your device.

Extract with Regex from CSV Files Online

Extract text matching a regular expression from CSV files directly in your browser. Pull out emails, URLs, phone numbers, or any pattern into a new column — no upload required.

Extract with Regex from Excel Files Online

Extract text matching a regular expression from Excel files directly in your browser. Pull out emails, URLs, phone numbers, or any pattern into a new column — no upload required.

Extract with Regex from Parquet Files Online

Extract text matching a regular expression from Parquet files directly in your browser. Pull out emails, URLs, phone numbers, or any pattern into a new column — no upload required.

JSON Viewer Online

View and inspect JSON files directly in your browser. Browse rows, check column names and data types — no upload required, your data stays on your device.

Convert JSON to Parquet Online

Convert JSON files to Parquet format directly in your browser. No upload required — your data never leaves your device.