You've been there. You ask GPT to "return a JSON object with the user's name, email, and sentiment score." It returns a perfectly formatted JSON... wrapped in a markdown code block. With a helpful explanation. And a disclaimer about how it's an AI.
So you write a regex to strip the code fences. Then another regex for the trailing commentary. Then...
🛡️ VERIFIED CYBER INTELLIGENCE ID: #3256128