mirror of
https://github.com/ntop/n2n.git
synced 2024-09-20 00:51:10 +02:00
adopted re_match for the sake of completeness, too
This commit is contained in:
parent
f7e50e12c0
commit
099f178d0e
|
@ -91,7 +91,14 @@ static int ismetachar(char c);
|
||||||
/* Public functions: */
|
/* Public functions: */
|
||||||
int re_match(const char* pattern, const char* text, int* matchlength)
|
int re_match(const char* pattern, const char* text, int* matchlength)
|
||||||
{
|
{
|
||||||
return re_matchp(re_compile(pattern), text, matchlength);
|
re_t re_p; /* pointer to (to be created) copy of compiled regex */
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
|
re_p = re_compile (pattern);
|
||||||
|
ret = re_matchp(re_p, text, matchlength);
|
||||||
|
free(re_p);
|
||||||
|
|
||||||
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
int re_matchp(re_t pattern, const char* text, int* matchlength)
|
int re_matchp(re_t pattern, const char* text, int* matchlength)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user