141 lines
11 KiB
HTML
141 lines
11 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of PCRE2_PATTERN_INFO</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>PCRE2_PATTERN_INFO</H1>
|
|
Section: C Library Functions (3)<BR>Updated: 14 February 2019<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
PCRE2 - Perl-compatible regular expressions (revised API)
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
<P>
|
|
<B>#include <<A HREF="file:///usr/include/pcre2.h">pcre2.h</A>></B>
|
|
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>int pcre2_pattern_info(const pcre2_code *</B><I>code</I>, uint32_t <I>what</I>,
|
|
<B> void *</B><I>where</I>);
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
<P>
|
|
This function returns information about a compiled pattern. Its arguments are:
|
|
<P>
|
|
<BR> <I>code</I> Pointer to a compiled regular expression pattern
|
|
<BR> <I>what</I> What information is required
|
|
<BR> <I>where</I> Where to put the information
|
|
<P>
|
|
The recognized values for the <I>what</I> argument, and the information they
|
|
request are as follows:
|
|
<P>
|
|
<BR> PCRE2_INFO_ALLOPTIONS Final options after compiling
|
|
<BR> PCRE2_INFO_ARGOPTIONS Options passed to <B>pcre2_compile()</B>
|
|
<BR> PCRE2_INFO_BACKREFMAX Number of highest backreference
|
|
<BR> PCRE2_INFO_BSR What \R matches:
|
|
<BR> PCRE2_BSR_UNICODE: Unicode line endings
|
|
<BR> PCRE2_BSR_ANYCRLF: CR, LF, or CRLF only
|
|
<BR> PCRE2_INFO_CAPTURECOUNT Number of capturing subpatterns
|
|
|
|
<BR> PCRE2_INFO_DEPTHLIMIT Backtracking depth limit if set,
|
|
<BR> otherwise PCRE2_ERROR_UNSET
|
|
<BR> PCRE2_INFO_EXTRAOPTIONS Extra options that were passed in the
|
|
<BR> compile context
|
|
<BR> PCRE2_INFO_FIRSTBITMAP Bitmap of first code units, or NULL
|
|
<BR> PCRE2_INFO_FIRSTCODETYPE Type of start-of-match information
|
|
<BR> 0 nothing set
|
|
<BR> 1 first code unit is set
|
|
<BR> 2 start of string or after newline
|
|
<BR> PCRE2_INFO_FIRSTCODEUNIT First code unit when type is 1
|
|
<BR> PCRE2_INFO_FRAMESIZE Size of backtracking frame
|
|
<BR> PCRE2_INFO_HASBACKSLASHC Return 1 if pattern contains \C
|
|
|
|
<BR> PCRE2_INFO_HASCRORLF Return 1 if explicit CR or LF matches
|
|
<BR> exist in the pattern
|
|
|
|
<BR> PCRE2_INFO_HEAPLIMIT Heap memory limit if set,
|
|
<BR> otherwise PCRE2_ERROR_UNSET
|
|
<BR> PCRE2_INFO_JCHANGED Return 1 if (?J) or (?-J) was used
|
|
<BR> PCRE2_INFO_JITSIZE Size of JIT compiled code, or 0
|
|
<BR> PCRE2_INFO_LASTCODETYPE Type of must-be-present information
|
|
<BR> 0 nothing set
|
|
<BR> 1 code unit is set
|
|
<BR> PCRE2_INFO_LASTCODEUNIT Last code unit when type is 1
|
|
|
|
<BR> PCRE2_INFO_MATCHEMPTY 1 if the pattern can match an
|
|
<BR> empty string, 0 otherwise
|
|
|
|
<BR> PCRE2_INFO_MATCHLIMIT Match limit if set,
|
|
<BR> otherwise PCRE2_ERROR_UNSET
|
|
|
|
<BR> PCRE2_INFO_MAXLOOKBEHIND Length (in characters) of the longest
|
|
<BR> lookbehind assertion
|
|
<BR> PCRE2_INFO_MINLENGTH Lower bound length of matching strings
|
|
<BR> PCRE2_INFO_NAMECOUNT Number of named subpatterns
|
|
<BR> PCRE2_INFO_NAMEENTRYSIZE Size of name table entries
|
|
<BR> PCRE2_INFO_NAMETABLE Pointer to name table
|
|
<BR> PCRE2_CONFIG_NEWLINE Code for the newline sequence:
|
|
<BR> PCRE2_NEWLINE_CR
|
|
<BR> PCRE2_NEWLINE_LF
|
|
<BR> PCRE2_NEWLINE_CRLF
|
|
<BR> PCRE2_NEWLINE_ANY
|
|
<BR> PCRE2_NEWLINE_ANYCRLF
|
|
<BR> PCRE2_NEWLINE_NUL
|
|
<BR> PCRE2_INFO_RECURSIONLIMIT Obsolete synonym for PCRE2_INFO_DEPTHLIMIT
|
|
<BR> PCRE2_INFO_SIZE Size of compiled pattern
|
|
<P>
|
|
If <I>where</I> is NULL, the function returns the amount of memory needed for
|
|
the requested information, in bytes. Otherwise, the <I>where</I> argument must
|
|
point to an unsigned 32-bit integer (uint32_t variable), except for the
|
|
following <I>what</I> values, when it must point to a variable of the type
|
|
shown:
|
|
<P>
|
|
<BR> PCRE2_INFO_FIRSTBITMAP const uint8_t *
|
|
<BR> PCRE2_INFO_JITSIZE size_t
|
|
<BR> PCRE2_INFO_NAMETABLE PCRE2_SPTR
|
|
<BR> PCRE2_INFO_SIZE size_t
|
|
<P>
|
|
The yield of the function is zero on success or:
|
|
<P>
|
|
<BR> PCRE2_ERROR_NULL the argument <I>code</I> is NULL
|
|
<BR> PCRE2_ERROR_BADMAGIC the "magic number" was not found
|
|
<BR> PCRE2_ERROR_BADOPTION the value of <I>what</I> is invalid
|
|
<BR> PCRE2_ERROR_BADMODE the pattern was compiled in the wrong mode
|
|
<BR> PCRE2_ERROR_UNSET the requested information is not 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"> </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:50 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|