130 lines
9.1 KiB
HTML
130 lines
9.1 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of PCRE_COMPILE</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>PCRE_COMPILE</H1>
|
|
Section: C Library Functions (3)<BR>Updated: 01 October 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>pcre *pcre_compile(const char *</B><I>pattern</I>, int <I>options</I>,
|
|
<B> const char **</B><I>errptr</I>, int *<I>erroffset</I>,
|
|
<B> const unsigned char *</B><I>tableptr</I>);
|
|
|
|
<B>pcre16 *pcre16_compile(PCRE_SPTR16 </B><I>pattern</I>, int <I>options</I>,
|
|
<B> const char **</B><I>errptr</I>, int *<I>erroffset</I>,
|
|
<B> const unsigned char *</B><I>tableptr</I>);
|
|
|
|
<B>pcre32 *pcre32_compile(PCRE_SPTR32 </B><I>pattern</I>, int <I>options</I>,
|
|
<B> const char **</B><I>errptr</I>, int *<I>erroffset</I>,
|
|
<B> const unsigned char *</B><I>tableptr</I>);
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
<P>
|
|
This function compiles a regular expression into an internal form. It is the
|
|
same as <B>pcre[16|32]_compile2()</B>, except for the absence of the
|
|
<I>errorcodeptr</I> argument. Its arguments are:
|
|
<P>
|
|
<BR> <I>pattern</I> A zero-terminated string containing the
|
|
<BR> regular expression to be compiled
|
|
<BR> <I>options</I> Zero or more option bits
|
|
<BR> <I>errptr</I> Where to put an error message
|
|
<BR> <I>erroffset</I> Offset in pattern where error was found
|
|
<BR> <I>tableptr</I> Pointer to character tables, or NULL to
|
|
<BR> use the built-in default
|
|
<P>
|
|
The option bits are:
|
|
<P>
|
|
<BR> PCRE_ANCHORED Force pattern anchoring
|
|
<BR> PCRE_AUTO_CALLOUT Compile automatic callouts
|
|
<BR> PCRE_BSR_ANYCRLF \R matches only CR, LF, or CRLF
|
|
<BR> PCRE_BSR_UNICODE \R matches all Unicode line endings
|
|
<BR> PCRE_CASELESS Do caseless matching
|
|
<BR> PCRE_DOLLAR_ENDONLY $ not to match newline at end
|
|
<BR> PCRE_DOTALL . matches anything including NL
|
|
<BR> PCRE_DUPNAMES Allow duplicate names for subpatterns
|
|
<BR> PCRE_EXTENDED Ignore white space and # comments
|
|
<BR> PCRE_EXTRA PCRE extra features
|
|
<BR> (not much use currently)
|
|
<BR> PCRE_FIRSTLINE Force matching to be before newline
|
|
<BR> PCRE_JAVASCRIPT_COMPAT JavaScript compatibility
|
|
<BR> PCRE_MULTILINE ^ and $ match newlines within data
|
|
<BR> PCRE_NEVER_UTF Lock out UTF, e.g. via (*UTF)
|
|
<BR> PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
|
|
<BR> PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline
|
|
<BR> sequences
|
|
<BR> PCRE_NEWLINE_CR Set CR as the newline sequence
|
|
<BR> PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
|
|
<BR> PCRE_NEWLINE_LF Set LF as the newline sequence
|
|
<BR> PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren-
|
|
<BR> theses (named ones available)
|
|
<BR> PCRE_NO_AUTO_POSSESS Disable auto-possessification
|
|
<BR> PCRE_NO_START_OPTIMIZE Disable match-time start optimizations
|
|
<BR> PCRE_NO_UTF16_CHECK Do not check the pattern for UTF-16
|
|
<BR> validity (only relevant if
|
|
<BR> PCRE_UTF16 is set)
|
|
<BR> PCRE_NO_UTF32_CHECK Do not check the pattern for UTF-32
|
|
<BR> validity (only relevant if
|
|
<BR> PCRE_UTF32 is set)
|
|
<BR> PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8
|
|
<BR> validity (only relevant if
|
|
<BR> PCRE_UTF8 is set)
|
|
<BR> PCRE_UCP Use Unicode properties for \d, \w, etc.
|
|
<BR> PCRE_UNGREEDY Invert greediness of quantifiers
|
|
<BR> PCRE_UTF16 Run in <B>pcre16_compile()</B> UTF-16 mode
|
|
<BR> PCRE_UTF32 Run in <B>pcre32_compile()</B> UTF-32 mode
|
|
<BR> PCRE_UTF8 Run in <B>pcre_compile()</B> UTF-8 mode
|
|
<P>
|
|
PCRE must be built with UTF support in order to use PCRE_UTF8/16/32 and
|
|
PCRE_NO_UTF8/16/32_CHECK, and with UCP support if PCRE_UCP is used.
|
|
<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. Note that
|
|
compiling regular expressions with one version of PCRE for use with a different
|
|
version is not guaranteed to work and may cause crashes.
|
|
<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>
|