Skip to content

Instantly share code, notes, and snippets.

@tuldok89
Created January 23, 2025 08:05
Show Gist options
  • Save tuldok89/3fb59fd116bbae28ac2cb00e9f8b51a9 to your computer and use it in GitHub Desktop.
Save tuldok89/3fb59fd116bbae28ac2cb00e9f8b51a9 to your computer and use it in GitHub Desktop.
Regex Extractor for Google Sheets
function getField2(str, property) {
const regex = /\{(?:[^{}]|((?:\{[^{}]*\})))*\}/g;
const matches = str.match(regex);
const obj = JSON.parse(matches[0]);
return obj[property];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment