mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 04:11:06 -05:00
Cleanup
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
#include "text-helpers.hpp"
|
||||
|
||||
#include <regex>
|
||||
#include <QRegularExpression>
|
||||
|
||||
namespace advss {
|
||||
|
||||
QString EscapeForRegex(const QString &s)
|
||||
QString EscapeForRegex(const QString &input)
|
||||
{
|
||||
static std::regex specialChars{R"([-[\]{}()*+?.,\^$|#\s])"};
|
||||
std::string input = s.toStdString();
|
||||
return QString::fromStdString(
|
||||
std::regex_replace(input, specialChars, R"(\$&)"));
|
||||
return QRegularExpression::escape(input);
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
||||
Reference in New Issue
Block a user