man-pages/man3/pcre2_substring_copy_byname.3.html
2021-03-31 01:06:50 +01:00

79 lines
2.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of PCRE2_SUBSTRING_COPY_BYNAME</TITLE>
</HEAD><BODY>
<H1>PCRE2_SUBSTRING_COPY_BYNAME</H1>
Section: C Library Functions (3)<BR>Updated: 21 October 2014<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
PCRE2 - Perl-compatible regular expressions (revised API)
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<B>#include &lt;<A HREF="file:///usr/include/pcre2.h">pcre2.h</A>&gt;</B>
<P>
<PRE>
<B>int pcre2_substring_copy_byname(pcre2_match_data *</B><I>match_data</I>,
<B> PCRE2_SPTR </B><I>name</I>, PCRE2_UCHAR *<I>buffer</I>, PCRE2_SIZE *<I>bufflen</I>);
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
This is a convenience function for extracting a captured substring, identified
by name, into a given buffer. The arguments are:
<P>
<BR>&nbsp;&nbsp;<I>match_data</I>&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;match&nbsp;data&nbsp;block&nbsp;for&nbsp;the&nbsp;match
<BR>&nbsp;&nbsp;<I>name</I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name&nbsp;of&nbsp;the&nbsp;required&nbsp;substring
<BR>&nbsp;&nbsp;<I>buffer</I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Buffer&nbsp;to&nbsp;receive&nbsp;the&nbsp;string
<BR>&nbsp;&nbsp;<I>bufflen</I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Length&nbsp;of&nbsp;buffer&nbsp;(code&nbsp;units)
<P>
The <I>bufflen</I> variable is updated to contain the length of the extracted
string, excluding the trailing zero. The yield of the function is zero for
success or one of the following error numbers:
<P>
<BR>&nbsp;&nbsp;PCRE2_ERROR_NOSUBSTRING&nbsp;&nbsp;&nbsp;there&nbsp;are&nbsp;no&nbsp;groups&nbsp;of&nbsp;that&nbsp;name
<BR>&nbsp;&nbsp;PCRE2_ERROR_UNAVAILBLE&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;ovector&nbsp;was&nbsp;too&nbsp;small&nbsp;for&nbsp;that&nbsp;group
<BR>&nbsp;&nbsp;PCRE2_ERROR_UNSET&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;group&nbsp;did&nbsp;not&nbsp;participate&nbsp;in&nbsp;the&nbsp;match
<BR>&nbsp;&nbsp;PCRE2_ERROR_NOMEMORY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;buffer&nbsp;is&nbsp;not&nbsp;big&nbsp;enough
<P>
If there is more than one group with the given name, the first one that is set
is returned. In this situation PCRE2_ERROR_UNSET means that no group with the
given name was set.
<P>
There is a complete description of the PCRE2 native API in the
<B>pcre2api</B>
page and a description of the POSIX API in the
<B>pcre2posix</B>
page.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:51 GMT, March 31, 2021
</BODY>
</HTML>