... | ... |
@@ -42,6 +42,7 @@ Daniel-Constantin Mierla |
42 | 42 |
4.10. pos_rfind_str(idx, val) |
43 | 43 |
4.11. pos_rfindi_str(idx, val) |
44 | 44 |
4.12. pos_search(idx, re) |
45 |
+ 4.13. pos_rsearch(idx, re) |
|
45 | 46 |
|
46 | 47 |
5. Pseudo Variables |
47 | 48 |
|
... | ... |
@@ -60,6 +61,7 @@ Daniel-Constantin Mierla |
60 | 61 |
1.11. pos_find_str() usage |
61 | 62 |
1.12. pos_rfindi_str() usage |
62 | 63 |
1.13. pos_search() usage |
64 |
+ 1.14. pos_rsearch() usage |
|
63 | 65 |
|
64 | 66 |
Chapter 1. Admin Guide |
65 | 67 |
|
... | ... |
@@ -89,6 +91,7 @@ Chapter 1. Admin Guide |
89 | 91 |
4.10. pos_rfind_str(idx, val) |
90 | 92 |
4.11. pos_rfindi_str(idx, val) |
91 | 93 |
4.12. pos_search(idx, re) |
94 |
+ 4.13. pos_rsearch(idx, re) |
|
92 | 95 |
|
93 | 96 |
5. Pseudo Variables |
94 | 97 |
|
... | ... |
@@ -148,6 +151,7 @@ modparam("posops", "idx0", -200) |
148 | 151 |
4.10. pos_rfind_str(idx, val) |
149 | 152 |
4.11. pos_rfindi_str(idx, val) |
150 | 153 |
4.12. pos_search(idx, re) |
154 |
+ 4.13. pos_rsearch(idx, re) |
|
151 | 155 |
|
152 | 156 |
4.1. pos_append(idx, val) |
153 | 157 |
|
... | ... |
@@ -345,6 +349,26 @@ $var(idx) = pos_rfindi_str("100", "kamailio"); |
345 | 349 |
$var(idx) = pos_search("100", "[0-9]+"); |
346 | 350 |
... |
347 | 351 |
|
352 |
+4.13. pos_rsearch(idx, re) |
|
353 |
+ |
|
354 |
+ Return the position of last match that starts matching the regular |
|
355 |
+ expression re in message buffer starting at idx. In case of not finding |
|
356 |
+ it or error, the return code is negative. If val is at index 0, it |
|
357 |
+ returns the value specified by modparam idx0. |
|
358 |
+ |
|
359 |
+ The idx can be an integer value or a variable holding an integer. If |
|
360 |
+ the value is negative, the position is counted from the end of the |
|
361 |
+ buffer. |
|
362 |
+ |
|
363 |
+ The re can be a static regular expression string. |
|
364 |
+ |
|
365 |
+ This function can be used from ANY_ROUTE. |
|
366 |
+ |
|
367 |
+ Example 1.14. pos_rsearch() usage |
|
368 |
+... |
|
369 |
+$var(idx) = pos_rsearch("100", "[0-9]+"); |
|
370 |
+... |
|
371 |
+ |
|
348 | 372 |
5. Pseudo Variables |
349 | 373 |
|
350 | 374 |
The module exports a pseudo-variable class, $pos(key), to access |