132 lines
9.1 KiB
HTML
132 lines
9.1 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of PCRE_EXEC</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>PCRE_EXEC</H1>
|
|
Section: C Library Functions (3)<BR>Updated: 12 May 2013<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
PCRE - Perl-compatible regular expressions
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
<P>
|
|
<B>#include <<A HREF="file:///usr/include/pcre.h">pcre.h</A>></B>
|
|
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>int pcre_exec(const pcre *</B><I>code</I>, const pcre_extra *<I>extra</I>,
|
|
<B> const char *</B><I>subject</I>, int <I>length</I>, int <I>startoffset</I>,
|
|
<B> int </B><I>options</I>, int *<I>ovector</I>, int <I>ovecsize</I>);
|
|
|
|
<B>int pcre16_exec(const pcre16 *</B><I>code</I>, const pcre16_extra *<I>extra</I>,
|
|
<B> PCRE_SPTR16 </B><I>subject</I>, int <I>length</I>, int <I>startoffset</I>,
|
|
<B> int </B><I>options</I>, int *<I>ovector</I>, int <I>ovecsize</I>);
|
|
|
|
<B>int pcre32_exec(const pcre32 *</B><I>code</I>, const pcre32_extra *<I>extra</I>,
|
|
<B> PCRE_SPTR32 </B><I>subject</I>, int <I>length</I>, int <I>startoffset</I>,
|
|
<B> int </B><I>options</I>, int *<I>ovector</I>, int <I>ovecsize</I>);
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
<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:
|
|
<P>
|
|
<BR> <I>code</I> Points to the compiled pattern
|
|
<BR> <I>extra</I> Points to an associated <B>pcre[16|32]_extra</B> structure,
|
|
<BR> or is NULL
|
|
<BR> <I>subject</I> Points to the subject string
|
|
<BR> <I>length</I> Length of the subject string
|
|
<BR> <I>startoffset</I> Offset in the subject at which to start matching
|
|
<BR> <I>options</I> Option bits
|
|
<BR> <I>ovector</I> Points to a vector of ints for result offsets
|
|
<BR> <I>ovecsize</I> Number of elements in the vector (a multiple of 3)
|
|
<P>
|
|
The units for <I>length</I> and <I>startoffset</I> are bytes for
|
|
<B>pcre_exec()</B>, 16-bit data items for <B>pcre16_exec()</B>, and 32-bit items
|
|
for <B>pcre32_exec()</B>. The options are:
|
|
<P>
|
|
<BR> PCRE_ANCHORED Match only at the first position
|
|
<BR> PCRE_BSR_ANYCRLF \R matches only CR, LF, or CRLF
|
|
<BR> PCRE_BSR_UNICODE \R matches all Unicode line endings
|
|
<BR> PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
|
|
<BR> PCRE_NEWLINE_ANYCRLF Recognize CR, LF, & CRLF as newline sequences
|
|
<BR> PCRE_NEWLINE_CR Recognize CR as the only newline sequence
|
|
<BR> PCRE_NEWLINE_CRLF Recognize CRLF as the only newline sequence
|
|
<BR> PCRE_NEWLINE_LF Recognize LF as the only newline sequence
|
|
<BR> PCRE_NOTBOL Subject string is not the beginning of a line
|
|
<BR> PCRE_NOTEOL Subject string is not the end of a line
|
|
<BR> PCRE_NOTEMPTY An empty string is not a valid match
|
|
<BR> PCRE_NOTEMPTY_ATSTART An empty string at the start of the subject
|
|
<BR> is not a valid match
|
|
<BR> PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations
|
|
<BR> PCRE_NO_UTF16_CHECK Do not check the subject for UTF-16
|
|
<BR> validity (only relevant if PCRE_UTF16
|
|
<BR> was set at compile time)
|
|
<BR> PCRE_NO_UTF32_CHECK Do not check the subject for UTF-32
|
|
<BR> validity (only relevant if PCRE_UTF32
|
|
<BR> was set at compile time)
|
|
<BR> PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8
|
|
<BR> validity (only relevant if PCRE_UTF8
|
|
<BR> was set at compile time)
|
|
<BR> PCRE_PARTIAL ) Return PCRE_ERROR_PARTIAL for a partial
|
|
<BR> PCRE_PARTIAL_SOFT ) match if no full matches are found
|
|
<BR> PCRE_PARTIAL_HARD Return PCRE_ERROR_PARTIAL for a partial match
|
|
<BR> if that is found before a full match
|
|
<P>
|
|
For details of partial matching, see the
|
|
|
|
<B>pcrepartial</B>
|
|
|
|
page. A <B>pcre_extra</B> structure contains the following fields:
|
|
<P>
|
|
<BR> <I>flags</I> Bits indicating which fields are set
|
|
<BR> <I>study_data</I> Opaque data from <B>pcre[16|32]_study()</B>
|
|
<BR> <I>match_limit</I> Limit on internal resource use
|
|
<BR> <I>match_limit_recursion</I> Limit on internal recursion depth
|
|
<BR> <I>callout_data</I> Opaque data passed back to callouts
|
|
<BR> <I>tables</I> Points to character tables or is NULL
|
|
<BR> <I>mark</I> For passing back a *MARK pointer
|
|
<BR> <I>executable_jit</I> Opaque data from JIT compilation
|
|
<P>
|
|
The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT,
|
|
PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA,
|
|
PCRE_EXTRA_TABLES, PCRE_EXTRA_MARK and PCRE_EXTRA_EXECUTABLE_JIT.
|
|
<P>
|
|
|
|
There is a complete description of the PCRE native API in the
|
|
|
|
<B>pcreapi</B>
|
|
|
|
page and a description of the POSIX API in the
|
|
|
|
<B>pcreposix</B>
|
|
|
|
page.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:51 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|