merge with master
[framework/web/wrt-plugins-common.git] / src / Commons / RegexUtils.cpp
index 1d0494a..db749e7 100644 (file)
@@ -19,7 +19,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 std::string addStartPositionMark(const std::string &value)
 {
     if (!String::startsWith(value, "^") && !String::startsWith(value, ".*")) {
@@ -31,7 +30,8 @@ std::string addStartPositionMark(const std::string &value)
 std::string addEndPositionMark(const std::string &value)
 {
     if ((!String::endsWith(value, "$") || String::endsWith(value, "\\$")) &&
-        !String::endsWith(value, ".*")) {
+        !String::endsWith(value, ".*"))
+    {
         return value + "$";
     }
     return value;
@@ -65,10 +65,10 @@ std::string escape(const std::string& str)
     // Escape standard regular expressions' metacharacters,
     // i.e.: \, ., -, +, ?, (, ), [, ], ^, $, |
     const char* metas = "(\\.|\\-|\\+|\\?|\\(|\\)|\\[|\\]|\\^|\\$|\\|"
-        "|(\\\\[^\\*\\%]|\\\\$))";                        // \*, \% won't get additional '\'
+                        "|(\\\\[^\\*\\%]|\\\\$))";        // \*, \% won't get
+                                                          // additional '\'
     pcrecpp::RE(metas).GlobalReplace("\\\\\\1", &result);
     return result;
 }
-
 }
 } // WrtDeviceApisCommon