1PCRE_GET_NAMED_SUBSTRING(3)Library Functions ManualPCRE_GET_NAMED_SUBSTRING(3)
2
3
4

NAME

6       PCRE - Perl-compatible regular expressions
7

SYNOPSIS

9
10       #include <pcre.h>
11
12       int pcre_get_named_substring(const pcre *code,
13            const char *subject, int *ovector,
14            int stringcount, const char *stringname,
15            const char **stringptr);
16

DESCRIPTION

18
19       This  is  a convenience function for extracting a captured substring by
20       name. The arguments are:
21
22         code          Compiled pattern
23         subject       Subject that has been successfully matched
24         ovector       Offset vector that pcre_exec() used
25         stringcount   Value returned by pcre_exec()
26         stringname    Name of the required substring
27         stringptr     Where to put the string pointer
28
29       The memory in which the substring is  placed  is  obtained  by  calling
30       pcre_malloc().  The  convenience  function pcre_free_substring() can be
31       used to free it when it is no longer needed. The yield of the  function
32       is the length of the extracted substring, PCRE_ERROR_NOMEMORY if suffi‐
33       cient memory could not be obtained, or  PCRE_ERROR_NOSUBSTRING  if  the
34       string name is invalid.
35
36       There  is  a complete description of the PCRE native API in the pcreapi
37       page and a description of the POSIX API in the pcreposix page.
38
39
40
41                                                   PCRE_GET_NAMED_SUBSTRING(3)
Impressum