1PCRE_GET_SUBSTRING(3) Library Functions Manual PCRE_GET_SUBSTRING(3)
2
3
4
6 PCRE - Perl-compatible regular expressions
7
9
10 #include <pcre.h>
11
12 int pcre_get_substring(const char *subject, int *ovector,
13 int stringcount, int stringnumber,
14 const char **stringptr);
15
17
18 This is a convenience function for extracting a captured substring. The
19 arguments are:
20
21 subject Subject that has been successfully matched
22 ovector Offset vector that pcre_exec() used
23 stringcount Value returned by pcre_exec()
24 stringnumber Number of the required substring
25 stringptr Where to put the string pointer
26
27 The memory in which the substring is placed is obtained by calling
28 pcre_malloc(). The convenience function pcre_free_substring() can be
29 used to free it when it is no longer needed. The yield of the function
30 is the length of the substring, PCRE_ERROR_NOMEMORY if sufficient mem‐
31 ory could not be obtained, or PCRE_ERROR_NOSUBSTRING if the string num‐
32 ber is invalid.
33
34 There is a complete description of the PCRE native API in the pcreapi
35 page and a description of the POSIX API in the pcreposix page.
36
37
38
39 PCRE_GET_SUBSTRING(3)