MCPcopy Index your code
hub / github.com/going-doer/Paper2Code / extract_json_from_string

Function extract_json_from_string

codes/utils.py:425–434  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

423
424
425def extract_json_from_string(text):
426 # Extract content inside ```yaml\n...\n```
427 match = re.search(r"```json\n(.*?)\n```", text, re.DOTALL)
428
429 if match:
430 yaml_content = match.group(1)
431 return yaml_content
432 else:
433 print("No JSON content found.")
434 return ""
435
436
437def get_now_str():

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected