Switch/ext/ebtree/ebtree/common/regex.h
static inline int regex_exec(const struct my_regex *preg, char *subject) {
#if defined(USE_PCRE) || defined(USE_PCRE_JIT)
	if (pcre_exec(preg->reg, preg->extra, subject, strlen(subject), 0, 0, NULL, 0) < 0)
		return 0;
	return 1;
#else
	int match;
	match = regexec(&preg->regex, subject, 0, NULL, 0);
	if (match == REG_NOMATCH)
		return 0;
	return 1;
#endif
}
/* If the function doesn't match, it returns false, else it returns true.
 */
If the function doesn't match, it returns false, else it returns true.
If the function doesn ' t match it returns false else it returns true .
static inline int regex_exec(const struct my_regex *preg, char *subject) {
#if defined(USE_PCRE) || defined(USE_PCRE_JIT)
	if (pcre_exec(preg->reg, preg->extra, subject, strlen(subject), 0, 0, NULL, 0) < 0)
		return 0;
	return 1;
#else
	int match;
	match = regexec(&preg->regex, subject, 0, NULL, 0);
	if (match == REG_NOMATCH)
		return 0;
	return 1;
#endif
}
static inline int regex_exec ( const struct my_regex * preg , char * subject ) { #if defined ( USE_PCRE ) || defined ( USE_PCRE_JIT ) if ( pcre_exec ( preg -> reg , preg -> extra , subject , strlen ( subject ) , 0 , 0 , NULL , 0 ) < 0 ) return 0 ; return 1 ; #else int match ; match = regexec ( & preg -> regex , subject , 0 , NULL , 0 ) ; if ( match == REG_NOMATCH ) return 0 ; return 1 ; #endif }
If the function doesn't match, it returns false, else it returns true.
If the function doesn ' t match it returns false else it returns true .