use regex instead of re
parent
ca4afca5da
commit
4ad1fc14a4
|
@ -64,8 +64,8 @@ def attempt_to_fix_json_by_finding_outermost_brackets(json_string):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Use regex to search for JSON objects
|
# Use regex to search for JSON objects
|
||||||
import re
|
import regex
|
||||||
json_pattern = re.compile(r"\{(?:[^{}]|(?R))*\}")
|
json_pattern = regex.compile(r"\{(?:[^{}]|(?R))*\}")
|
||||||
json_match = json_pattern.search(json_string)
|
json_match = json_pattern.search(json_string)
|
||||||
|
|
||||||
if json_match:
|
if json_match:
|
||||||
|
|
Loading…
Reference in New Issue