MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / reg_replace

Function reg_replace

regexp.c:107–120  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

105 * with replacement substituting tokens \\d with matched substrings.
106 */
107int reg_replace(char *pattern, char *replacement, char *string, str *result)
108{
109 regmatch_t pmatch[MAX_MATCH];
110
111 LM_DBG("pattern: '%s', replacement: '%s', string: '%s'\n",
112 pattern, replacement, string);
113
114 if (reg_match(pattern, string, &(pmatch[0]))) {
115 return -1;
116 }
117
118 return replace(&pmatch[0], string, replacement, result);
119
120}

Callers 10

get_event_headerFunction · 0.85
found_CBNFunction · 0.85
treat_parse_esrResponseFunction · 0.85
get_lro_in_contactFunction · 0.85
get_esqk_in_contactFunction · 0.85
dp_can_connect_strFunction · 0.85
is_from_user_enumFunction · 0.85
do_queryFunction · 0.85

Calls 2

reg_matchFunction · 0.85
replaceFunction · 0.85

Tested by

no test coverage detected