bryancall commented on code in PR #12574:
URL: https://github.com/apache/trafficserver/pull/12574#discussion_r2449244885


##########
plugins/regex_revalidate/regex_revalidate.cc:
##########
@@ -296,43 +286,46 @@ load_state(plugin_state_t *pstate, invalidate_t **ilist)
 
   time_t const now = time(nullptr);
 
-  const char *errptr;
-  int         erroffset;
-  int         ovector[OVECTOR_SIZE];
-  pcre *const config_re = 
pcre_compile("^([^#].+?)\\s+(\\d+)\\s+(\\d+)\\s+(\\w+)\\s*$", 0, &errptr, 
&erroffset, nullptr);
-  TSReleaseAssert(nullptr != config_re);
+  Regex      config_re;
+  bool const re_stat = 
config_re.compile("^([^#].+?)\\s+(\\d+)\\s+(\\d+)\\s+(\\w+)\\s*$");
+  TSReleaseAssert(true == re_stat);
 
   char line[LINE_MAX];
   int  ln = 0;
   while (fgets(line, LINE_MAX, fs) != nullptr) {
     Dbg(dbg_ctl, "state: processing: %d %s", ln, line);
     ++ln;
-    int const rc = pcre_exec(config_re, nullptr, line, strlen(line), 0, 0, 
ovector, OVECTOR_SIZE);
+
+    RegexMatches matches;
+    int const    rc = config_re.exec(line, matches, 0);

Review Comment:
   There is a method that doesn't require a flag and the default is 0.  You can 
remove passing the flag.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to