A lot more documentation.

This commit is contained in:
Philip.Hazel 2014-10-21 16:33:30 +00:00
parent c3799e750f
commit db8480a1e0
57 changed files with 3448 additions and 998 deletions

View File

@ -25,6 +25,29 @@ dist_html_DATA = \
doc/html/index.html \ doc/html/index.html \
doc/html/pcre2-config.html \ doc/html/pcre2-config.html \
doc/html/pcre2.html \ doc/html/pcre2.html \
doc/html/pcre2_code_free.html \
doc/html/pcre2_compile.html \
doc/html/pcre2_config.html \
doc/html/pcre2_dfa_match.html \
doc/html/pcre2_get_error_message.html \
doc/html/pcre2_jit_compile.html \
doc/html/pcre2_jit_match.html \
doc/html/pcre2_jit_stack_alloc.html \
doc/html/pcre2_jit_stack_assign.html \
doc/html/pcre2_jit_stack_free.html \
doc/html/pcre2_maketables.html \
doc/html/pcre2_match.html \
doc/html/pcre2_pattern_info.html \
doc/html/pcre2_substring_copy_byname.html \
doc/html/pcre2_substring_copy_bynumber.html \
doc/html/pcre2_substring_free.html \
doc/html/pcre2_substring_get_byname.html \
doc/html/pcre2_substring_length_byname.html \
doc/html/pcre2_substring_length_bynumber.html \
doc/html/pcre2_substring_list_free.html \
doc/html/pcre2_substring_list_get.html \
doc/html/pcre2_substring_nametable_scan.html \
doc/html/pcre2_substring_number_from_name.html \
doc/html/pcre2api.html \ doc/html/pcre2api.html \
doc/html/pcre2build.html \ doc/html/pcre2build.html \
doc/html/pcre2callout.html \ doc/html/pcre2callout.html \
@ -44,39 +67,34 @@ dist_html_DATA = \
doc/html/pcre2test.html \ doc/html/pcre2test.html \
doc/html/pcre2unicode.html doc/html/pcre2unicode.html
# doc/html/pcre2_assign_jit_stack.html \
# doc/html/pcre2_compile.html \
# doc/html/pcre2_compile2.html \
# doc/html/pcre2_config.html \
# doc/html/pcre2_copy_named_substring.html \
# doc/html/pcre2_copy_substring.html \
# doc/html/pcre2_dfa_match.html \
# doc/html/pcre2_match.html \
# doc/html/pcre2_free_study.html \
# doc/html/pcre2_free_substring.html \
# doc/html/pcre2_free_substring_list.html \
# doc/html/pcre2_fullinfo.html \
# doc/html/pcre2_get_named_substring.html \
# doc/html/pcre2_get_stringnumber.html \
# doc/html/pcre2_get_stringtable_entries.html \
# doc/html/pcre2_get_substring.html \
# doc/html/pcre2_get_substring_list.html \
# doc/html/pcre2_jit_match.html \
# doc/html/pcre2_jit_stack_alloc.html \
# doc/html/pcre2_jit_stack_free.html \
# doc/html/pcre2_maketables.html \
# doc/html/pcre2_pattern_to_host_byte_order.html \
# doc/html/pcre2_refcount.html \
# doc/html/pcre2_study.html \
# doc/html/pcre2_utf16_to_host_byte_order.html \
# doc/html/pcre2_utf32_to_host_byte_order.html \
# doc/html/pcre2_version.html \
# doc/html/pcre2precompile.html
# FIXME # FIXME
dist_man_MANS = \ dist_man_MANS = \
doc/pcre2-config.1 \ doc/pcre2-config.1 \
doc/pcre2.3 \ doc/pcre2.3 \
doc/pcre2_code_free.3 \
doc/pcre2_compile.3 \
doc/pcre2_config.3 \
doc/pcre2_dfa_match.3 \
doc/pcre2_get_error_message.3 \
doc/pcre2_jit_compile.3 \
doc/pcre2_jit_match.3 \
doc/pcre2_jit_stack_alloc.3 \
doc/pcre2_jit_stack_assign.3 \
doc/pcre2_jit_stack_free.3 \
doc/pcre2_maketables.3 \
doc/pcre2_match.3 \
doc/pcre2_pattern_info.3 \
doc/pcre2_substring_copy_byname.3 \
doc/pcre2_substring_copy_bynumber.3 \
doc/pcre2_substring_free.3 \
doc/pcre2_substring_get_byname.3 \
doc/pcre2_substring_length_byname.3 \
doc/pcre2_substring_length_bynumber.3 \
doc/pcre2_substring_list_free.3 \
doc/pcre2_substring_list_get.3 \
doc/pcre2_substring_nametable_scan.3 \
doc/pcre2_substring_number_from_name.3 \
doc/pcre2api.3 \ doc/pcre2api.3 \
doc/pcre2build.3 \ doc/pcre2build.3 \
doc/pcre2callout.3 \ doc/pcre2callout.3 \
@ -96,37 +114,6 @@ dist_man_MANS = \
doc/pcre2test.1 \ doc/pcre2test.1 \
doc/pcre2unicode.3 doc/pcre2unicode.3
# doc/pcre2-16.3 \
# doc/pcre2-32.3 \
# doc/pcre2_assign_jit_stack.3 \
# doc/pcre2_compile.3 \
# doc/pcre2_compile2.3 \
# doc/pcre2_config.3 \
# doc/pcre2_copy_named_substring.3 \
# doc/pcre2_copy_substring.3 \
# doc/pcre2_dfa_match.3 \
# doc/pcre2_match.3 \
# doc/pcre2_free_study.3 \
# doc/pcre2_free_substring.3 \
# doc/pcre2_free_substring_list.3 \
# doc/pcre2_fullinfo.3 \
# doc/pcre2_get_named_substring.3 \
# doc/pcre2_get_stringnumber.3 \
# doc/pcre2_get_stringtable_entries.3 \
# doc/pcre2_get_substring.3 \
# doc/pcre2_get_substring_list.3 \
# doc/pcre2_jit_match.3 \
# doc/pcre2_jit_stack_alloc.3 \
# doc/pcre2_jit_stack_free.3 \
# doc/pcre2_maketables.3 \
# doc/pcre2_pattern_to_host_byte_order.3 \
# doc/pcre2_refcount.3 \
# doc/pcre2_study.3 \
# doc/pcre2_utf16_to_host_byte_order.3 \
# doc/pcre2_utf32_to_host_byte_order.3 \
# doc/pcre2_version.3 \
# doc/pcre2precompile.3
# The Libtool libraries to install. We'll add to this later. # The Libtool libraries to install. We'll add to this later.
lib_LTLIBRARIES = lib_LTLIBRARIES =

View File

@ -17,16 +17,16 @@ first.
</p> </p>
<table> <table>
<tr><td><a href="pcre2.html">pcre</a></td> <tr><td><a href="pcre2.html">pcre2</a></td>
<td>&nbsp;&nbsp;Introductory page</td></tr> <td>&nbsp;&nbsp;Introductory page</td></tr>
<tr><td><a href="pcre2-config.html">pcre-config</a></td> <tr><td><a href="pcre2-config.html">pcre-2config</a></td>
<td>&nbsp;&nbsp;Information about the installation configuration</td></tr> <td>&nbsp;&nbsp;Information about the installation configuration</td></tr>
<tr><td><a href="pcre2api.html">pcreapi</a></td> <tr><td><a href="pcre2api.html">pcre2api</a></td>
<td>&nbsp;&nbsp;PCRE2's native API</td></tr> <td>&nbsp;&nbsp;PCRE2's native API</td></tr>
<tr><td><a href="pcre2build.html">pcrebuild</a></td> <tr><td><a href="pcre2build.html">pcre2build</a></td>
<td>&nbsp;&nbsp;Building PCRE2</td></tr> <td>&nbsp;&nbsp;Building PCRE2</td></tr>
<tr><td><a href="pcre2callout.html">pcre2callout</a></td> <tr><td><a href="pcre2callout.html">pcre2callout</a></td>
@ -62,9 +62,6 @@ first.
<tr><td><a href="pcre2posix.html">pcre2posix</a></td> <tr><td><a href="pcre2posix.html">pcre2posix</a></td>
<td>&nbsp;&nbsp;The POSIX API to the PCRE2 8-bit library</td></tr> <td>&nbsp;&nbsp;The POSIX API to the PCRE2 8-bit library</td></tr>
<tr><td><a href="pcre2precompile.html">pcre2precompile</a></td>
<td>&nbsp;&nbsp;How to save and re-use compiled patterns</td></tr>
<tr><td><a href="pcre2sample.html">pcre2sample</a></td> <tr><td><a href="pcre2sample.html">pcre2sample</a></td>
<td>&nbsp;&nbsp;Discussion of the pcre2demo program</td></tr> <td>&nbsp;&nbsp;Discussion of the pcre2demo program</td></tr>
@ -83,17 +80,16 @@ first.
<p> <p>
There are also individual pages that summarize the interface for each function There are also individual pages that summarize the interface for each function
in the library. There is a single page for each triple of 8-bit/16-bit/32-bit in the library.
functions.
</p> </p>
<table> <table>
<tr><td><a href="pcre2_assign_jit_stack.html">pcre2_assign_jit_stack</a></td> <tr><td><a href="pcre2_code_free.html">pcre2_code_free</a></td>
<td>&nbsp;&nbsp;Assign stack for JIT matching</td></tr> <td>&nbsp;&nbsp;Free a compiled pattern</td></tr>
<tr><td><a href="pcre2_compile.html">pcre2_compile</a></td> <tr><td><a href="pcre2_compile.html">pcre2_compile</a></td>
<td>&nbsp;&nbsp;Compile a regular expression</td></tr> <td>&nbsp;&nbsp;Compile a regular expression pattern</td></tr>
<tr><td><a href="pcre2_compile2.html">pcre2_compile2</a></td> <tr><td><a href="pcre2_compile2.html">pcre2_compile2</a></td>
<td>&nbsp;&nbsp;Compile a regular expression (alternate interface)</td></tr> <td>&nbsp;&nbsp;Compile a regular expression (alternate interface)</td></tr>
@ -101,76 +97,70 @@ functions.
<tr><td><a href="pcre2_config.html">pcre2_config</a></td> <tr><td><a href="pcre2_config.html">pcre2_config</a></td>
<td>&nbsp;&nbsp;Show build-time configuration options</td></tr> <td>&nbsp;&nbsp;Show build-time configuration options</td></tr>
<tr><td><a href="pcre2_copy_named_substring.html">pcre2_copy_named_substring</a></td> <tr><td><a href="pcre2_dfa_match.html">pcre2_dfa_match</a></td>
<td>&nbsp;&nbsp;Extract named substring into given buffer</td></tr>
<tr><td><a href="pcre2_copy_substring.html">pcre2_copy_substring</a></td>
<td>&nbsp;&nbsp;Extract numbered substring into given buffer</td></tr>
<tr><td><a href="pcre2_dfa_exec.html">pcre2_dfa_exec</a></td>
<td>&nbsp;&nbsp;Match a compiled pattern to a subject string <td>&nbsp;&nbsp;Match a compiled pattern to a subject string
(DFA algorithm; <i>not</i> Perl compatible)</td></tr> (DFA algorithm; <i>not</i> Perl compatible)</td></tr>
<tr><td><a href="pcre2_exec.html">pcre2_exec</a></td> <tr><td><a href="pcre2_get_error_message.html">pcre2_get_error_message</a></td>
<td>&nbsp;&nbsp;Match a compiled pattern to a subject string
(Perl compatible)</td></tr>
<tr><td><a href="pcre2_free_study.html">pcre2_free_study</a></td>
<td>&nbsp;&nbsp;Free study data</td></tr> <td>&nbsp;&nbsp;Free study data</td></tr>
<tr><td><a href="pcre2_free_substring.html">pcre2_free_substring</a></td> <tr><td><a href="pcre2_jit_compile.html">pcre2_jit_compile</a></td>
<td>&nbsp;&nbsp;Free extracted substring</td></tr> <td>&nbsp;&nbsp;Process a compiled pattern with the JIT compiler</td></tr>
<tr><td><a href="pcre2_free_substring_list.html">pcre2_free_substring_list</a></td> <tr><td><a href="pcre2_jit_match.html">pcre2_jit_match</a></td>
<td>&nbsp;&nbsp;Free list of extracted substrings</td></tr>
<tr><td><a href="pcre2_fullinfo.html">pcre2_fullinfo</a></td>
<td>&nbsp;&nbsp;Extract information about a pattern</td></tr>
<tr><td><a href="pcre2_get_named_substring.html">pcre2_get_named_substring</a></td>
<td>&nbsp;&nbsp;Extract named substring into new memory</td></tr>
<tr><td><a href="pcre2_get_stringnumber.html">pcre2_get_stringnumber</a></td>
<td>&nbsp;&nbsp;Convert captured string name to number</td></tr>
<tr><td><a href="pcre2_get_stringtable_entries.html">pcre2_get_stringtable_entries</a></td>
<td>&nbsp;&nbsp;Find table entries for given string name</td></tr>
<tr><td><a href="pcre2_get_substring.html">pcre2_get_substring</a></td>
<td>&nbsp;&nbsp;Extract numbered substring into new memory</td></tr>
<tr><td><a href="pcre2_get_substring_list.html">pcre2_get_substring_list</a></td>
<td>&nbsp;&nbsp;Extract all substrings into new memory</td></tr>
<tr><td><a href="pcre2_jit_exec.html">pcre2_jit_exec</a></td>
<td>&nbsp;&nbsp;Fast path interface to JIT matching</td></tr> <td>&nbsp;&nbsp;Fast path interface to JIT matching</td></tr>
<tr><td><a href="pcre2_jit_stack_alloc.html">pcre2_jit_stack_alloc</a></td> <tr><td><a href="pcre2_jit_stack_alloc.html">pcre2_jit_stack_alloc</a></td>
<td>&nbsp;&nbsp;Create a stack for JIT matching</td></tr> <td>&nbsp;&nbsp;Create a stack for JIT matching</td></tr>
<tr><td><a href="pcre2_jit_stack_assign.html">pcre2_jit_stack_assign</a></td>
<td>&nbsp;&nbsp;Assign stack for JIT matching</td></tr>
<tr><td><a href="pcre2_jit_stack_free.html">pcre2_jit_stack_free</a></td> <tr><td><a href="pcre2_jit_stack_free.html">pcre2_jit_stack_free</a></td>
<td>&nbsp;&nbsp;Free a JIT matching stack</td></tr> <td>&nbsp;&nbsp;Free a JIT matching stack</td></tr>
<tr><td><a href="pcre2_maketables.html">pcre2_maketables</a></td> <tr><td><a href="pcre2_maketables.html">pcre2_maketables</a></td>
<td>&nbsp;&nbsp;Build character tables in current locale</td></tr> <td>&nbsp;&nbsp;Build character tables in current locale</td></tr>
<tr><td><a href="pcre2_pattern_to_host_byte_order.html">pcre2_pattern_to_host_byte_order</a></td> <tr><td><a href="pcre2_match.html">pcre2_match</a></td>
<td>&nbsp;&nbsp;Convert compiled pattern to host byte order if necessary</td></tr> <td>&nbsp;&nbsp;Match a compiled pattern to a subject string
(Perl compatible)</td></tr>
<tr><td><a href="pcre2_refcount.html">pcre2_refcount</a></td> <tr><td><a href="pcre2_pattern_info.html">pcre2_pattern_info</a></td>
<td>&nbsp;&nbsp;Maintain reference count in compiled pattern</td></tr> <td>&nbsp;&nbsp;Extract information about a pattern</td></tr>
<tr><td><a href="pcre2_study.html">pcre2_study</a></td> <tr><td><a href="pcre2_substring_copy_byname.html">pcre2_substring_copy_byname</a></td>
<td>&nbsp;&nbsp;Study a compiled pattern</td></tr> <td>&nbsp;&nbsp;Extract named substring into given buffer</td></tr>
<tr><td><a href="pcre2_utf16_to_host_byte_order.html">pcre2_utf16_to_host_byte_order</a></td> <tr><td><a href="pcre2_substring_copy_bynumber.html">pcre2_substring_copy_bynumber</a></td>
<td>&nbsp;&nbsp;Convert UTF-16 string to host byte order if necessary</td></tr> <td>&nbsp;&nbsp;Extract numbered substring into given buffer</td></tr>
<tr><td><a href="pcre2_utf32_to_host_byte_order.html">pcre2_utf32_to_host_byte_order</a></td> <tr><td><a href="pcre2_substring_free.html">pcre2_substring_free</a></td>
<td>&nbsp;&nbsp;Convert UTF-32 string to host byte order if necessary</td></tr> <td>&nbsp;&nbsp;Free extracted substring</td></tr>
<tr><td><a href="pcre2_version.html">pcre2_version</a></td> <tr><td><a href="pcre2_substring_get_byname.html">pcre2_substring_get_byname</a></td>
<td>&nbsp;&nbsp;Return PCRE2 version and release date</td></tr> <td>&nbsp;&nbsp;Extract named substring into new memory</td></tr>
<tr><td><a href="pcre2_substring_get_bynumber.html">pcre2_substring_get_bynumber</a></td>
<td>&nbsp;&nbsp;Extract numbered substring into new memory</td></tr>
<tr><td><a href="pcre2_substring_length_byname.html">pcre2_substring_length_byname</a></td>
<td>&nbsp;&nbsp;Find length of named substring</td></tr>
<tr><td><a href="pcre2_substring_length_bynumber.html">pcre2_substring_length_bynumber</a></td>
<td>&nbsp;&nbsp;Find length of numbered substring</td></tr>
<tr><td><a href="pcre2_substring_list_free.html">pcre2_substring_list_free</a></td>
<td>&nbsp;&nbsp;Free list of extracted substrings</td></tr>
<tr><td><a href="pcre2_substring_list_get.html">pcre2_substring_list_get</a></td>
<td>&nbsp;&nbsp;Extract all substrings into new memory</td></tr>
<tr><td><a href="pcre2_substring_nametable_scan.html">pcre2_substring_nametable_scan</a></td>
<td>&nbsp;&nbsp;Find table entries for given string name</td></tr>
<tr><td><a href="pcre2_substring_number_from_name.html">pcre2_substring_number_from_name</a></td>
<td>&nbsp;&nbsp;Convert captured string name to number</td></tr>
</table> </table>
</html> </html>

