10int main(
int argc,
char **argv )
19 n_log(
LOG_ERR,
"Not enough args\nUsage:\n %s \"regexp\" \"string\"", argv[ 0 ] );
26 if( pcre -> captured > 1 )
30 while( pcre -> match_list[ it ] )
32 n_log(
LOG_INFO,
"Match[%d]:%s", it, pcre -> match_list[ it ] );
#define n_log(__LEVEL__,...)
Logging function wrapper to get line and func.
#define LOG_DEBUG
debug-level messages
#define LOG_ERR
error conditions
#define LOG_STDERR
internal, default LOG_TYPE
void set_log_level(const int log_level)
Set the global log level value ( static int LOG_LEVEL )
#define LOG_INFO
informational
N_PCRE * npcre_new(char *str, int max_cap, int flags)
From pcre doc, the flag bits are: PCRE_ANCHORED Force pattern anchoring PCRE_AUTO_CALLOUT Compile aut...
int npcre_match(char *str, N_PCRE *pcre)
Return TRUE if str matches regexp, and make captures up to max_cap.
int npcre_delete(N_PCRE **pcre)
Free a N_PCRE pointer.
PCRE helpers for regex matching.