tools/pcre/doc/pcre_get_named_substring.3
author Nicholas Hastings <skamonkey@gmail.com>
Sun Jul 15 12:31:06 2012 -0400 (2012-07-15)
changeset 3579 6d730190a3e4
parent 2762 d2d467bf1b5a
child 3831 babd0eee3c5e
permissions -rw-r--r--
Added missing files to each core and logic makefiles (NPOTB).
dvander@2762
     1
.TH PCRE_GET_NAMED_SUBSTRING 3
dvander@2762
     2
.SH NAME
dvander@2762
     3
PCRE - Perl-compatible regular expressions
dvander@2762
     4
.SH SYNOPSIS
dvander@2762
     5
.rs
dvander@2762
     6
.sp
dvander@2762
     7
.B #include <pcre.h>
dvander@2762
     8
.PP
dvander@2762
     9
.SM
dvander@2762
    10
.B int pcre_get_named_substring(const pcre *\fIcode\fP,
dvander@2762
    11
.ti +5n
dvander@2762
    12
.B const char *\fIsubject\fP, int *\fIovector\fP,
dvander@2762
    13
.ti +5n
dvander@2762
    14
.B int \fIstringcount\fP, const char *\fIstringname\fP,
dvander@2762
    15
.ti +5n
dvander@2762
    16
.B const char **\fIstringptr\fP);
dvander@2762
    17
.
dvander@2762
    18
.SH DESCRIPTION
dvander@2762
    19
.rs
dvander@2762
    20
.sp
dvander@2762
    21
This is a convenience function for extracting a captured substring by name. The
dvander@2762
    22
arguments are:
dvander@2762
    23
.sp
dvander@2762
    24
  \fIcode\fP          Compiled pattern
dvander@2762
    25
  \fIsubject\fP       Subject that has been successfully matched
dvander@2762
    26
  \fIovector\fP       Offset vector that \fBpcre_exec()\fP used
dvander@2762
    27
  \fIstringcount\fP   Value returned by \fBpcre_exec()\fP
dvander@2762
    28
  \fIstringname\fP    Name of the required substring
dvander@2762
    29
  \fIstringptr\fP     Where to put the string pointer
dvander@2762
    30
.sp
dvander@2762
    31
The memory in which the substring is placed is obtained by calling
dvander@2762
    32
\fBpcre_malloc()\fP. The convenience function \fBpcre_free_substring()\fP can
dvander@2762
    33
be used to free it when it is no longer needed. The yield of the function is
dvander@2762
    34
the length of the extracted substring, PCRE_ERROR_NOMEMORY if sufficient memory
dvander@2762
    35
could not be obtained, or PCRE_ERROR_NOSUBSTRING if the string name is invalid.
dvander@2762
    36
.P
dvander@2762
    37
There is a complete description of the PCRE native API in the
dvander@2762
    38
.\" HREF
dvander@2762
    39
\fBpcreapi\fP
dvander@2762
    40
.\"
dvander@2762
    41
page and a description of the POSIX API in the
dvander@2762
    42
.\" HREF
dvander@2762
    43
\fBpcreposix\fP
dvander@2762
    44
.\"
dvander@2762
    45
page.