| 1 |
.TH PCRE_COMPILE 3 "24 June 2012" "PCRE 8.30"
|
| 2 |
.SH NAME
|
| 3 |
PCRE - Perl-compatible regular expressions
|
| 4 |
.SH SYNOPSIS
|
| 5 |
.rs
|
| 6 |
.sp
|
| 7 |
.B #include <pcre.h>
|
| 8 |
.PP
|
| 9 |
.nf
|
| 10 |
.B pcre *pcre_compile(const char *\fIpattern\fP, int \fIoptions\fP,
|
| 11 |
.B " const char **\fIerrptr\fP, int *\fIerroffset\fP,"
|
| 12 |
.B " const unsigned char *\fItableptr\fP);"
|
| 13 |
.sp
|
| 14 |
.B pcre16 *pcre16_compile(PCRE_SPTR16 \fIpattern\fP, int \fIoptions\fP,
|
| 15 |
.B " const char **\fIerrptr\fP, int *\fIerroffset\fP,"
|
| 16 |
.B " const unsigned char *\fItableptr\fP);"
|
| 17 |
.sp
|
| 18 |
.B pcre32 *pcre32_compile(PCRE_SPTR32 \fIpattern\fP, int \fIoptions\fP,
|
| 19 |
.B " const char **\fIerrptr\fP, int *\fIerroffset\fP,"
|
| 20 |
.B " const unsigned char *\fItableptr\fP);"
|
| 21 |
.fi
|
| 22 |
.
|
| 23 |
.SH DESCRIPTION
|
| 24 |
.rs
|
| 25 |
.sp
|
| 26 |
This function compiles a regular expression into an internal form. It is the
|
| 27 |
same as \fBpcre[16|32]_compile2()\fP, except for the absence of the
|
| 28 |
\fIerrorcodeptr\fP argument. Its arguments are:
|
| 29 |
.sp
|
| 30 |
\fIpattern\fP A zero-terminated string containing the
|
| 31 |
regular expression to be compiled
|
| 32 |
\fIoptions\fP Zero or more option bits
|
| 33 |
\fIerrptr\fP Where to put an error message
|
| 34 |
\fIerroffset\fP Offset in pattern where error was found
|
| 35 |
\fItableptr\fP Pointer to character tables, or NULL to
|
| 36 |
use the built-in default
|
| 37 |
.sp
|
| 38 |
The option bits are:
|
| 39 |
.sp
|
| 40 |
PCRE_ANCHORED Force pattern anchoring
|
| 41 |
PCRE_AUTO_CALLOUT Compile automatic callouts
|
| 42 |
PCRE_BSR_ANYCRLF \eR matches only CR, LF, or CRLF
|
| 43 |
PCRE_BSR_UNICODE \eR matches all Unicode line endings
|
| 44 |
PCRE_CASELESS Do caseless matching
|
| 45 |
PCRE_DOLLAR_ENDONLY $ not to match newline at end
|
| 46 |
PCRE_DOTALL . matches anything including NL
|
| 47 |
PCRE_DUPNAMES Allow duplicate names for subpatterns
|
| 48 |
PCRE_EXTENDED Ignore white space and # comments
|
| 49 |
PCRE_EXTRA PCRE extra features
|
| 50 |
(not much use currently)
|
| 51 |
PCRE_FIRSTLINE Force matching to be before newline
|
| 52 |
PCRE_JAVASCRIPT_COMPAT JavaScript compatibility
|
| 53 |
PCRE_MULTILINE ^ and $ match newlines within data
|
| 54 |
PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
|
| 55 |
PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline
|
| 56 |
sequences
|
| 57 |
PCRE_NEWLINE_CR Set CR as the newline sequence
|
| 58 |
PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
|
| 59 |
PCRE_NEWLINE_LF Set LF as the newline sequence
|
| 60 |
PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren-
|
| 61 |
theses (named ones available)
|
| 62 |
PCRE_NO_UTF16_CHECK Do not check the pattern for UTF-16
|
| 63 |
validity (only relevant if
|
| 64 |
PCRE_UTF16 is set)
|
| 65 |
PCRE_NO_UTF32_CHECK Do not check the pattern for UTF-32
|
| 66 |
validity (only relevant if
|
| 67 |
PCRE_UTF32 is set)
|
| 68 |
PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8
|
| 69 |
validity (only relevant if
|
| 70 |
PCRE_UTF8 is set)
|
| 71 |
PCRE_UCP Use Unicode properties for \ed, \ew, etc.
|
| 72 |
PCRE_UNGREEDY Invert greediness of quantifiers
|
| 73 |
PCRE_UTF16 Run in \fBpcre16_compile()\fP UTF-16 mode
|
| 74 |
PCRE_UTF32 Run in \fBpcre32_compile()\fP UTF-32 mode
|
| 75 |
PCRE_UTF8 Run in \fBpcre_compile()\fP UTF-8 mode
|
| 76 |
.sp
|
| 77 |
PCRE must be built with UTF support in order to use PCRE_UTF8/16/32 and
|
| 78 |
PCRE_NO_UTF8/16/32_CHECK, and with UCP support if PCRE_UCP is used.
|
| 79 |
.P
|
| 80 |
The yield of the function is a pointer to a private data structure that
|
| 81 |
contains the compiled pattern, or NULL if an error was detected. Note that
|
| 82 |
compiling regular expressions with one version of PCRE for use with a different
|
| 83 |
version is not guaranteed to work and may cause crashes.
|
| 84 |
.P
|
| 85 |
There is a complete description of the PCRE native API in the
|
| 86 |
.\" HREF
|
| 87 |
\fBpcreapi\fP
|
| 88 |
.\"
|
| 89 |
page and a description of the POSIX API in the
|
| 90 |
.\" HREF
|
| 91 |
\fBpcreposix\fP
|
| 92 |
.\"
|
| 93 |
page.
|