regexp.c File Reference

Regular Expression functions. More...

#include <sys/types.h>
#include <string.h>
#include <regex.h>
#include <ctype.h>
#include "regexp.h"
#include "dprint.h"

Include dependency graph for regexp.c:

Go to the source code of this file.

Functions

int reg_match (char *pattern, char *string, regmatch_t *pmatch)
 Match pattern against string and store result in pmatch.
int reg_replace (char *pattern, char *replacement, char *string, str *result)
 Match pattern against string and, if match succeeds, and replace string with replacement substituting tokens \d with matched substrings.
int replace (regmatch_t *pmatch, char *string, char *replacement, str *result)
 Replace in replacement tokens \d with substrings of string pointed by pmatch.


Detailed Description

Regular Expression functions.

Definition in file regexp.c.


Function Documentation

int reg_match ( char *  pattern,
char *  string,
regmatch_t *  pmatch 
)

Match pattern against string and store result in pmatch.

Definition at line 86 of file regexp.c.

References MAX_MATCH.

Referenced by reg_replace().

int reg_replace ( char *  pattern,
char *  replacement,
char *  string,
str result 
)

Match pattern against string and, if match succeeds, and replace string with replacement substituting tokens \d with matched substrings.

Definition at line 109 of file regexp.c.

References LM_DBG, MAX_MATCH, reg_match(), and replace().

Referenced by do_query(), dp_can_connect_str(), enum_pv_query_3(), and is_from_user_enum_2().

int replace ( regmatch_t *  pmatch,
char *  string,
char *  replacement,
str result 
)

Replace in replacement tokens \d with substrings of string pointed by pmatch.

Definition at line 41 of file regexp.c.

References _str::len, len, and _str::s.

Referenced by reg_replace(), and replace_from().


Generated on Thu May 24 10:00:42 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6