pcre_copy_named_substring.3   [plain text]

PCRE - Perl-compatible regular expressions
.B #include <pcre.h>
.B int pcre_copy_named_substring(const pcre *\fIcode\fP,
.ti +5n
.B const char *\fIsubject\fP, int *\fIovector\fP,
.ti +5n
.B int \fIstringcount\fP, const char *\fIstringname\fP,
.ti +5n
.B char *\fIbuffer\fP, int \fIbuffersize\fP);
This is a convenience function for extracting a captured substring, identified
by name, into a given buffer. The arguments are:
  \fIcode\fP          Pattern that was successfully matched
  \fIsubject\fP       Subject that has been successfully matched
  \fIovector\fP       Offset vector that \fBpcre_exec()\fP used
  \fIstringcount\fP   Value returned by \fBpcre_exec()\fP
  \fIstringname\fP    Name of the required substring
  \fIbuffer\fP        Buffer to receive the string
  \fIbuffersize\fP    Size of buffer
The yield is the length of the substring, PCRE_ERROR_NOMEMORY if the buffer was
too small, or PCRE_ERROR_NOSUBSTRING if the string name is invalid.
There is a complete description of the PCRE native API in the
.\" HREF
page and a description of the POSIX API in the
.\" HREF