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