From a5478ec4cc88c2af77a9ec2f4d53a87bd9855cd0 Mon Sep 17 00:00:00 2001 From: Nathan Price Date: Fri, 1 Mar 2024 15:58:36 -0500 Subject: [PATCH] fix regex --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 72f6b7b..68b1385 100644 --- a/src/main.ts +++ b/src/main.ts @@ -117,7 +117,7 @@ export default class AutoClassifierPlugin extends Plugin { // ------- [API Processing] ------- // Call API const responseRaw = await ChatGPT.callAPI(system_role, user_prompt, this.settings.apiKey); - const jsonRegex = /reliability.*\s*:\s*([\d.]+).*output.*\s*:\s*"?([^"^}]+)/; + const jsonRegex = /reliability[\s\S]*?:\s*([\d.]+)[\s\S]*?output[\s\S]*?:\s*"([^"^}]+)/; const match = responseRaw.match(jsonRegex); let resOutput; let resReliabity;