From 583db1f1274a9c0c46ecbf9009cdde109312ecb0 Mon Sep 17 00:00:00 2001 From: ZhuangYumin Date: Thu, 14 Dec 2023 07:25:58 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B6=85=E8=BF=87=E4=B8=A4?= =?UTF-8?q?=E4=BD=8D=E5=B0=8F=E6=95=B0=E7=9A=84=E8=BE=93=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/lexer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/lexer.cpp b/backend/src/lexer.cpp index 8980500..3950bc7 100644 --- a/backend/src/lexer.cpp +++ b/backend/src/lexer.cpp @@ -337,7 +337,7 @@ bool CommandModifyLexer(const std::string &command, std::string &ISBN, std::string &name, std::string &author, std::string &keyword, double &price) { static std::basic_regex main_pattern( - R"(^ *modify(?: +-ISBN=(?:\S{1,20})| +-name=\"(?:[^\s"]{1,60})\"| +-author=\"(?:[^\s"]{1,60})\"| +-keyword=\"(?:[^\s"]{1,60})\"| +-price=[0-9]{1,10}(?:\.[0-9]{1,2})?)+ *$)", + R"(^ *modify(?: +-ISBN=(?:\S{1,20})| +-name=\"(?:[^\s"]{1,60})\"| +-author=\"(?:[^\s"]{1,60})\"| +-keyword=\"(?:[^\s"]{1,60})\"| +-price=[0-9]{1,10}(?:\.[0-9]+)?)+ *$)", std::regex_constants::optimize); if (std::regex_match(command, main_pattern)) { std::stringstream ss(command); @@ -385,7 +385,7 @@ bool CommandModifyLexer(const std::string &command, std::string &ISBN, bool CommandImportLexer(const std::string &command, int &quantity, double &total_cost) { static std::basic_regex main_pattern( - R"(^ *import +[0-9]{1,10} +[0-9]{1,10}(?:\.[0-9]{1,2})? *$)", + R"(^ *import +[0-9]{1,10} +[0-9]{1,10}(?:\.[0-9]+)? *$)", std::regex_constants::optimize); if (std::regex_match(command, main_pattern)) { std::stringstream ss(command);