Checks if a string contains valid JSON and optionally parses it.
Uses a regex pre-check to quickly eliminate non-JSON strings before attempting
to parse. Returns both a boolean flag and the parsed result if successful.
Type Parameters
T = unknown
The expected type of the parsed JSON (default: unknown)
Checks if a string contains valid JSON and optionally parses it.
Uses a regex pre-check to quickly eliminate non-JSON strings before attempting to parse. Returns both a boolean flag and the parsed result if successful.