regex: modernize and simplify code

Change-Id: Ia4a3046d409ab1e5d8507da4d369dfee203f6256
diff --git a/src/security/v2/validator-config/checker.cpp b/src/security/v2/validator-config/checker.cpp
index fdff8d2..dc4d49a 100644
--- a/src/security/v2/validator-config/checker.cpp
+++ b/src/security/v2/validator-config/checker.cpp
@@ -258,7 +258,7 @@
     }
 
     try {
-      return make_unique<RegexChecker>(regexString);
+      return make_unique<RegexChecker>(Regex(regexString));
     }
     catch (const Regex::Error& e) {
       BOOST_THROW_EXCEPTION(Error("Invalid checker.key-locator.regex: " + regexString));