1PCRE_COPY_NAMED_SUBSTRING(3)Library Functions ManualPCRE_COPY_NAMED_SUBSTRING(3)
2
3
4
6 PCRE - Perl-compatible regular expressions
7
9
10 #include <pcre.h>
11
12 int pcre_copy_named_substring(const pcre *code,
13 const char *subject, int *ovector,
14 int stringcount, const char *stringname,
15 char *buffer, int buffersize);
16
17 int pcre16_copy_named_substring(const pcre16 *code,
18 PCRE_SPTR16 subject, int *ovector,
19 int stringcount, PCRE_SPTR16 stringname,
20 PCRE_UCHAR16 *buffer, int buffersize);
21
22 int pcre32_copy_named_substring(const pcre32 *code,
23 PCRE_SPTR32 subject, int *ovector,
24 int stringcount, PCRE_SPTR32 stringname,
25 PCRE_UCHAR32 *buffer, int buffersize);
26
28
29 This is a convenience function for extracting a captured substring,
30 identified by name, into a given buffer. The arguments are:
31
32 code Pattern that was successfully matched
33 subject Subject that has been successfully matched
34 ovector Offset vector that pcre[16|32]_exec() used
35 stringcount Value returned by pcre[16|32]_exec()
36 stringname Name of the required substring
37 buffer Buffer to receive the string
38 buffersize Size of buffer
39
40 The yield is the length of the substring, PCRE_ERROR_NOMEMORY if the
41 buffer was too small, or PCRE_ERROR_NOSUBSTRING if the string name is
42 invalid.
43
44 There is a complete description of the PCRE native API in the pcreapi
45 page and a description of the POSIX API in the pcreposix page.
46
47
48
49PCRE 8.30 24 June 2012 PCRE_COPY_NAMED_SUBSTRING(3)