View File

@ -0,0 +1,39 @@
<html>
<head>
<title>pcre2_code_free specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_code_free man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>pcre2_code_free(pcre2_code *<i>code</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function frees the memory used for a compiled pattern, including any
memory used by the JIT compiler.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,88 @@
<html>
<head>
<title>pcre2_compile specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_compile man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>pcre2_code *pcre2_compile(PCRE2_SPTR <i>pattern</i>, PCRE2_SIZE <i>length</i>,</b>
<b> uint32_t <i>options</i>, int *<i>errorcode</i>, PCRE2_SIZE *<i>erroroffset,</i></b>
<b> pcre2_compile_context *<i>ccontext</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function compiles a regular expression pattern into an internal form. Its
arguments are:
<pre>
<i>pattern</i> A string containing expression to be compiled
<i>length</i> The length of the string or PCRE2_ZERO_TERMINATED
<i>options</i> Option bits
<i>errorcode</i> Where to put an error code
<i>erroffset</i> Where to put an error offset
<i>ccontext</i> Pointer to a compile context or NULL
</pre>
The length of the string and any error offset that is returned are in code
units, not characters. A compile context is needed only if you want to change
<pre>
What \R matches (Unicode newlines or CR, LF, CRLF only)
PCRE2's character tables
The newline character sequence
The compile time nested parentheses limit
</pre>
or provide an external function for stack size checking. The option bits are:
<pre>
PCRE2_ANCHORED Force pattern anchoring
PCRE2_ALT_BSUX Alternative handling of \u, \U, and \x
PCRE2_AUTO_CALLOUT Compile automatic callouts
PCRE2_CASELESS Do caseless matching
PCRE2_DOLLAR_ENDONLY $ not to match newline at end
PCRE2_DOTALL . matches anything including NL
PCRE2_DUPNAMES Allow duplicate names for subpatterns
PCRE2_EXTENDED Ignore white space and # comments
PCRE2_FIRSTLINE Force matching to be before newline
PCRE2_MATCH_UNSET_BACKREF Match unset back references
PCRE2_MULTILINE ^ and $ match newlines within data
PCRE2_NEVER_UCP Lock out PCRE2_UCP, e.g. via (*UCP)
PCRE2_NEVER_UTF Lock out PCRE2_UTF, e.g. via (*UTF)
PCRE2_NO_AUTO_CAPTURE Disable numbered capturing paren-
theses (named ones available)
PCRE2_NO_AUTO_POSSESS Disable auto-possessification
PCRE2_NO_START_OPTIMIZE Disable match-time start optimizations
PCRE2_NO_UTF_CHECK Do not check the pattern for UTF validity
(only relevant if PCRE2_UTF is set)
PCRE2_UCP Use Unicode properties for \d, \w, etc.
PCRE2_UNGREEDY Invert greediness of quantifiers
PCRE2_UTF Treat pattern and subjects as UTF strings
</pre>
PCRE2 must be built with Unicode support in order to use PCRE2_UTF, PCRE2_UCP
and related options.
</P>
<P>
The yield of the function is a pointer to a private data structure that
contains the compiled pattern, or NULL if an error was detected.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,85 @@
<html>
<head>
<title>pcre2_config specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_config man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_config(uint32_t <i>what</i>, void *<i>where</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function makes it possible for a client program to find out which optional
features are available in the version of the PCRE2 library it is using. The
arguments are as follows:
<pre>
<i>what</i> A code specifying what information is required
<i>where</i> Points to where to put the information
</pre>
If <i>where</i> is NULL, the function returns the amount of memory needed for
the requested information. When the information is a string, the value is in
code units; for other types of data it is in bytes.
</P>
<P>
If <b>where</b> is not NULL, for PCRE2_CONFIG_JITTARGET,
PCRE2_CONFIG_UNICODE_VERSION, and PCRE2_CONFIG_VERSION it must point to a
buffer that is large enough to hold the string. For PCRE2_CONFIG_MATCHLIMIT,
PCRE2_CONFIG_PARENSLIMIT, and PCRE2_CONFIG_RECURSIONLIMIT it must point to an
unsigned long int variable, and for all other codes to an int variable. The
available codes are:
<pre>
PCRE2_CONFIG_BSR Indicates what \R matches by default:
0 all Unicode line endings
1 CR, LF, or CRLF only
PCRE2_CONFIG_JIT Availability of just-in-time compiler
support (1=yes 0=no)
PCRE2_CONFIG_JITTARGET Information about the target archi-
tecture for the JIT compiler
PCRE2_CONFIG_LINKSIZE Configured internal link size (2, 3, 4)
PCRE2_CONFIG_MATCHLIMIT Default internal resource limit
PCRE2_CONFIG_NEWLINE Code for the default newline sequence:
1 for CR
2 for LF
3 for CRLF
4 for ANY
5 for ANYCRLF
PCRE2_CONFIG_PARENSLIMIT Default parentheses nesting limit
PCRE2_CONFIG_RECURSIONLIMIT Internal recursion depth limit
PCRE2_CONFIG_STACKRECURSE Recursion implementation (1=stack
0=heap)
PCRE2_CONFIG_UNICODE Availability of Unicode support (1=yes
0=no)
PCRE2_CONFIG_UNICODE_VERSION The Unicode version (a string)
PCRE2_CONFIG_VERSION The PCRE2 version (a string)
</pre>
The function yields a non-negative value on success or the negative value
PCRE2_ERROR_BADOPTION otherwise. This is also the result for the
PCRE2_CONFIG_JITTARGET code if JIT support is not available. When a string
is returned the yield is the length of the string, in code units, excluding the
terminating zero.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,79 @@
<html>
<head>
<title>pcre2_dfa_match specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_dfa_match man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_dfa_match(const pcre2_code *<i>code</i>, PCRE2_SPTR <i>subject</i>,</b>
<b> PCRE2_SIZE <i>length</i>, PCRE2_SIZE <i>startoffset</i>,</b>
<b> uint32_t <i>options</i>, pcre2_match_data *<i>match_data</i>,</b>
<b> pcre2_match_context *<i>mcontext</i>,</b>
<b> int *<i>workspace</i>, PCRE2_SIZE <i>wscount</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function matches a compiled regular expression against a given subject
string, using an alternative matching algorithm that scans the subject string
just once (<i>not</i> Perl-compatible). (The Perl-compatible matching function
is <b>pcre2_match()</b>.) The arguments for this function are:
<pre>
<i>code</i> Points to the compiled pattern
<i>subject</i> Points to the subject string
<i>length</i> Length of the subject string
<i>startoffset</i> Offset in the subject at which to start matching
<i>options</i> Option bits
<i>match_data</i> Points to a match data block, for results
<i>mcontext</i> Points to a match context, or is NULL
<i>workspace</i> Points to a vector of ints used as working space
<i>wscount</i> Number of elements in the vector
</pre>
For <b>pcre2_dfa_match()</b>, a match context is needed only if you want to set
up a callout function. The <i>length</i> and <i>startoffset</i> values are code
units, not characters. The options are:
<pre>
PCRE2_ANCHORED Match only at the first position
PCRE2_NOTBOL Subject is not the beginning of a line
PCRE2_NOTEOL Subject is not the end of a line
PCRE2_NOTEMPTY An empty string is not a valid match
PCRE2_NOTEMPTY_ATSTART An empty string at the start of the subject
is not a valid match
PCRE2_NO_UTF_CHECK Do not check the subject for UTF
validity (only relevant if PCRE2_UTF
was set at compile time)
PCRE2_PARTIAL_SOFT Return PCRE2_ERROR_PARTIAL for a partial
match if no full matches are found
PCRE2_PARTIAL_HARD Return PCRE2_ERROR_PARTIAL for a partial match
even if there is a full match as well
PCRE2_DFA_RESTART Restart after a partial match
PCRE2_DFA_SHORTEST Return only the shortest match
</pre>
There are restrictions on what may appear in a pattern when using this matching
function. Details are given in the
<a href="pcre2matching.html"><b>pcre2matching</b></a>
documentation. For details of partial matching, see the
<a href="pcre2partial.html"><b>pcre2partial</b></a>
page. There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,48 @@
<html>
<head>
<title>pcre2_get_error_message specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_get_error_message man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_get_error_message(int <i>errorcode</i>, PCRE2_UCHAR *<i>buffer</i>,</b>
<b> PCRE2_SIZE <i>bufflen</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function provides a textual error message for each PCRE2 error code.
Compilation errors are positive numbers; UTF formatting errors and matching
errors are negative numbers. The arguments are:
<pre>
<i>errorcode</i> an error code (positive or negative)
<i>buffer</i> where to put the message
<i>bufflen</i> the length of the buffer (code units)
</pre>
The function returns the length of the message, excluding the trailing zero, or
a negative error code if the buffer is too small.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,56 @@
<html>
<head>
<title>pcre2_jit_compile specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_jit_compile man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_jit_compile(pcre2_code *<i>code</i>, uint32_t <i>options</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function requests JIT compilation, which, if the just-in-time compiler is
available, further processes a compiled pattern into machine code that executes
much faster than the <b>pcre2_match()</b> interpretive matching function. Full
details are given in the
<a href="pcre2jit.html"><b>pcre2jit</b></a>
documentation.
</P>
<P>
The first argument is a pointer that was returned by a successful call to
<b>pcre2_compile()</b>, and the second must contain one or more of the following
bits:
<pre>
PCRE2_JIT_COMPLETE compile code for full matching
PCRE2_JIT_PARTIAL_SOFT compile code for soft partial matching
PCRE2_JIT_PARTIAL_HARD compile code for hard partial matching
</pre>
The yield of the function is 0 for success, or a negative error code otherwise.
In particular, PCRE2_ERROR_JIT_BADOPTION is returned if JIT is not supported or
if an unknown bit is set in <i>options</i>.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,62 @@
<html>
<head>
<title>pcre2_jit_match specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_jit_match man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_jit_match(const pcre2_code *<i>code</i>, PCRE2_SPTR <i>subject</i>,</b>
<b> PCRE2_SIZE <i>length</i>, PCRE2_SIZE <i>startoffset</i>,</b>
<b> uint32_t <i>options</i>, pcre2_match_data *<i>match_data</i>,</b>
<b> pcre2_match_context *<i>mcontext</i>, pcre2_jit_stack *<i>jit_stack</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function matches a compiled regular expression that has been successfully
processed by the JIT compiler against a given subject string, using a matching
algorithm that is similar to Perl's. It is a "fast path" interface to JIT, and
it bypasses some of the sanity checks that <b>pcre2_match()</b> applies.
Its arguments are exactly the same as for
<a href="pcre2_match.html"><b>pcre2_match()</b></a>
plus one additional argument that must either point to a JIT stack or be NULL.
In the latter case, if a callback function has been set up by
<b>pcre2_jit_stack_alloc()</b>, it is called. Otherwise the system stack is
used.
</P>
<P>
The supported options are PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY,
PCRE2_NOTEMPTY_ATSTART, PCRE2_PARTIAL_HARD, and PCRE2_PARTIAL_SOFT. Unsupported
options are ignored. The subject string is not checked for UTF validity.
</P>
<P>
The return values are the same as for <b>pcre2_match()</b> plus
PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial or complete) is requested
that was not compiled. For details of partial matching, see the
<a href="pcre2partial.html"><b>pcre2partial</b></a>
page.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the JIT API in the
<a href="pcre2jit.html"><b>pcre2jit</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,50 @@
<html>
<head>
<title>pcre2_jit_stack_alloc specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_jit_stack_alloc man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>pcre2_jit_stack *pcre2_jit_stack_alloc(pcre2_general_context *<i>gcontext</i>,</b>
<b> PCRE2_SIZE <i>startsize</i>, PCRE2_SIZE <i>maxsize</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function is used to create a stack for use by the code compiled by the JIT
compiler. The first argument is a general context, for memory allocation
functions, or NULL for standard memory allocation. The remaining arguments are
a starting size for the stack, and a maximum size to which it is allowed to
grow. The result can be passed to the JIT run-time code by calling
<b>pcre2_jit_stack_assign()</b> to associate the stack with a compiled pattern,
which can then be processed by <b>pcre2_match()</b>. If the "fast path" JIT
matcher, <b>pcre2_jit_match()</b> is used, the stack can be passed directly as
an argument. A maximum stack size of 512K to 1M should be more than enough for
any pattern. For more details, see the
<a href="pcre2jit.html"><b>pcre2jit</b></a>
page.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,68 @@
<html>
<head>
<title>pcre2_jit_stack_assign specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_jit_stack_assign man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>void pcre2_jit_stack_assign(const pcre2_code *<i>code</i>,</b>
<b> pcre2_jit_callback <i>callback_function</i>, void *<i>callback_data</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function provides control over the memory used as a stack at run-time by a
call to <b>pcre2_match()</b> or <b>pcre2_jit_match()</b> with a pattern that has
been successfully processed by the JIT compiler. The arguments are:
<pre>
code the pointer returned by <b>pcre2_compile()</b>
callback a callback function
callback_data a JIT stack or a value to be passed to the callback
</PRE>
</P>
<P>
If <i>callback</i> is NULL and <i>callback_data</i> is NULL, an internal 32K
block on the machine stack is used.
</P>
<P>
If <i>callback</i> is NULL and <i>callback_data</i> is not NULL,
<i>callback_data</i> must be a valid JIT stack, the result of calling
<b>pcre2_jit_stack_alloc()</b>.
</P>
<P>
If <i>callback</i> not NULL, it is called with <i>callback_data</i> as an
argument at the start of matching, in order to set up a JIT stack. If the
result is NULL, the internal 32K stack is used; otherwise the return value must
be a valid JIT stack, the result of calling <b>pcre2_jit_stack_alloc()</b>.
</P>
<P>
You may safely assign the same JIT stack to multiple patterns, as long as they
are all matched in the same thread. In a multithread application, each thread
must use its own JIT stack. For more details, see the
<a href="pcre2jit.html"><b>pcre2jit</b></a>
page.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,42 @@
<html>
<head>
<title>pcre2_jit_stack_free specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_jit_stack_free man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>void pcre2_jit_stack_free(pcre2_jit_stack *<i>jit_stack</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function is used to free a JIT stack that was created by
<b>pcre2_jit_stack_alloc()</b> when it is no longer needed. For more details,
see the
<a href="pcre2jit.html"><b>pcre2jit</b></a>
page.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,48 @@
<html>
<head>
<title>pcre2_maketables specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_maketables man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>const unsigned char *pcre2_maketables(pcre22_general_context *<i>gcontext</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function builds a set of character tables for character values less than
256. These can be passed to <b>pcre2_compile()</b> in a compile context in order
to override the internal, built-in tables (which were either defaulted or made
by <b>pcre2_maketables()</b> when PCRE2 was compiled). See the
<a href="pcre2_set_character_tables.html"><b>pcre2_set_character_tables()</b></a>
page. You might want to do this if you are using a non-standard locale.
</P>
<P>
If the argument is NULL, <b>malloc()</b> is used to get memory for the tables.
Otherwise it must point to a general context, which can supply pointers to a
custom memory manager. The function yields a pointer to the tables.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

76
doc/html/pcre2_match.html Normal file
View File

@ -0,0 +1,76 @@
<html>
<head>
<title>pcre2_match specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_match man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_match(const pcre2_code *<i>code</i>, PCRE2_SPTR <i>subject</i>,</b>
<b> PCRE2_SIZE <i>length</i>, PCRE2_SIZE <i>startoffset</i>,</b>
<b> uint32_t <i>options</i>, pcre2_match_data *<i>match_data</i>,</b>
<b> pcre2_match_context *<i>mcontext</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function matches a compiled regular expression against a given subject
string, using a matching algorithm that is similar to Perl's. It returns
offsets to captured substrings. Its arguments are:
<pre>
<i>code</i> Points to the compiled pattern
<i>subject</i> Points to the subject string
<i>length</i> Length of the subject string
<i>startoffset</i> Offset in the subject at which to start matching
<i>options</i> Option bits
<i>match_data</i> Points to a match data block, for results
<i>mcontext</i> Points to a match context, or is NULL
</pre>
A match context is needed only if you want to:
<pre>
Set up a callout function
Change the limit for calling the internal function <i>match()</i>
Change the limit for calling <i>match()</i> recursively
Set custom memory management when the heap is used for recursion
</pre>
The <i>length</i> and <i>startoffset</i> values are code
units, not characters. The options are:
<pre>
PCRE2_ANCHORED Match only at the first position
PCRE2_NOTBOL Subject string is not the beginning of a line
PCRE2_NOTEOL Subject string is not the end of a line
PCRE2_NOTEMPTY An empty string is not a valid match
PCRE2_NOTEMPTY_ATSTART An empty string at the start of the subject
is not a valid match
PCRE2_NO_UTF_CHECK Do not check the subject for UTF
validity (only relevant if PCRE2_UTF
was set at compile time)
PCRE2_PARTIAL_SOFT Return PCRE2_ERROR_PARTIAL for a partial
match if no full matches are found
PCRE2_PARTIAL_HARD Return PCRE2_ERROR_PARTIAL for a partial match
if that is found before a full match
</pre>
For details of partial matching, see the
<a href="pcre2partial.html"><b>pcre2partial</b></a>
page. There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,103 @@
<html>
<head>
<title>pcre2_pattern_info specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_pattern_info man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_pattern_info(const pcre2 *<i>code</i>, uint32_t <i>what</i>, void *<i>where</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function returns information about a compiled pattern. Its arguments are:
<pre>
<i>code</i> Compiled regular expression
<i>what</i> What information is required
<i>where</i> Where to put the information
</pre>
If <i>where</i> is NULL, the function returns the amount of memory needed for
the requested information, in bytes. The following information is available:
<pre>
PCRE2_INFO_ALLOPTIONS Final options after compiling
PCRE2_INFO_ARGOPTIONS Options passed to <b>pcre2_compile()</b>
PCRE2_INFO_BACKREFMAX Number of highest back reference
PCRE2_INFO_BSR What \R matches
0 all Unicode line endings
1 CR, LF, or CRLF only
PCRE2_INFO_CAPTURECOUNT Number of capturing subpatterns
PCRE2_INFO_FIRSTBITMAP Bitmap of first code units, or NULL
PCRE2_INFO_FIRSTCODEUNIT First code unit when type is 1
PCRE2_INFO_FIRSTCODETYPE Type of start-of-match information
0 nothing set
1 first code unit is set
2 start of string or after newline
PCRE2_INFO_HASCRORLF Return 1 if explicit CR or LF matches
exist in the pattern
PCRE2_INFO_JCHANGED Return 1 if (?J) or (?-J) was used
PCRE2_INFO_JITSIZE Size of JIT compiled code, or 0
PCRE2_INFO_LASTCODEUNIT Last code unit when type is 1
PCRE2_INFO_LASTCODETYPE Type of must-be-present information
0 nothing set
1 code unit is set
PCRE2_INFO_MATCHEMPTY 1 if the pattern can match an
empty string, 0 otherwise
PCRE2_INFO_MATCHLIMIT Match limit if set,
otherwise PCRE2_RROR_UNSET
PCRE2_INFO_MAXLOOKBEHIND Length (in characters) of the longest
lookbehind assertion
PCRE2_INFO_MINLENGTH Lower bound length of matching strings
PCRE2_INFO_NAMEENTRYSIZE Size of name table entries
PCRE2_INFO_NAMECOUNT Number of named subpatterns
PCRE2_INFO_NAMETABLE Pointer to name table
PCRE2_CONFIG_NEWLINE Code for the newline sequence:
1 for CR
2 for LF
3 for CRLF
4 for ANY
5 for ANYCRLF
PCRE2_INFO_RECURSIONLIMIT Recursion limit if set,
otherwise PCRE2_ERROR_UNSET
PCRE2_INFO_SIZE Size of compiled pattern
</pre>
The <i>where</i> argument must point to an unsigned 32-bit integer (uint32_t
variable), except for the following <i>what</i> values:
<pre>
PCRE2_INFO_FIRSTBITMAP const uint8_t
PCRE2_INFO_JITSIZE size_t
PCRE2_INFO_NAMETABLE PCRE2_SPTR
PCRE2_INFO_SIZE size_t
</pre>
The yield of the function is zero on success or:
<pre>
PCRE2_ERROR_NULL the argument <i>code</i> is NULL
PCRE2_ERROR_BADMAGIC the "magic number" was not found
PCRE2_ERROR_BADOPTION the value of <i>what</i> is invalid
PCRE2_ERROR_BADMODE the pattern was compiled in the wrong mode
PCRE2_ERROR_UNSET the requested information is not set
</PRE>
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,50 @@
<html>
<head>
<title>pcre2_substring_copy_byname specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_substring_copy_byname man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_substring_copy_byname(pcre2_match_data *<i>match_data</i>,</b>
<b> PCRE2_SPTR <i>name</i>, PCRE2_UCHAR *<i>buffer</i>, PCRE2_SIZE *<i>bufflen</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This is a convenience function for extracting a captured substring, identified
by name, into a given buffer. The arguments are:
<pre>
<i>match_data</i> The match data block for the match
<i>name</i> Name of the required substring
<i>buffer</i> Buffer to receive the string
<i>bufflen</i> Length of buffer (code units)
</pre>
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, PCRE2_ERROR_NOMEMORY if the buffer is too small, or
PCRE2_ERROR_NOSUBSTRING if the string name is invalid.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,51 @@
<html>
<head>
<title>pcre2_substring_copy_bynumber specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_substring_copy_bynumber man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_substring_copy_bynumber(pcre2_match_data *<i>match_data</i>,</b>
<b> unsigned int <i>number</i>, PCRE2_UCHAR *<i>buffer</i>,</b>
<b> PCRE2_SIZE *<i>bufflen</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This is a convenience function for extracting a captured substring into a given
buffer. The arguments are:
<pre>
<i>match_data</i> The match data block for the match
<i>number</i> Number of the required substring
<i>buffer</i> Buffer to receive the string
<i>bufflen</i> Length of buffer
</pre>
The <i>bufflen</i> variable is updated with the length of the extracted string,
excluding the terminating zero. The yield of the function is zero for success,
PCRE2_ERROR_NOMEMORY if the buffer was too small, or PCRE2_ERROR_NOSUBSTRING if
the string number is invalid.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,41 @@
<html>
<head>
<title>pcre2_substring_free specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_substring_free man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>void pcre2_substring_free(PCRE2_UCHAR *<i>buffer</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This is a convenience function for freeing the memory obtained by a previous
call to <b>pcre2_substring_get_byname()</b> or
<b>pcre2_substring_get_bynumber()</b>. Its only argument is a pointer to the
string.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,52 @@
<html>
<head>
<title>pcre2_substring_get_byname specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_substring_get_byname man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_substring_get_byname(pcre2_match_data *<i>match_data</i>,</b>
<b> PCRE2_SPTR <i>name</i>, PCRE2_UCHAR **<i>bufferptr</i>, PCRE2_SIZE *<i>bufflen</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This is a convenience function for extracting a captured substring by name into
newly acquired memory. The arguments are:
<pre>
<i>match_data</i> The match data for the match
<i>name</i> Name of the required substring
<i>bufferptr</i> Where to put the string pointer
<i>bufflen</i> Where to put the string length
</pre>
The memory in which the substring is placed is obtained by calling the same
memory allocation function that was used for the match data block. The
convenience function <b>pcre2_substring_free()</b> can be used to free it when
it is no longer needed. The yield of the function is zero for success,
PCRE2_ERROR_NOMEMORY if sufficient memory could not be obtained, or
PCRE2_ERROR_NOSUBSTRING if the string name is invalid.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,52 @@
<html>
<head>
<title>pcre2_substring_get_bynumber specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_substring_get_bynumber man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_substring_get_bynumber(pcre2_match_data *<i>match_data</i>,</b>
<b> unsigned int <i>number</i>, PCRE2_UCHAR **<i>bufferptr</i>, PCRE2_SIZE *<i>bufflen</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This is a convenience function for extracting a captured substring by number into
newly acquired memory. The arguments are:
<pre>
<i>match_data</i> The match data for the match
<i>number</i> Number of the required substring
<i>bufferptr</i> Where to put the string pointer
<i>bufflen</i> Where to put the string length
</pre>
The memory in which the substring is placed is obtained by calling the same
memory allocation function that was used for the match data block. The
convenience function <b>pcre2_substring_free()</b> can be used to free it when
it is no longer needed. The yield of the function is zero for success,
PCRE2_ERROR_NOMEMORY if sufficient memory could not be obtained, or
PCRE2_ERROR_NOSUBSTRING if the string number is invalid.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,46 @@
<html>
<head>
<title>pcre2_substring_length_byname specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_substring_length_byname man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_substring_length_byname(pcre2_match_data *<i>match_data</i>,</b>
<b> PCRE2_SPTR <i>name</i>, PCRE2_SIZE *<i>length</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function returns the length of a matched substring, identified by name.
The arguments are:
<pre>
<i>match_data</i> The match data block for the match
<i>name</i> The substring name
<i>length</i> Where to return the length
</pre>
The yield is zero on success, or an error code if the substring is not found.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,46 @@
<html>
<head>
<title>pcre2_substring_length_bynumber specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_substring_length_bynumber man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_substring_length_bynumber(pcre2_match_data *<i>match_data</i>,</b>
<b> unsigned int <i>number</i>, PCRE2_SIZE *<i>length</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function returns the length of a matched substring, identified by number.
The arguments are:
<pre>
<i>match_data</i> The match data block for the match
<i>number</i> The substring number
<i>length</i> Where to return the length
</pre>
The yield is zero on success, or an error code if the substring is not found.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,40 @@
<html>
<head>
<title>pcre2_substring_list_free specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_substring_list_free man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>void pcre2_substring_list_free(PCRE2_SPTR *<i>list</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This is a convenience function for freeing the store obtained by a previous
call to <b>pcre2substring_list_get()</b>. Its only argument is a pointer to
the list of string pointers.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,56 @@
<html>
<head>
<title>pcre2_substring_list_get specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_substring_list_get man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_substring_list_get(pcre2_match_data *<i>match_data</i>,</b>
<b>" PCRE2_UCHAR ***<i>listptr</i>, PCRE2_SIZE **<i>lengthsptr</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This is a convenience function for extracting all the captured substrings after
a pattern match. It builds a list of pointers to the strings, and (optionally)
a second list that contains their lengths (in code units), excluding a
terminating zero that is added to each of them. All this is done in a single
block of memory that is obtained using the same memory allocation function that
was used to get the match data block. The convenience function
<b>pcre2_substring_list_free()</b> can be used to free it when it is no longer
needed. The arguments are:
<pre>
<i>match_data</i> The match data block
<i>listptr</i> Where to put a pointer to the list
<i>lengthsptr</i> Where to put a pointer to the lengths, or NULL
</pre>
A pointer to a list of pointers is put in the variable whose address is in
<i>listptr</i>. The list is terminated by a NULL pointer. If <i>lengthsptr</i> is
not NULL, a matching list of lengths is created, and its address is placed in
<i>lengthsptr</i>. The yield of the function is zero on success or
PCRE2_ERROR_NOMEMORY if sufficient memory could not be obtained.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,53 @@
<html>
<head>
<title>pcre2_substring_nametable_scan specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_substring_nametable_scan man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_substring_nametable_scan(const pcre2_code *<i>code</i>,</b>
<b> PCRE2_SPTR <i>name</i>, PCRE2_SPTR *<i>first</i>, PCRE2_SPTR *<i>last</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This convenience function finds, for a compiled pattern, the first and last
entries for a given name in the table that translates capturing parenthesis
names into numbers.
<pre>
<i>code</i> Compiled regular expression
<i>name</i> Name whose entries required
<i>first</i> Where to return a pointer to the first entry
<i>last</i> Where to return a pointer to the last entry
</pre>
When the name is found in the table, if <i>first</i> is NULL, the function
returns a group number, but if there is more than one matching entry, it is not
defined which one. Otherwise, when both pointers have been set, the yield of
the function is the length of each entry in code units. If the name is not
found, PCRE2_ERROR_NOSUBSTRING is returned.
</P>
<P>
There is a complete description of the PCRE2 native API, including the format of
the table entries, in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page, and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -0,0 +1,49 @@
<html>
<head>
<title>pcre2_substring_number_from_name specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_substring_number_from_name man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_substring_number_from_name(const pcre2_code *<i>code</i>,</b>
<b> PCRE2_SPTR <i>name</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This convenience function finds the number of a named substring capturing
parenthesis in a compiled pattern. Its arguments are:
<pre>
<i>code</i> Compiled regular expression
<i>name</i> Name whose number is required
</pre>
The yield of the function is the number of the parenthesis if the name is
found, or PCRE2_ERROR_NOSUBSTRING otherwise. When duplicate names are allowed
(PCRE2_DUPNAMES is set), it is not defined which of the numbers is returned.
You can obtain the complete list by calling
<b>pcre2_substring_nametable_scan()</b>.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -374,7 +374,7 @@ performance. The JIT-specific functions are discussed in the
documentation. documentation.
</P> </P>
<P> <P>
A second matching function, <b>pcre2_dfa_exec()</b>, which is not A second matching function, <b>pcre2_dfa_match()</b>, which is not
Perl-compatible, is also provided. This uses a different algorithm for the Perl-compatible, is also provided. This uses a different algorithm for the
matching. The alternative algorithm finds all possible matches (at a given matching. The alternative algorithm finds all possible matches (at a given
point in the subject), and scans the subject just once (unless there are point in the subject), and scans the subject just once (unless there are
@ -641,17 +641,13 @@ The match context
A match context is required if you want to change the default values of any A match context is required if you want to change the default values of any
of the following match-time parameters: of the following match-time parameters:
<pre> <pre>
What \R matches (Unicode newlines or CR, LF, CRLF only); A callout function
A callout function; The limit for calling <i>match()</i>
The limit for calling <i>match()</i>; The limit for calling <i>match()</i> recursively
The limit for calling <i>match()</i> recursively;
The newline character sequence;
</pre> </pre>
A match context is also required if you are using custom memory management. A match context is also required if you are using custom memory management.
If none of these apply, just pass NULL as the context argument of If none of these apply, just pass NULL as the context argument of
<b>pcre2_match()</b>, <b>pcre2_dfa_match()</b>, or <b>pcre2_jit_match()</b>. <b>pcre2_match()</b>, <b>pcre2_dfa_match()</b>, or <b>pcre2_jit_match()</b>.
Changing the newline value or what \R matches at match time disables the use
of JIT via <b>pcre2_match()</b>.
</P> </P>
<P> <P>
A match context is created, copied, and freed by the following functions: A match context is created, copied, and freed by the following functions:

View File

@ -79,7 +79,9 @@ second is a set of option bits, which must include at least one of
PCRE2_JIT_COMPLETE, PCRE2_JIT_PARTIAL_HARD, or PCRE2_JIT_PARTIAL_SOFT. PCRE2_JIT_COMPLETE, PCRE2_JIT_PARTIAL_HARD, or PCRE2_JIT_PARTIAL_SOFT.
</P> </P>
<P> <P>
The returned value from <b>pcre2_jit_compile()</b> is FIXME FIXME. The returned value from <b>pcre2_jit_compile()</b> is zero on success, or a
negative error code. In particular, PCRE2_ERROR_JIT_BADOPTION is returned if
JIT is not supported or if an unknown options bit is set.
</P> </P>
<P> <P>
PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for complete PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for complete
@ -361,8 +363,12 @@ processed by <b>pcre2_jit_compile()</b>).
<P> <P>
The fast path function is called <b>pcre2_jit_match()</b>, and it takes exactly The fast path function is called <b>pcre2_jit_match()</b>, and it takes exactly
the same arguments as <b>pcre2_match()</b>, plus one additional argument that the same arguments as <b>pcre2_match()</b>, plus one additional argument that
must point to a JIT stack. The JIT stack arrangements described above do not must either point to a JIT stack or be NULL. In the latter case, if a callback
apply. The return values are the same as for <b>pcre2_match()</b>. function has been set up by <b>pcre2_jit_stack_alloc()</b>, it is called.
Otherwise the system stack is used. The return values are the same as for
<b>pcre2_match()</b>, plus PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial
or complete) is requested that was not compiled. Unsupported option bits are
ignored.
</P> </P>
<P> <P>
When you call <b>pcre2_match()</b>, as well as testing for invalid options, a When you call <b>pcre2_match()</b>, as well as testing for invalid options, a
@ -391,7 +397,7 @@ Cambridge CB2 3QH, England.
</P> </P>
<br><a name="SEC12" href="#TOC1">REVISION</a><br> <br><a name="SEC12" href="#TOC1">REVISION</a><br>
<P> <P>
Last updated: 29 September 2014 Last updated: 21 October 2014
<br> <br>
Copyright &copy; 1997-2014 University of Cambridge. Copyright &copy; 1997-2014 University of Cambridge.
<br> <br>

View File

@ -17,16 +17,16 @@ first.
</p> </p>
<table> <table>
<tr><td><a href="pcre2.html">pcre</a></td> <tr><td><a href="pcre2.html">pcre2</a></td>
<td>&nbsp;&nbsp;Introductory page</td></tr> <td>&nbsp;&nbsp;Introductory page</td></tr>
<tr><td><a href="pcre2-config.html">pcre-config</a></td> <tr><td><a href="pcre2-config.html">pcre-2config</a></td>
<td>&nbsp;&nbsp;Information about the installation configuration</td></tr> <td>&nbsp;&nbsp;Information about the installation configuration</td></tr>
<tr><td><a href="pcre2api.html">pcreapi</a></td> <tr><td><a href="pcre2api.html">pcre2api</a></td>
<td>&nbsp;&nbsp;PCRE2's native API</td></tr> <td>&nbsp;&nbsp;PCRE2's native API</td></tr>
<tr><td><a href="pcre2build.html">pcrebuild</a></td> <tr><td><a href="pcre2build.html">pcre2build</a></td>
<td>&nbsp;&nbsp;Building PCRE2</td></tr> <td>&nbsp;&nbsp;Building PCRE2</td></tr>
<tr><td><a href="pcre2callout.html">pcre2callout</a></td> <tr><td><a href="pcre2callout.html">pcre2callout</a></td>
@ -62,9 +62,6 @@ first.
<tr><td><a href="pcre2posix.html">pcre2posix</a></td> <tr><td><a href="pcre2posix.html">pcre2posix</a></td>
<td>&nbsp;&nbsp;The POSIX API to the PCRE2 8-bit library</td></tr> <td>&nbsp;&nbsp;The POSIX API to the PCRE2 8-bit library</td></tr>
<tr><td><a href="pcre2precompile.html">pcre2precompile</a></td>
<td>&nbsp;&nbsp;How to save and re-use compiled patterns</td></tr>
<tr><td><a href="pcre2sample.html">pcre2sample</a></td> <tr><td><a href="pcre2sample.html">pcre2sample</a></td>
<td>&nbsp;&nbsp;Discussion of the pcre2demo program</td></tr> <td>&nbsp;&nbsp;Discussion of the pcre2demo program</td></tr>
@ -83,17 +80,16 @@ first.
<p> <p>
There are also individual pages that summarize the interface for each function There are also individual pages that summarize the interface for each function
in the library. There is a single page for each triple of 8-bit/16-bit/32-bit in the library.
functions.
</p> </p>
<table> <table>
<tr><td><a href="pcre2_assign_jit_stack.html">pcre2_assign_jit_stack</a></td> <tr><td><a href="pcre2_code_free.html">pcre2_code_free</a></td>
<td>&nbsp;&nbsp;Assign stack for JIT matching</td></tr> <td>&nbsp;&nbsp;Free a compiled pattern</td></tr>
<tr><td><a href="pcre2_compile.html">pcre2_compile</a></td> <tr><td><a href="pcre2_compile.html">pcre2_compile</a></td>
<td>&nbsp;&nbsp;Compile a regular expression</td></tr> <td>&nbsp;&nbsp;Compile a regular expression pattern</td></tr>
<tr><td><a href="pcre2_compile2.html">pcre2_compile2</a></td> <tr><td><a href="pcre2_compile2.html">pcre2_compile2</a></td>
<td>&nbsp;&nbsp;Compile a regular expression (alternate interface)</td></tr> <td>&nbsp;&nbsp;Compile a regular expression (alternate interface)</td></tr>
@ -101,76 +97,70 @@ functions.
<tr><td><a href="pcre2_config.html">pcre2_config</a></td> <tr><td><a href="pcre2_config.html">pcre2_config</a></td>
<td>&nbsp;&nbsp;Show build-time configuration options</td></tr> <td>&nbsp;&nbsp;Show build-time configuration options</td></tr>
<tr><td><a href="pcre2_copy_named_substring.html">pcre2_copy_named_substring</a></td> <tr><td><a href="pcre2_dfa_match.html">pcre2_dfa_match</a></td>
<td>&nbsp;&nbsp;Extract named substring into given buffer</td></tr>
<tr><td><a href="pcre2_copy_substring.html">pcre2_copy_substring</a></td>
<td>&nbsp;&nbsp;Extract numbered substring into given buffer</td></tr>
<tr><td><a href="pcre2_dfa_exec.html">pcre2_dfa_exec</a></td>
<td>&nbsp;&nbsp;Match a compiled pattern to a subject string <td>&nbsp;&nbsp;Match a compiled pattern to a subject string
(DFA algorithm; <i>not</i> Perl compatible)</td></tr> (DFA algorithm; <i>not</i> Perl compatible)</td></tr>
<tr><td><a href="pcre2_exec.html">pcre2_exec</a></td> <tr><td><a href="pcre2_get_error_message.html">pcre2_get_error_message</a></td>
<td>&nbsp;&nbsp;Match a compiled pattern to a subject string
(Perl compatible)</td></tr>
<tr><td><a href="pcre2_free_study.html">pcre2_free_study</a></td>
<td>&nbsp;&nbsp;Free study data</td></tr> <td>&nbsp;&nbsp;Free study data</td></tr>
<tr><td><a href="pcre2_free_substring.html">pcre2_free_substring</a></td> <tr><td><a href="pcre2_jit_compile.html">pcre2_jit_compile</a></td>
<td>&nbsp;&nbsp;Free extracted substring</td></tr> <td>&nbsp;&nbsp;Process a compiled pattern with the JIT compiler</td></tr>
<tr><td><a href="pcre2_free_substring_list.html">pcre2_free_substring_list</a></td> <tr><td><a href="pcre2_jit_match.html">pcre2_jit_match</a></td>
<td>&nbsp;&nbsp;Free list of extracted substrings</td></tr>
<tr><td><a href="pcre2_fullinfo.html">pcre2_fullinfo</a></td>
<td>&nbsp;&nbsp;Extract information about a pattern</td></tr>
<tr><td><a href="pcre2_get_named_substring.html">pcre2_get_named_substring</a></td>
<td>&nbsp;&nbsp;Extract named substring into new memory</td></tr>
<tr><td><a href="pcre2_get_stringnumber.html">pcre2_get_stringnumber</a></td>
<td>&nbsp;&nbsp;Convert captured string name to number</td></tr>
<tr><td><a href="pcre2_get_stringtable_entries.html">pcre2_get_stringtable_entries</a></td>
<td>&nbsp;&nbsp;Find table entries for given string name</td></tr>
<tr><td><a href="pcre2_get_substring.html">pcre2_get_substring</a></td>
<td>&nbsp;&nbsp;Extract numbered substring into new memory</td></tr>
<tr><td><a href="pcre2_get_substring_list.html">pcre2_get_substring_list</a></td>
<td>&nbsp;&nbsp;Extract all substrings into new memory</td></tr>
<tr><td><a href="pcre2_jit_exec.html">pcre2_jit_exec</a></td>
<td>&nbsp;&nbsp;Fast path interface to JIT matching</td></tr> <td>&nbsp;&nbsp;Fast path interface to JIT matching</td></tr>
<tr><td><a href="pcre2_jit_stack_alloc.html">pcre2_jit_stack_alloc</a></td> <tr><td><a href="pcre2_jit_stack_alloc.html">pcre2_jit_stack_alloc</a></td>
<td>&nbsp;&nbsp;Create a stack for JIT matching</td></tr> <td>&nbsp;&nbsp;Create a stack for JIT matching</td></tr>
<tr><td><a href="pcre2_jit_stack_assign.html">pcre2_jit_stack_assign</a></td>
<td>&nbsp;&nbsp;Assign stack for JIT matching</td></tr>
<tr><td><a href="pcre2_jit_stack_free.html">pcre2_jit_stack_free</a></td> <tr><td><a href="pcre2_jit_stack_free.html">pcre2_jit_stack_free</a></td>
<td>&nbsp;&nbsp;Free a JIT matching stack</td></tr> <td>&nbsp;&nbsp;Free a JIT matching stack</td></tr>
<tr><td><a href="pcre2_maketables.html">pcre2_maketables</a></td> <tr><td><a href="pcre2_maketables.html">pcre2_maketables</a></td>
<td>&nbsp;&nbsp;Build character tables in current locale</td></tr> <td>&nbsp;&nbsp;Build character tables in current locale</td></tr>
<tr><td><a href="pcre2_pattern_to_host_byte_order.html">pcre2_pattern_to_host_byte_order</a></td> <tr><td><a href="pcre2_match.html">pcre2_match</a></td>
<td>&nbsp;&nbsp;Convert compiled pattern to host byte order if necessary</td></tr> <td>&nbsp;&nbsp;Match a compiled pattern to a subject string
(Perl compatible)</td></tr>
<tr><td><a href="pcre2_refcount.html">pcre2_refcount</a></td> <tr><td><a href="pcre2_pattern_info.html">pcre2_pattern_info</a></td>
<td>&nbsp;&nbsp;Maintain reference count in compiled pattern</td></tr> <td>&nbsp;&nbsp;Extract information about a pattern</td></tr>
<tr><td><a href="pcre2_study.html">pcre2_study</a></td> <tr><td><a href="pcre2_substring_copy_byname.html">pcre2_substring_copy_byname</a></td>
<td>&nbsp;&nbsp;Study a compiled pattern</td></tr> <td>&nbsp;&nbsp;Extract named substring into given buffer</td></tr>
<tr><td><a href="pcre2_utf16_to_host_byte_order.html">pcre2_utf16_to_host_byte_order</a></td> <tr><td><a href="pcre2_substring_copy_bynumber.html">pcre2_substring_copy_bynumber</a></td>
<td>&nbsp;&nbsp;Convert UTF-16 string to host byte order if necessary</td></tr> <td>&nbsp;&nbsp;Extract numbered substring into given buffer</td></tr>
<tr><td><a href="pcre2_utf32_to_host_byte_order.html">pcre2_utf32_to_host_byte_order</a></td> <tr><td><a href="pcre2_substring_free.html">pcre2_substring_free</a></td>
<td>&nbsp;&nbsp;Convert UTF-32 string to host byte order if necessary</td></tr> <td>&nbsp;&nbsp;Free extracted substring</td></tr>
<tr><td><a href="pcre2_version.html">pcre2_version</a></td> <tr><td><a href="pcre2_substring_get_byname.html">pcre2_substring_get_byname</a></td>
<td>&nbsp;&nbsp;Return PCRE2 version and release date</td></tr> <td>&nbsp;&nbsp;Extract named substring into new memory</td></tr>
<tr><td><a href="pcre2_substring_get_bynumber.html">pcre2_substring_get_bynumber</a></td>
<td>&nbsp;&nbsp;Extract numbered substring into new memory</td></tr>
<tr><td><a href="pcre2_substring_length_byname.html">pcre2_substring_length_byname</a></td>
<td>&nbsp;&nbsp;Find length of named substring</td></tr>
<tr><td><a href="pcre2_substring_length_bynumber.html">pcre2_substring_length_bynumber</a></td>
<td>&nbsp;&nbsp;Find length of numbered substring</td></tr>
<tr><td><a href="pcre2_substring_list_free.html">pcre2_substring_list_free</a></td>
<td>&nbsp;&nbsp;Free list of extracted substrings</td></tr>
<tr><td><a href="pcre2_substring_list_get.html">pcre2_substring_list_get</a></td>
<td>&nbsp;&nbsp;Extract all substrings into new memory</td></tr>
<tr><td><a href="pcre2_substring_nametable_scan.html">pcre2_substring_nametable_scan</a></td>
<td>&nbsp;&nbsp;Find table entries for given string name</td></tr>
<tr><td><a href="pcre2_substring_number_from_name.html">pcre2_substring_number_from_name</a></td>
<td>&nbsp;&nbsp;Convert captured string name to number</td></tr>
</table> </table>
</html> </html>

View File

@ -446,14 +446,15 @@ PCRE2 API OVERVIEW
performance. The JIT-specific functions are discussed in the pcre2jit performance. The JIT-specific functions are discussed in the pcre2jit
documentation. documentation.
A second matching function, pcre2_dfa_exec(), which is not Perl-compat- A second matching function, pcre2_dfa_match(), which is not Perl-com-
ible, is also provided. This uses a different algorithm for the match- patible, is also provided. This uses a different algorithm for the
ing. The alternative algorithm finds all possible matches (at a given matching. The alternative algorithm finds all possible matches (at a
point in the subject), and scans the subject just once (unless there given point in the subject), and scans the subject just once (unless
are lookbehind assertions). However, this algorithm does not return there are lookbehind assertions). However, this algorithm does not
captured substrings. A description of the two matching algorithms and return captured substrings. A description of the two matching algo-
their advantages and disadvantages is given in the pcre2matching docu- rithms and their advantages and disadvantages is given in the
mentation. There is no JIT support for pcre2_dfa_match(). pcre2matching documentation. There is no JIT support for
pcre2_dfa_match().
In addition to the main compiling and matching functions, there are In addition to the main compiling and matching functions, there are
convenience functions for extracting captured substrings from a subject convenience functions for extracting captured substrings from a subject
@ -699,17 +700,13 @@ PCRE2 CONTEXTS
A match context is required if you want to change the default values of A match context is required if you want to change the default values of
any of the following match-time parameters: any of the following match-time parameters:
What \R matches (Unicode newlines or CR, LF, CRLF only); A callout function
A callout function; The limit for calling match()
The limit for calling match(); The limit for calling match() recursively
The limit for calling match() recursively;
The newline character sequence;
A match context is also required if you are using custom memory manage- A match context is also required if you are using custom memory manage-
ment. If none of these apply, just pass NULL as the context argument ment. If none of these apply, just pass NULL as the context argument
of pcre2_match(), pcre2_dfa_match(), or pcre2_jit_match(). Changing of pcre2_match(), pcre2_dfa_match(), or pcre2_jit_match().
the newline value or what \R matches at match time disables the use of
JIT via pcre2_match().
A match context is created, copied, and freed by the following func- A match context is created, copied, and freed by the following func-
tions: tions:
@ -3465,7 +3462,9 @@ SIMPLE USE OF JIT
second is a set of option bits, which must include at least one of second is a set of option bits, which must include at least one of
PCRE2_JIT_COMPLETE, PCRE2_JIT_PARTIAL_HARD, or PCRE2_JIT_PARTIAL_SOFT. PCRE2_JIT_COMPLETE, PCRE2_JIT_PARTIAL_HARD, or PCRE2_JIT_PARTIAL_SOFT.
The returned value from pcre2_jit_compile() is FIXME FIXME. The returned value from pcre2_jit_compile() is zero on success, or a
negative error code. In particular, PCRE2_ERROR_JIT_BADOPTION is
returned if JIT is not supported or if an unknown options bit is set.
PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for com- PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for com-
plete matches. If you want to run partial matches using the PCRE2_PAR- plete matches. If you want to run partial matches using the PCRE2_PAR-
@ -3726,9 +3725,12 @@ JIT FAST PATH API
The fast path function is called pcre2_jit_match(), and it takes The fast path function is called pcre2_jit_match(), and it takes
exactly the same arguments as pcre2_match(), plus one additional argu- exactly the same arguments as pcre2_match(), plus one additional argu-
ment that must point to a JIT stack. The JIT stack arrangements ment that must either point to a JIT stack or be NULL. In the latter
described above do not apply. The return values are the same as for case, if a callback function has been set up by
pcre2_match(). pcre2_jit_stack_alloc(), it is called. Otherwise the system stack is
used. The return values are the same as for pcre2_match(), plus
PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial or complete) is
requested that was not compiled. Unsupported option bits are ignored.
When you call pcre2_match(), as well as testing for invalid options, a When you call pcre2_match(), as well as testing for invalid options, a
number of other sanity checks are performed on the arguments. For exam- number of other sanity checks are performed on the arguments. For exam-
@ -3755,7 +3757,7 @@ AUTHOR
REVISION REVISION
Last updated: 29 September 2014 Last updated: 21 October 2014
Copyright (c) 1997-2014 University of Cambridge. Copyright (c) 1997-2014 University of Cambridge.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------

27
doc/pcre2_code_free.3 Normal file
View File

@ -0,0 +1,27 @@
.TH PCRE2_CODE_FREE 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B pcre2_code_free(pcre2_code *\fIcode\fP);
.fi
.
.SH DESCRIPTION
.rs
.sp
This function frees the memory used for a compiled pattern, including any
memory used by the JIT compiler.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

75
doc/pcre2_compile.3 Normal file
View File

@ -0,0 +1,75 @@
.TH PCRE2_COMPILE 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B pcre2_code *pcre2_compile(PCRE2_SPTR \fIpattern\fP, PCRE2_SIZE \fIlength\fP,
.B " uint32_t \fIoptions\fP, int *\fIerrorcode\fP, PCRE2_SIZE *\fIerroroffset,\fP"
.B " pcre2_compile_context *\fIccontext\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This function compiles a regular expression pattern into an internal form. Its
arguments are:
.sp
\fIpattern\fP A string containing expression to be compiled
\fIlength\fP The length of the string or PCRE2_ZERO_TERMINATED
\fIoptions\fP Option bits
\fIerrorcode\fP Where to put an error code
\fIerroffset\fP Where to put an error offset
\fIccontext\fP Pointer to a compile context or NULL
.sp
The length of the string and any error offset that is returned are in code
units, not characters. A compile context is needed only if you want to change
.sp
What \eR matches (Unicode newlines or CR, LF, CRLF only)
PCRE2's character tables
The newline character sequence
The compile time nested parentheses limit
.sp
or provide an external function for stack size checking. The option bits are:
.sp
PCRE2_ANCHORED Force pattern anchoring
PCRE2_ALT_BSUX Alternative handling of \eu, \eU, and \ex
PCRE2_AUTO_CALLOUT Compile automatic callouts
PCRE2_CASELESS Do caseless matching
PCRE2_DOLLAR_ENDONLY $ not to match newline at end
PCRE2_DOTALL . matches anything including NL
PCRE2_DUPNAMES Allow duplicate names for subpatterns
PCRE2_EXTENDED Ignore white space and # comments
PCRE2_FIRSTLINE Force matching to be before newline
PCRE2_MATCH_UNSET_BACKREF Match unset back references
PCRE2_MULTILINE ^ and $ match newlines within data
PCRE2_NEVER_UCP Lock out PCRE2_UCP, e.g. via (*UCP)
PCRE2_NEVER_UTF Lock out PCRE2_UTF, e.g. via (*UTF)
PCRE2_NO_AUTO_CAPTURE Disable numbered capturing paren-
theses (named ones available)
PCRE2_NO_AUTO_POSSESS Disable auto-possessification
PCRE2_NO_START_OPTIMIZE Disable match-time start optimizations
PCRE2_NO_UTF_CHECK Do not check the pattern for UTF validity
(only relevant if PCRE2_UTF is set)
PCRE2_UCP Use Unicode properties for \ed, \ew, etc.
PCRE2_UNGREEDY Invert greediness of quantifiers
PCRE2_UTF Treat pattern and subjects as UTF strings
.sp
PCRE2 must be built with Unicode support in order to use PCRE2_UTF, PCRE2_UCP
and related options.
.P
The yield of the function is a pointer to a private data structure that
contains the compiled pattern, or NULL if an error was detected.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

71
doc/pcre2_config.3 Normal file
View File

@ -0,0 +1,71 @@
.TH PCRE2_CONFIG 3 "20 April 2014" "PCRE2 10.0"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.SM
.B int pcre2_config(uint32_t \fIwhat\fP, void *\fIwhere\fP);
.
.SH DESCRIPTION
.rs
.sp
This function makes it possible for a client program to find out which optional
features are available in the version of the PCRE2 library it is using. The
arguments are as follows:
.sp
\fIwhat\fP A code specifying what information is required
\fIwhere\fP Points to where to put the information
.sp
If \fIwhere\fP is NULL, the function returns the amount of memory needed for
the requested information. When the information is a string, the value is in
code units; for other types of data it is in bytes.
.P
If \fBwhere\fP is not NULL, for PCRE2_CONFIG_JITTARGET,
PCRE2_CONFIG_UNICODE_VERSION, and PCRE2_CONFIG_VERSION it must point to a
buffer that is large enough to hold the string. For PCRE2_CONFIG_MATCHLIMIT,
PCRE2_CONFIG_PARENSLIMIT, and PCRE2_CONFIG_RECURSIONLIMIT it must point to an
unsigned long int variable, and for all other codes to an int variable. The
available codes are:
.sp
PCRE2_CONFIG_BSR Indicates what \eR matches by default:
0 all Unicode line endings
1 CR, LF, or CRLF only
PCRE2_CONFIG_JIT Availability of just-in-time compiler
support (1=yes 0=no)
PCRE2_CONFIG_JITTARGET Information about the target archi-
tecture for the JIT compiler
PCRE2_CONFIG_LINKSIZE Configured internal link size (2, 3, 4)
PCRE2_CONFIG_MATCHLIMIT Default internal resource limit
PCRE2_CONFIG_NEWLINE Code for the default newline sequence:
1 for CR
2 for LF
3 for CRLF
4 for ANY
5 for ANYCRLF
PCRE2_CONFIG_PARENSLIMIT Default parentheses nesting limit
PCRE2_CONFIG_RECURSIONLIMIT Internal recursion depth limit
PCRE2_CONFIG_STACKRECURSE Recursion implementation (1=stack
0=heap)
PCRE2_CONFIG_UNICODE Availability of Unicode support (1=yes
0=no)
PCRE2_CONFIG_UNICODE_VERSION The Unicode version (a string)
PCRE2_CONFIG_VERSION The PCRE2 version (a string)
.sp
The function yields a non-negative value on success or the negative value
PCRE2_ERROR_BADOPTION otherwise. This is also the result for the
PCRE2_CONFIG_JITTARGET code if JIT support is not available. When a string
is returned the yield is the length of the string, in code units, excluding the
terminating zero.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

72
doc/pcre2_dfa_match.3 Normal file
View File

@ -0,0 +1,72 @@
.TH PCRE2_DFA_MATCH 3 "12 May 2013" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_dfa_match(const pcre2_code *\fIcode\fP, PCRE2_SPTR \fIsubject\fP,
.B " PCRE2_SIZE \fIlength\fP, PCRE2_SIZE \fIstartoffset\fP,"
.B " uint32_t \fIoptions\fP, pcre2_match_data *\fImatch_data\fP,"
.B " pcre2_match_context *\fImcontext\fP,"
.B " int *\fIworkspace\fP, PCRE2_SIZE \fIwscount\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This function matches a compiled regular expression against a given subject
string, using an alternative matching algorithm that scans the subject string
just once (\fInot\fP Perl-compatible). (The Perl-compatible matching function
is \fBpcre2_match()\fP.) The arguments for this function are:
.sp
\fIcode\fP Points to the compiled pattern
\fIsubject\fP Points to the subject string
\fIlength\fP Length of the subject string
\fIstartoffset\fP Offset in the subject at which to start matching
\fIoptions\fP Option bits
\fImatch_data\fP Points to a match data block, for results
\fImcontext\fP Points to a match context, or is NULL
\fIworkspace\fP Points to a vector of ints used as working space
\fIwscount\fP Number of elements in the vector
.sp
For \fBpcre2_dfa_match()\fP, a match context is needed only if you want to set
up a callout function. The \fIlength\fP and \fIstartoffset\fP values are code
units, not characters. The options are:
.sp
PCRE2_ANCHORED Match only at the first position
PCRE2_NOTBOL Subject is not the beginning of a line
PCRE2_NOTEOL Subject is not the end of a line
PCRE2_NOTEMPTY An empty string is not a valid match
PCRE2_NOTEMPTY_ATSTART An empty string at the start of the subject
is not a valid match
PCRE2_NO_UTF_CHECK Do not check the subject for UTF
validity (only relevant if PCRE2_UTF
was set at compile time)
PCRE2_PARTIAL_SOFT Return PCRE2_ERROR_PARTIAL for a partial
match if no full matches are found
PCRE2_PARTIAL_HARD Return PCRE2_ERROR_PARTIAL for a partial match
even if there is a full match as well
PCRE2_DFA_RESTART Restart after a partial match
PCRE2_DFA_SHORTEST Return only the shortest match
.sp
There are restrictions on what may appear in a pattern when using this matching
function. Details are given in the
.\" HREF
\fBpcre2matching\fP
.\"
documentation. For details of partial matching, see the
.\" HREF
\fBpcre2partial\fP
.\"
page. There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,36 @@
.TH PCRE2_GET_ERROR_MESSAGE 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_get_error_message(int \fIerrorcode\fP, PCRE2_UCHAR *\fIbuffer\fP,
.B " PCRE2_SIZE \fIbufflen\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This function provides a textual error message for each PCRE2 error code.
Compilation errors are positive numbers; UTF formatting errors and matching
errors are negative numbers. The arguments are:
.sp
\fIerrorcode\fP an error code (positive or negative)
\fIbuffer\fP where to put the message
\fIbufflen\fP the length of the buffer (code units)
.sp
The function returns the length of the message, excluding the trailing zero, or
a negative error code if the buffer is too small.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

45
doc/pcre2_jit_compile.3 Normal file
View File

@ -0,0 +1,45 @@
.TH PCRE2_JIT_COMPILE 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_jit_compile(pcre2_code *\fIcode\fP, uint32_t \fIoptions\fP);
.fi
.
.SH DESCRIPTION
.rs
.sp
This function requests JIT compilation, which, if the just-in-time compiler is
available, further processes a compiled pattern into machine code that executes
much faster than the \fBpcre2_match()\fP interpretive matching function. Full
details are given in the
.\" HREF
\fBpcre2jit\fP
.\"
documentation.
.P
The first argument is a pointer that was returned by a successful call to
\fBpcre2_compile()\fP, and the second must contain one or more of the following
bits:
.sp
PCRE2_JIT_COMPLETE compile code for full matching
PCRE2_JIT_PARTIAL_SOFT compile code for soft partial matching
PCRE2_JIT_PARTIAL_HARD compile code for hard partial matching
.sp
The yield of the function is 0 for success, or a negative error code otherwise.
In particular, PCRE2_ERROR_JIT_BADOPTION is returned if JIT is not supported or
if an unknown bit is set in \fIoptions\fP.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

52
doc/pcre2_jit_match.3 Normal file
View File

@ -0,0 +1,52 @@
.TH PCRE2_JIT_MATCH 3 "21 October 2014" "PCRE2 10.0"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_jit_match(const pcre2_code *\fIcode\fP, PCRE2_SPTR \fIsubject\fP,
.B " PCRE2_SIZE \fIlength\fP, PCRE2_SIZE \fIstartoffset\fP,"
.B " uint32_t \fIoptions\fP, pcre2_match_data *\fImatch_data\fP,"
.B " pcre2_match_context *\fImcontext\fP, pcre2_jit_stack *\fIjit_stack\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This function matches a compiled regular expression that has been successfully
processed by the JIT compiler against a given subject string, using a matching
algorithm that is similar to Perl's. It is a "fast path" interface to JIT, and
it bypasses some of the sanity checks that \fBpcre2_match()\fP applies.
Its arguments are exactly the same as for
.\" HREF
\fBpcre2_match()\fP
.\"
plus one additional argument that must either point to a JIT stack or be NULL.
In the latter case, if a callback function has been set up by
\fBpcre2_jit_stack_alloc()\fP, it is called. Otherwise the system stack is
used.
.P
The supported options are PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY,
PCRE2_NOTEMPTY_ATSTART, PCRE2_PARTIAL_HARD, and PCRE2_PARTIAL_SOFT. Unsupported
options are ignored. The subject string is not checked for UTF validity.
.P
The return values are the same as for \fBpcre2_match()\fP plus
PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial or complete) is requested
that was not compiled. For details of partial matching, see the
.\" HREF
\fBpcre2partial\fP
.\"
page.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the JIT API in the
.\" HREF
\fBpcre2jit\fP
.\"
page.

View File

@ -0,0 +1,40 @@
.TH PCRE2_JIT_STACK_ALLOC 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B pcre2_jit_stack *pcre2_jit_stack_alloc(pcre2_general_context *\fIgcontext\fP,
.B " PCRE2_SIZE \fIstartsize\fP, PCRE2_SIZE \fImaxsize\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This function is used to create a stack for use by the code compiled by the JIT
compiler. The first argument is a general context, for memory allocation
functions, or NULL for standard memory allocation. The remaining arguments are
a starting size for the stack, and a maximum size to which it is allowed to
grow. The result can be passed to the JIT run-time code by calling
\fBpcre2_jit_stack_assign()\fP to associate the stack with a compiled pattern,
which can then be processed by \fBpcre2_match()\fP. If the "fast path" JIT
matcher, \fBpcre2_jit_match()\fP is used, the stack can be passed directly as
an argument. A maximum stack size of 512K to 1M should be more than enough for
any pattern. For more details, see the
.\" HREF
\fBpcre2jit\fP
.\"
page.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,53 @@
.TH PCRE2_JIT_STACK_ASSIGN 3 "21 October 2014" "PCRE2 10.0"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B void pcre2_jit_stack_assign(const pcre2_code *\fIcode\fP,
.B " pcre2_jit_callback \fIcallback_function\fP, void *\fIcallback_data\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This function provides control over the memory used as a stack at run-time by a
call to \fBpcre2_match()\fP or \fBpcre2_jit_match()\fP with a pattern that has
been successfully processed by the JIT compiler. The arguments are:
.sp
code the pointer returned by \fBpcre2_compile()\fP
callback a callback function
callback_data a JIT stack or a value to be passed to the callback
.P
If \fIcallback\fP is NULL and \fIcallback_data\fP is NULL, an internal 32K
block on the machine stack is used.
.P
If \fIcallback\fP is NULL and \fIcallback_data\fP is not NULL,
\fIcallback_data\fP must be a valid JIT stack, the result of calling
\fBpcre2_jit_stack_alloc()\fP.
.P
If \fIcallback\fP not NULL, it is called with \fIcallback_data\fP as an
argument at the start of matching, in order to set up a JIT stack. If the
result is NULL, the internal 32K stack is used; otherwise the return value must
be a valid JIT stack, the result of calling \fBpcre2_jit_stack_alloc()\fP.
.P
You may safely assign the same JIT stack to multiple patterns, as long as they
are all matched in the same thread. In a multithread application, each thread
must use its own JIT stack. For more details, see the
.\" HREF
\fBpcre2jit\fP
.\"
page.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,31 @@
.TH PCRE2_JIT_STACK_FREE 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.SM
.B void pcre2_jit_stack_free(pcre2_jit_stack *\fIjit_stack\fP);
.
.SH DESCRIPTION
.rs
.sp
This function is used to free a JIT stack that was created by
\fBpcre2_jit_stack_alloc()\fP when it is no longer needed. For more details,
see the
.\" HREF
\fBpcre2jit\fP
.\"
page.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

36
doc/pcre2_maketables.3 Normal file
View File

@ -0,0 +1,36 @@
.TH PCRE2_MAKETABLES 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.SM
.B const unsigned char *pcre2_maketables(pcre22_general_context *\fIgcontext\fP);
.
.SH DESCRIPTION
.rs
.sp
This function builds a set of character tables for character values less than
256. These can be passed to \fBpcre2_compile()\fP in a compile context in order
to override the internal, built-in tables (which were either defaulted or made
by \fBpcre2_maketables()\fP when PCRE2 was compiled). See the
.\" HREF
\fBpcre2_set_character_tables()\fP
.\"
page. You might want to do this if you are using a non-standard locale.
.P
If the argument is NULL, \fBmalloc()\fP is used to get memory for the tables.
Otherwise it must point to a general context, which can supply pointers to a
custom memory manager. The function yields a pointer to the tables.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

67
doc/pcre2_match.3 Normal file
View File

@ -0,0 +1,67 @@
.TH PCRE2_MATCH 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_match(const pcre2_code *\fIcode\fP, PCRE2_SPTR \fIsubject\fP,
.B " PCRE2_SIZE \fIlength\fP, PCRE2_SIZE \fIstartoffset\fP,"
.B " uint32_t \fIoptions\fP, pcre2_match_data *\fImatch_data\fP,"
.B " pcre2_match_context *\fImcontext\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This function matches a compiled regular expression against a given subject
string, using a matching algorithm that is similar to Perl's. It returns
offsets to captured substrings. Its arguments are:
.sp
\fIcode\fP Points to the compiled pattern
\fIsubject\fP Points to the subject string
\fIlength\fP Length of the subject string
\fIstartoffset\fP Offset in the subject at which to start matching
\fIoptions\fP Option bits
\fImatch_data\fP Points to a match data block, for results
\fImcontext\fP Points to a match context, or is NULL
.sp
A match context is needed only if you want to:
.sp
Set up a callout function
Change the limit for calling the internal function \fImatch()\fP
Change the limit for calling \fImatch()\fP recursively
Set custom memory management when the heap is used for recursion
.sp
The \fIlength\fP and \fIstartoffset\fP values are code
units, not characters. The options are:
.sp
PCRE2_ANCHORED Match only at the first position
PCRE2_NOTBOL Subject string is not the beginning of a line
PCRE2_NOTEOL Subject string is not the end of a line
PCRE2_NOTEMPTY An empty string is not a valid match
PCRE2_NOTEMPTY_ATSTART An empty string at the start of the subject
is not a valid match
PCRE2_NO_UTF_CHECK Do not check the subject for UTF
validity (only relevant if PCRE2_UTF
was set at compile time)
PCRE2_PARTIAL_SOFT Return PCRE2_ERROR_PARTIAL for a partial
match if no full matches are found
PCRE2_PARTIAL_HARD Return PCRE2_ERROR_PARTIAL for a partial match
if that is found before a full match
.sp
For details of partial matching, see the
.\" HREF
\fBpcre2partial\fP
.\"
page. There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

90
doc/pcre2_pattern_info.3 Normal file
View File

@ -0,0 +1,90 @@
.TH PCRE2_PATTERN_INFO 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_pattern_info(const pcre2 *\fIcode\fP, uint32_t \fIwhat\fP, void *\fIwhere\fP);
.fi
.
.SH DESCRIPTION
.rs
.sp
This function returns information about a compiled pattern. Its arguments are:
.sp
\fIcode\fP Compiled regular expression
\fIwhat\fP What information is required
\fIwhere\fP Where to put the information
.sp
If \fIwhere\fP is NULL, the function returns the amount of memory needed for
the requested information, in bytes. The following information is available:
.sp
PCRE2_INFO_ALLOPTIONS Final options after compiling
PCRE2_INFO_ARGOPTIONS Options passed to \fBpcre2_compile()\fP
PCRE2_INFO_BACKREFMAX Number of highest back reference
PCRE2_INFO_BSR What \eR matches
0 all Unicode line endings
1 CR, LF, or CRLF only
PCRE2_INFO_CAPTURECOUNT Number of capturing subpatterns
PCRE2_INFO_FIRSTBITMAP Bitmap of first code units, or NULL
PCRE2_INFO_FIRSTCODEUNIT First code unit when type is 1
PCRE2_INFO_FIRSTCODETYPE Type of start-of-match information
0 nothing set
1 first code unit is set
2 start of string or after newline
PCRE2_INFO_HASCRORLF Return 1 if explicit CR or LF matches
exist in the pattern
PCRE2_INFO_JCHANGED Return 1 if (?J) or (?-J) was used
PCRE2_INFO_JITSIZE Size of JIT compiled code, or 0
PCRE2_INFO_LASTCODEUNIT Last code unit when type is 1
PCRE2_INFO_LASTCODETYPE Type of must-be-present information
0 nothing set
1 code unit is set
PCRE2_INFO_MATCHEMPTY 1 if the pattern can match an
empty string, 0 otherwise
PCRE2_INFO_MATCHLIMIT Match limit if set,
otherwise PCRE2_RROR_UNSET
PCRE2_INFO_MAXLOOKBEHIND Length (in characters) of the longest
lookbehind assertion
PCRE2_INFO_MINLENGTH Lower bound length of matching strings
PCRE2_INFO_NAMEENTRYSIZE Size of name table entries
PCRE2_INFO_NAMECOUNT Number of named subpatterns
PCRE2_INFO_NAMETABLE Pointer to name table
PCRE2_CONFIG_NEWLINE Code for the newline sequence:
1 for CR
2 for LF
3 for CRLF
4 for ANY
5 for ANYCRLF
PCRE2_INFO_RECURSIONLIMIT Recursion limit if set,
otherwise PCRE2_ERROR_UNSET
PCRE2_INFO_SIZE Size of compiled pattern
.sp
The \fIwhere\fP argument must point to an unsigned 32-bit integer (uint32_t
variable), except for the following \fIwhat\fP values:
.sp
PCRE2_INFO_FIRSTBITMAP const uint8_t
PCRE2_INFO_JITSIZE size_t
PCRE2_INFO_NAMETABLE PCRE2_SPTR
PCRE2_INFO_SIZE size_t
.sp
The yield of the function is zero on success or:
.sp
PCRE2_ERROR_NULL the argument \fIcode\fP is NULL
PCRE2_ERROR_BADMAGIC the "magic number" was not found
PCRE2_ERROR_BADOPTION the value of \fIwhat\fP is invalid
PCRE2_ERROR_BADMODE the pattern was compiled in the wrong mode
PCRE2_ERROR_UNSET the requested information is not set
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,38 @@
.TH PCRE2_SUBSTRING_COPY_BYNAME 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_substring_copy_byname(pcre2_match_data *\fImatch_data\fP,
.B " PCRE2_SPTR \fIname\fP, PCRE2_UCHAR *\fIbuffer\fP, PCRE2_SIZE *\fIbufflen\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This is a convenience function for extracting a captured substring, identified
by name, into a given buffer. The arguments are:
.sp
\fImatch_data\fP The match data block for the match
\fIname\fP Name of the required substring
\fIbuffer\fP Buffer to receive the string
\fIbufflen\fP Length of buffer (code units)
.sp
The \fIbufflen\fP variable is updated to contain the length of the extracted
string, excluding the trailing zero. The yield of the function is zero for
success, PCRE2_ERROR_NOMEMORY if the buffer is too small, or
PCRE2_ERROR_NOSUBSTRING if the string name is invalid.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,39 @@
.TH PCRE2_SUBSTRING_COPY_BYNUMBER 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_substring_copy_bynumber(pcre2_match_data *\fImatch_data\fP,
.B " unsigned int \fInumber\fP, PCRE2_UCHAR *\fIbuffer\fP,"
.B " PCRE2_SIZE *\fIbufflen\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This is a convenience function for extracting a captured substring into a given
buffer. The arguments are:
.sp
\fImatch_data\fP The match data block for the match
\fInumber\fP Number of the required substring
\fIbuffer\fP Buffer to receive the string
\fIbufflen\fP Length of buffer
.sp
The \fIbufflen\fP variable is updated with the length of the extracted string,
excluding the terminating zero. The yield of the function is zero for success,
PCRE2_ERROR_NOMEMORY if the buffer was too small, or PCRE2_ERROR_NOSUBSTRING if
the string number is invalid.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,28 @@
.TH PCRE2_SUBSTRING_FREE 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.SM
.B void pcre2_substring_free(PCRE2_UCHAR *\fIbuffer\fP);
.
.SH DESCRIPTION
.rs
.sp
This is a convenience function for freeing the memory obtained by a previous
call to \fBpcre2_substring_get_byname()\fP or
\fBpcre2_substring_get_bynumber()\fP. Its only argument is a pointer to the
string.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,40 @@
.TH PCRE2_SUBSTRING_GET_BYNAME 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_substring_get_byname(pcre2_match_data *\fImatch_data\fP,
.B " PCRE2_SPTR \fIname\fP, PCRE2_UCHAR **\fIbufferptr\fP, PCRE2_SIZE *\fIbufflen\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This is a convenience function for extracting a captured substring by name into
newly acquired memory. The arguments are:
.sp
\fImatch_data\fP The match data for the match
\fIname\fP Name of the required substring
\fIbufferptr\fP Where to put the string pointer
\fIbufflen\fP Where to put the string length
.sp
The memory in which the substring is placed is obtained by calling the same
memory allocation function that was used for the match data block. The
convenience function \fBpcre2_substring_free()\fP can be used to free it when
it is no longer needed. The yield of the function is zero for success,
PCRE2_ERROR_NOMEMORY if sufficient memory could not be obtained, or
PCRE2_ERROR_NOSUBSTRING if the string name is invalid.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,40 @@
.TH PCRE2_SUBSTRING_GET_BYNUMBER 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_substring_get_bynumber(pcre2_match_data *\fImatch_data\fP,
.B " unsigned int \fInumber\fP, PCRE2_UCHAR **\fIbufferptr\fP, PCRE2_SIZE *\fIbufflen\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This is a convenience function for extracting a captured substring by number into
newly acquired memory. The arguments are:
.sp
\fImatch_data\fP The match data for the match
\fInumber\fP Number of the required substring
\fIbufferptr\fP Where to put the string pointer
\fIbufflen\fP Where to put the string length
.sp
The memory in which the substring is placed is obtained by calling the same
memory allocation function that was used for the match data block. The
convenience function \fBpcre2_substring_free()\fP can be used to free it when
it is no longer needed. The yield of the function is zero for success,
PCRE2_ERROR_NOMEMORY if sufficient memory could not be obtained, or
PCRE2_ERROR_NOSUBSTRING if the string number is invalid.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,34 @@
.TH PCRE2_SUBSTRING_LENGTH_BYNAME 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_substring_length_byname(pcre2_match_data *\fImatch_data\fP,
.B " PCRE2_SPTR \fIname\fP, PCRE2_SIZE *\fIlength\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This function returns the length of a matched substring, identified by name.
The arguments are:
.sp
\fImatch_data\fP The match data block for the match
\fIname\fP The substring name
\fIlength\fP Where to return the length
.sp
The yield is zero on success, or an error code if the substring is not found.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,34 @@
.TH PCRE2_SUBSTRING_LENGTH_BYNUMBER 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_substring_length_bynumber(pcre2_match_data *\fImatch_data\fP,
.B " unsigned int \fInumber\fP, PCRE2_SIZE *\fIlength\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This function returns the length of a matched substring, identified by number.
The arguments are:
.sp
\fImatch_data\fP The match data block for the match
\fInumber\fP The substring number
\fIlength\fP Where to return the length
.sp
The yield is zero on success, or an error code if the substring is not found.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,27 @@
.TH PCRE2_SUBSTRING_LIST_FREE 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.SM
.B void pcre2_substring_list_free(PCRE2_SPTR *\fIlist\fP);
.
.SH DESCRIPTION
.rs
.sp
This is a convenience function for freeing the store obtained by a previous
call to \fBpcre2substring_list_get()\fP. Its only argument is a pointer to
the list of string pointers.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,44 @@
.TH PCRE2_SUBSTRING_LIST_GET 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_substring_list_get(pcre2_match_data *\fImatch_data\fP,
.B " PCRE2_UCHAR ***\fIlistptr\fP, PCRE2_SIZE **\fIlengthsptr\fP);
.fi
.
.SH DESCRIPTION
.rs
.sp
This is a convenience function for extracting all the captured substrings after
a pattern match. It builds a list of pointers to the strings, and (optionally)
a second list that contains their lengths (in code units), excluding a
terminating zero that is added to each of them. All this is done in a single
block of memory that is obtained using the same memory allocation function that
was used to get the match data block. The convenience function
\fBpcre2_substring_list_free()\fP can be used to free it when it is no longer
needed. The arguments are:
.sp
\fImatch_data\fP The match data block
\fIlistptr\fP Where to put a pointer to the list
\fIlengthsptr\fP Where to put a pointer to the lengths, or NULL
.sp
A pointer to a list of pointers is put in the variable whose address is in
\fIlistptr\fP. The list is terminated by a NULL pointer. If \fIlengthsptr\fP is
not NULL, a matching list of lengths is created, and its address is placed in
\fIlengthsptr\fP. The yield of the function is zero on success or
PCRE2_ERROR_NOMEMORY if sufficient memory could not be obtained.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,41 @@
.TH PCRE2_SUBSTRING_NAMETABLE_SCAN 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_substring_nametable_scan(const pcre2_code *\fIcode\fP,
.B " PCRE2_SPTR \fIname\fP, PCRE2_SPTR *\fIfirst\fP, PCRE2_SPTR *\fIlast\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This convenience function finds, for a compiled pattern, the first and last
entries for a given name in the table that translates capturing parenthesis
names into numbers.
.sp
\fIcode\fP Compiled regular expression
\fIname\fP Name whose entries required
\fIfirst\fP Where to return a pointer to the first entry
\fIlast\fP Where to return a pointer to the last entry
.sp
When the name is found in the table, if \fIfirst\fP is NULL, the function
returns a group number, but if there is more than one matching entry, it is not
defined which one. Otherwise, when both pointers have been set, the yield of
the function is the length of each entry in code units. If the name is not
found, PCRE2_ERROR_NOSUBSTRING is returned.
.P
There is a complete description of the PCRE2 native API, including the format of
the table entries, in the
.\" HREF
\fBpcre2api\fP
.\"
page, and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -0,0 +1,37 @@
.TH PCRE2_SUBSTRING_NUMBER_FROM_NAME 3 "21 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS
.rs
.sp
.B #include <pcre2.h>
.PP
.nf
.B int pcre2_substring_number_from_name(const pcre2_code *\fIcode\fP,
.B " PCRE2_SPTR \fIname\fP);"
.fi
.
.SH DESCRIPTION
.rs
.sp
This convenience function finds the number of a named substring capturing
parenthesis in a compiled pattern. Its arguments are:
.sp
\fIcode\fP Compiled regular expression
\fIname\fP Name whose number is required
.sp
The yield of the function is the number of the parenthesis if the name is
found, or PCRE2_ERROR_NOSUBSTRING otherwise. When duplicate names are allowed
(PCRE2_DUPNAMES is set), it is not defined which of the numbers is returned.
You can obtain the complete list by calling
\fBpcre2_substring_nametable_scan()\fP.
.P
There is a complete description of the PCRE2 native API in the
.\" HREF
\fBpcre2api\fP
.\"
page and a description of the POSIX API in the
.\" HREF
\fBpcre2posix\fP
.\"
page.

View File

@ -319,7 +319,7 @@ performance. The JIT-specific functions are discussed in the
.\" .\"
documentation. documentation.
.P .P
A second matching function, \fBpcre2_dfa_exec()\fP, which is not A second matching function, \fBpcre2_dfa_match()\fP, which is not
Perl-compatible, is also provided. This uses a different algorithm for the Perl-compatible, is also provided. This uses a different algorithm for the
matching. The alternative algorithm finds all possible matches (at a given matching. The alternative algorithm finds all possible matches (at a given
point in the subject), and scans the subject just once (unless there are point in the subject), and scans the subject just once (unless there are
@ -606,17 +606,13 @@ function should return zero if all is well, or non-zero to force an error.
A match context is required if you want to change the default values of any A match context is required if you want to change the default values of any
of the following match-time parameters: of the following match-time parameters:
.sp .sp
What \eR matches (Unicode newlines or CR, LF, CRLF only); A callout function
A callout function; The limit for calling \fImatch()\fP
The limit for calling \fImatch()\fP; The limit for calling \fImatch()\fP recursively
The limit for calling \fImatch()\fP recursively;
The newline character sequence;
.sp .sp
A match context is also required if you are using custom memory management. A match context is also required if you are using custom memory management.
If none of these apply, just pass NULL as the context argument of If none of these apply, just pass NULL as the context argument of
\fBpcre2_match()\fP, \fBpcre2_dfa_match()\fP, or \fBpcre2_jit_match()\fP. \fBpcre2_match()\fP, \fBpcre2_dfa_match()\fP, or \fBpcre2_jit_match()\fP.
Changing the newline value or what \eR matches at match time disables the use
of JIT via \fBpcre2_match()\fP.
.P .P
A match context is created, copied, and freed by the following functions: A match context is created, copied, and freed by the following functions:
.sp .sp

View File

@ -1,4 +1,4 @@
.TH PCRE2JIT 3 "29 September 2014" "PCRE2 10.00" .TH PCRE2JIT 3 "21 October 2014" "PCRE2 10.00"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH "PCRE2 JUST-IN-TIME COMPILER SUPPORT" .SH "PCRE2 JUST-IN-TIME COMPILER SUPPORT"
@ -55,7 +55,9 @@ compiled pattern pointer that was returned by \fBpcre2_compile()\fP, and the
second is a set of option bits, which must include at least one of second is a set of option bits, which must include at least one of
PCRE2_JIT_COMPLETE, PCRE2_JIT_PARTIAL_HARD, or PCRE2_JIT_PARTIAL_SOFT. PCRE2_JIT_COMPLETE, PCRE2_JIT_PARTIAL_HARD, or PCRE2_JIT_PARTIAL_SOFT.
.P .P
The returned value from \fBpcre2_jit_compile()\fP is FIXME FIXME. The returned value from \fBpcre2_jit_compile()\fP is zero on success, or a
negative error code. In particular, PCRE2_ERROR_JIT_BADOPTION is returned if
JIT is not supported or if an unknown options bit is set.
.P .P
PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for complete PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for complete
matches. If you want to run partial matches using the PCRE2_PARTIAL_HARD or matches. If you want to run partial matches using the PCRE2_PARTIAL_HARD or
@ -335,8 +337,12 @@ processed by \fBpcre2_jit_compile()\fP).
.P .P
The fast path function is called \fBpcre2_jit_match()\fP, and it takes exactly The fast path function is called \fBpcre2_jit_match()\fP, and it takes exactly
the same arguments as \fBpcre2_match()\fP, plus one additional argument that the same arguments as \fBpcre2_match()\fP, plus one additional argument that
must point to a JIT stack. The JIT stack arrangements described above do not must either point to a JIT stack or be NULL. In the latter case, if a callback
apply. The return values are the same as for \fBpcre2_match()\fP. function has been set up by \fBpcre2_jit_stack_alloc()\fP, it is called.
Otherwise the system stack is used. The return values are the same as for
\fBpcre2_match()\fP, plus PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial
or complete) is requested that was not compiled. Unsupported option bits are
ignored.
.P .P
When you call \fBpcre2_match()\fP, as well as testing for invalid options, a When you call \fBpcre2_match()\fP, as well as testing for invalid options, a
number of other sanity checks are performed on the arguments. For example, if number of other sanity checks are performed on the arguments. For example, if
@ -369,6 +375,6 @@ Cambridge CB2 3QH, England.
.rs .rs
.sp .sp
.nf .nf
Last updated: 29 September 2014 Last updated: 21 October 2014
Copyright (c) 1997-2014 University of Cambridge. Copyright (c) 1997-2014 University of Cambridge.
.fi .fi

View File

@ -273,7 +273,7 @@ for (; n > 0; n--)
while (*message++ != CHAR_NULL) {}; while (*message++ != CHAR_NULL) {};
if (*message == CHAR_NULL) if (*message == CHAR_NULL)
{ {
sprintf(xbuff, "Internal error: no text for error %d", enumber); sprintf(xbuff, "No text for error %d", enumber);
break; break;
} }
} }