+/*********************************************************************
+ *
+ * Function : regex_matches
+ *
+ * Description : Checks if a compiled regex pattern matches a string
+ * using either pcre2 or pcre1 code.
+ *
+ * Parameters :
+ * 1 : pattern = The compiled pattern
+ * 2 : string = The string to check
+ *
+ * Returns : TRUE for yes, FALSE otherwise.
+ *
+ *********************************************************************/
+int regex_matches(const REGEX_TYPE *pattern, const char *string)
+{
+#ifdef HAVE_PCRE2
+ return pcre2_pattern_matches(pattern, string);
+#else
+ return (0 == regexec(pattern, string, 0, NULL, 0));
+#endif
+}
+