PCRE2\_SUBSTRING\_NUMBER\_FROM\_NAME(3) Library Functions Manual PCRE2\_SUBSTRING\_NUMBER\_FROM\_NAME(3)

# [NAME](#NAME)

PCRE2 - Perl-compatible regular expressions (revised API)

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;pcre2.h&gt;**

```
int pcre2_substring_number_from_name(const pcre2_code *code,
  PCRE2_SPTR name);
```

# [DESCRIPTION](#DESCRIPTION)

This convenience function finds the number of a named substring capturing parenthesis in a compiled pattern, provided that it is a unique name. The function arguments are:

*code* Compiled regular expression  
*name* Name whose number is required

The yield of the function is the number of the parenthesis if the name is found, or PCRE2\_ERROR\_NOSUBSTRING if it is not found. When duplicate names are allowed (PCRE2\_DUPNAMES is set), if the name is not unique, PCRE2\_ERROR\_NOUNIQUESUBSTRING is returned. You can obtain the list of numbers with the same name by calling **pcre2\_substring\_nametable\_scan()**.

There is a complete description of the PCRE2 native API in the **pcre2api** page and a description of the POSIX API in the **pcre2posix** page.

03 November 2014 PCRE2 10.49

---

Document: pcre2_substring_number_from_name(3) from pcre2 10.49-r1 (Chainguard OS)
Source: https://github.com/PCRE2Project/pcre2.git
