给show添加了限制

This commit is contained in:
2023-12-14 07:18:41 +00:00
parent 21793ba0e6
commit f0f524dde1

View File

@ -212,7 +212,7 @@ bool CommandShowLexer(const std::string &command, std::string &ISBN,
std::string &name, std::string &author,
std::string &keyword) {
static std::basic_regex main_pattern(
R"(^ *show(?: +-ISBN=(?:\S{1,20})| +-name=\"(?:[^\s"]{1,60})\"| +-author=\"(?:[^\s"]{1,60})\"| +-keyword=\"(?:[^\s"]{1,60})\")* *$)",
R"(^ *show(?: +-ISBN=(?:\S{1,20})| +-name=\"(?:[^\s"]{1,60})\"| +-author=\"(?:[^\s"]{1,60})\"| +-keyword=\"(?:[^\s"]{1,60})\")? *$)",
std::regex_constants::optimize);
bool has_ISBN = false;