From be366ff6c5ab2a58186a9423feb9595cf41885e9 Mon Sep 17 00:00:00 2001 From: adldotori Date: Wed, 5 Apr 2023 18:40:10 +0900 Subject: [PATCH] fix: regex --- core/tools/editor/__init__.py | 4 ++-- core/tools/editor/patch.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/tools/editor/__init__.py b/core/tools/editor/__init__.py index c572ff1..fa7cd8f 100644 --- a/core/tools/editor/__init__.py +++ b/core/tools/editor/__init__.py @@ -63,7 +63,7 @@ class CodeEditor(BaseToolSet): output = ( "Last 3 line was:\n" + "\n".join(code.split("\n")[-3:]) - + "\nYou can use CodeEditor.APPEND tool to append the code if it is not completed." + + "\nYou can use CodeEditor.APPEND tool to append the code if this file is not completed." ) except Exception as e: output = str(e) @@ -88,7 +88,7 @@ class CodeEditor(BaseToolSet): output = ( "Last 3 line was:\n" + "\n".join(code.split("\n")[-3:]) - + "\nYou can use CodeEditor.APPEND tool to append the code if it is not completed." + + "\nYou can use CodeEditor.APPEND tool to append the code if this file is not completed." ) except Exception as e: output = str(e) diff --git a/core/tools/editor/patch.py b/core/tools/editor/patch.py index a25eb74..66a8165 100644 --- a/core/tools/editor/patch.py +++ b/core/tools/editor/patch.py @@ -127,7 +127,7 @@ class PatchCommand: @staticmethod def from_str(command: str) -> "PatchCommand": match = re.search( - r"(.*)\|([0-9])*,([0-9])*\|([0-9]*),([0-9]*)(\||\n)(.*)", + r"(.*)\|([0-9]*),([0-9]*)\|([0-9]*),([0-9]*)(\||\n)(.*)", command, re.DOTALL, )