add device_button without regex

This commit is contained in:
sunsets
2024-02-23 13:53:30 +08:00
parent 7c6e614b3b
commit 82f75eb146

View File

@@ -2135,9 +2135,10 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
auto * printer = preset_bundle.physical_printers.find_printer(tem_name);
if (printer != nullptr) {
wxString host = (printer->config.opt_string("print_host"));
std::regex ipRegex(R"(\b(?:\d{1,3}\.){3}\d{1,3}\b)");
bool isValidIPAddress = std::regex_match(host.ToStdString(), ipRegex);
//B45
//std::regex ipRegex(R"(\b(?:\d{1,3}\.){3}\d{1,3}\b)");
//bool isValidIPAddress = std::regex_match(host.ToStdString(), ipRegex);
bool isValidIPAddress = true;
DynamicPrintConfig *cfg_t = &(printer->config);
wxStringTokenizer tokenizer3((data->lower_name), wxT("*"), wxTOKEN_RET_EMPTY_ALL);