blob: b077b1d2fbe36ec13680550247122db7c1396b52 [file] [log] [blame]
Janis Danisevskis112c9cc2016-03-31 13:35:25 +01001.TH PCRE2_SUBSTRING_NUMBER_FROM_NAME 3 "21 October 2014" "PCRE2 10.00"
2.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_number_from_name(const pcre2_code *\fIcode\fP,
11.B " PCRE2_SPTR \fIname\fP);"
12.fi
13.
14.SH DESCRIPTION
15.rs
16.sp
17This convenience function finds the number of a named substring capturing
18parenthesis in a compiled pattern, provided that it is a unique name. The
19function arguments are:
20.sp
21 \fIcode\fP Compiled regular expression
22 \fIname\fP Name whose number is required
23.sp
24The yield of the function is the number of the parenthesis if the name is
25found, or PCRE2_ERROR_NOSUBSTRING if it is not found. When duplicate names are
26allowed (PCRE2_DUPNAMES is set), if the name is not unique,
27PCRE2_ERROR_NOUNIQUESUBSTRING is returned. You can obtain the list of numbers
28with the same name by calling \fBpcre2_substring_nametable_scan()\fP.
29.P
30There is a complete description of the PCRE2 native API in the
31.\" HREF
32\fBpcre2api\fP
33.\"
34page and a description of the POSIX API in the
35.\" HREF
36\fBpcre2posix\fP
37.\"
38page.