Skip to main content

first_json_block

Function first_json_block 

Source
pub fn first_json_block(text: &str) -> Option<&str>
Expand description

Return the first balanced JSON object or array embedded in text.

String-aware: braces and brackets inside JSON string literals are ignored. Nesting is validated with a stack, so mismatched delimiters such as {...] yield None instead of a truncated slice.