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