1 #include <ctype.h> 2 #include <limits.h> 3 #include "xpl_Regex.h" 4 5 6 #ifdef __cplusplus 7 extern "C" { 8 #endif 9 10 BOOLEAN XPL_RG_Comp(CPCHAR pattern, CPCHAR str) 11 { 12 int status; 13 regex_t re; 14 15 status = regcomp(&re, pattern, REG_EXTENDED|REG_NOSUB); 16 if ( status == 0 ) 17 { 18 status = regexec(&re, str, (size_t) 0, XPL_NULL, 0); 19 } 20 regfree(&re); 21 if ( status != 0 ) 22 return FALSE; 23 else 24 return TRUE; 25 } 26 27 28 #ifdef __cplusplus 29 } 30 #endif 31 32