git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6588
d0543943-73ff-0310-b7d9-
9358b9ac24b2
ovector, /* vector of integers for substring information */
olen); /* number of elements (NOT size in bytes) */
+
if (match_count <= 0) {
switch_regex_safe_free(re);
match_count = 0;
}
index[z++] = '\0';
z = 0;
- num = atoi(index);
+ if (match_count > 1) {
+ int offset = match_count - 2;
+ num = atoi(index) + offset;
+ } else {
+ num = atoi(index);
+ }
if (pcre_copy_substring(field_data, ovector, match_count, num, replace, sizeof(replace)) > 0) {
switch_size_t r;