From: Woochanlee Date: Mon, 14 Mar 2022 10:02:09 +0000 (+0900) Subject: libaurum: Change text matching way to avoid use regex X-Git-Tag: submit/tizen/20220315.095203~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71e04d8327335e7d77f5b624ea7764cff6bc8e84;p=platform%2Fcore%2Fuifw%2Faurum.git libaurum: Change text matching way to avoid use regex regex can't search text which has '(' Change-Id: I7ca10cb75ba77753e0c0d215b91799d53d429cad --- diff --git a/libaurum/src/PartialMatch.cc b/libaurum/src/PartialMatch.cc index c1cd80a..54332b4 100644 --- a/libaurum/src/PartialMatch.cc +++ b/libaurum/src/PartialMatch.cc @@ -26,10 +26,18 @@ using namespace Aurum; bool PartialMatch::checkCriteria(const std::string textA, const std::string textB, const bool textPartialMatch) { - std::regex re(textA); + if (textB.empty()) return true; + bool rst; - if (textPartialMatch) rst = !(!!std::regex_search(textB, re) == true); - else rst = !(!!std::regex_match(textB, re) == true); + if (textPartialMatch) { + if (textB.find(textA) != std::string::npos) rst = false; + else rst = true; + } + else { + if (!textA.compare(textB)) rst = false; + else rst = true; + } + return rst; }