Elliott Hughes | 0c26e19 | 2019-08-07 12:24:46 -0700 | [diff] [blame] | 1 | .TH PCRE2_SUBSTRING_NAMETABLE_SCAN 3 "03 February 2019" "PCRE2 10.33" |
Janis Danisevskis | 112c9cc | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 2 | .SH NAME |
| 3 | PCRE2 - 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 |
| 17 | This convenience function finds, for a compiled pattern, the first and last |
Elliott Hughes | 0c26e19 | 2019-08-07 12:24:46 -0700 | [diff] [blame] | 18 | entries for a given name in the table that translates capture group names into |
| 19 | numbers. |
Janis Danisevskis | 112c9cc | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 20 | .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 |
| 26 | When the name is found in the table, if \fIfirst\fP is NULL, the function |
| 27 | returns a group number, but if there is more than one matching entry, it is not |
| 28 | defined which one. Otherwise, when both pointers have been set, the yield of |
| 29 | the function is the length of each entry in code units. If the name is not |
| 30 | found, PCRE2_ERROR_NOSUBSTRING is returned. |
| 31 | .P |
| 32 | There is a complete description of the PCRE2 native API, including the format of |
| 33 | the table entries, in the |
| 34 | .\" HREF |
| 35 | \fBpcre2api\fP |
| 36 | .\" |
| 37 | page, and a description of the POSIX API in the |
| 38 | .\" HREF |
| 39 | \fBpcre2posix\fP |
| 40 | .\" |
| 41 | page. |