From a4c544e916ed9d9519adedeb53d2f023e53aa360 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Fri, 17 Oct 2014 21:52:23 +0200 Subject: [PATCH] [DEV] update regex special char properties --- exml/Text.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/exml/Text.cpp b/exml/Text.cpp index 900978a..5aaaafa 100644 --- a/exml/Text.cpp +++ b/exml/Text.cpp @@ -29,11 +29,11 @@ static std::string replaceSpecialChar(const std::string& _inval) { static std::regex regexQUOT("""); static std::regex regexAMP("&"); - out = std::regex_replace(_inval, regexLT, "<"); - out = std::regex_replace(out, regexGT, ">"); - out = std::regex_replace(out, regexAPOS, "'"); - out = std::regex_replace(out, regexQUOT, "\""); - out = std::regex_replace(out, regexAMP, "&"); + out = std::regex_replace(_inval, regexLT, std::string("<")); + out = std::regex_replace(out, regexGT, std::string(">")); + out = std::regex_replace(out, regexAPOS, std::string("'")); + out = std::regex_replace(out, regexQUOT, std::string("\"")); + out = std::regex_replace(out, regexAMP, std::string("&")); //EXML_ERROR("plop "<< _inval << " => " << out); return out; } @@ -45,11 +45,11 @@ static std::string replaceSpecialCharOut(const std::string& _inval) { static std::regex regexAPOS("'"); static std::regex regexQUOT("\""); - out = std::regex_replace(_inval, regexAMP, "&"); - out = std::regex_replace(out, regexQUOT, """); - out = std::regex_replace(out, regexAPOS, "'"); - out = std::regex_replace(out, regexGT, ">"); - out = std::regex_replace(out, regexLT, "<"); + out = std::regex_replace(_inval, regexAMP, std::string("&")); + out = std::regex_replace(out, regexQUOT, std::string(""")); + out = std::regex_replace(out, regexAPOS, std::string("'")); + out = std::regex_replace(out, regexGT, std::string(">")); + out = std::regex_replace(out, regexLT, std::string("<")); return out; }