blob: 8fb11ec6d128023d7419f9d508bc7b496cec886d [file] [log] [blame]
Tristan Matthews04616462013-11-14 16:09:34 -05001.TH PCRE_GET_SUBSTRING 3
2.SH NAME
3PCRE - Perl-compatible regular expressions
4.SH SYNOPSIS
5.rs
6.sp
7.B #include <pcre.h>
8.PP
9.SM
10.B int pcre_get_substring(const char *\fIsubject\fP, int *\fIovector\fP,
11.ti +5n
12.B int \fIstringcount\fP, int \fIstringnumber\fP,
13.ti +5n
14.B const char **\fIstringptr\fP);
15.
16.SH DESCRIPTION
17.rs
18.sp
19This is a convenience function for extracting a captured substring. The
20arguments are:
21.sp
22 \fIsubject\fP Subject that has been successfully matched
23 \fIovector\fP Offset vector that \fBpcre_exec()\fP used
24 \fIstringcount\fP Value returned by \fBpcre_exec()\fP
25 \fIstringnumber\fP Number of the required substring
26 \fIstringptr\fP Where to put the string pointer
27.sp
28The memory in which the substring is placed is obtained by calling
29\fBpcre_malloc()\fP. The convenience function \fBpcre_free_substring()\fP can
30be used to free it when it is no longer needed. The yield of the function is
31the length of the substring, PCRE_ERROR_NOMEMORY if sufficient memory could not
32be obtained, or PCRE_ERROR_NOSUBSTRING if the string number is invalid.
33.P
34There is a complete description of the PCRE native API in the
35.\" HREF
36\fBpcreapi\fP
37.\"
38page and a description of the POSIX API in the
39.\" HREF
40\fBpcreposix\fP
41.\"
42page.