From 3a58ca1f6f94fc8bddb396d74c107f7dc54dcf57 Mon Sep 17 00:00:00 2001 From: silverqx Date: Mon, 9 Sep 2024 15:40:28 +0200 Subject: [PATCH] tom updated RegEx for complete connection names For pwsh. --- tom/src/tom/commands/completecommand.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tom/src/tom/commands/completecommand.cpp b/tom/src/tom/commands/completecommand.cpp index a178ccaaf..777f96573 100644 --- a/tom/src/tom/commands/completecommand.cpp +++ b/tom/src/tom/commands/completecommand.cpp @@ -731,7 +731,8 @@ QStringList CompleteCommand::getConnectionNamesFromFile() std::string line; line.reserve(256); - static const QRegularExpression regex(uR"T("(\w+)".*// shell:connection$)T"_s); + static const QRegularExpression + regex(uR"T("(?[\w\.-]+)".*// shell:connection$)T"_s); // No need to care about \r\n at the end while (getline(mainFileStream, line)) @@ -739,7 +740,7 @@ QStringList CompleteCommand::getConnectionNamesFromFile() if (const auto match = regex.match(QString::fromStdString(line)); match.hasMatch() ) - connectionNames << match.captured(1); + connectionNames << match.captured(u"connection"_s); mainFileStream.close();