blob: 9ab58cdcc6ddbf83292788336c29e027232ea34a [file] [log] [blame]
Elliott Hughes0c26e192019-08-07 12:24:46 -07001.TH PCRE2_SUBSTRING_NAMETABLE_SCAN 3 "03 February 2019" "PCRE2 10.33"
Janis Danisevskis112c9cc2016-03-31 13:35:25 +01002.SH NAME
3PCRE2 - Perl-compatible regular expressions (revised API)
4.SH SYNOPSIS
5.rs
6.sp
7.B #include <pcre2.h>
8.PP
9.nf
10.B int pcre2_substring_nametable_scan(const pcre2_code *\fIcode\fP,
11.B " PCRE2_SPTR \fIname\fP, PCRE2_SPTR *\fIfirst\fP, PCRE2_SPTR *\fIlast\fP);"
12.fi
13.
14.SH DESCRIPTION
15.rs
16.sp
17This convenience function finds, for a compiled pattern, the first and last
Elliott Hughes0c26e192019-08-07 12:24:46 -070018entries for a given name in the table that translates capture group names into
19numbers.
Janis Danisevskis112c9cc2016-03-31 13:35:25 +010020.sp
21 \fIcode\fP Compiled regular expression
22 \fIname\fP Name whose entries required
23 \fIfirst\fP Where to return a pointer to the first entry
24 \fIlast\fP Where to return a pointer to the last entry
25.sp
26When the name is found in the table, if \fIfirst\fP is NULL, the function
27returns a group number, but if there is more than one matching entry, it is not
28defined which one. Otherwise, when both pointers have been set, the yield of
29the function is the length of each entry in code units. If the name is not
30found, PCRE2_ERROR_NOSUBSTRING is returned.
31.P
32There is a complete description of the PCRE2 native API, including the format of
33the table entries, in the
34.\" HREF
35\fBpcre2api\fP
36.\"
37page, and a description of the POSIX API in the
38.\" HREF
39\fBpcre2posix\fP
40.\"
41page.