| 1 |
nigel |
41 |
.TH PCRE 3 |
| 2 |
|
|
.SH NAME |
| 3 |
nigel |
63 |
PCRE - Perl-compatible regular expressions |
| 4 |
nigel |
75 |
.SH INTRODUCTION |
| 5 |
nigel |
63 |
.rs |
| 6 |
|
|
.sp |
| 7 |
nigel |
41 |
The PCRE library is a set of functions that implement regular expression |
| 8 |
nigel |
63 |
pattern matching using the same syntax and semantics as Perl, with just a few |
| 9 |
ph10 |
456 |
differences. Some features that appeared in Python and PCRE before they |
| 10 |
|
|
appeared in Perl are also available using the Python syntax, there is some |
| 11 |
|
|
support for one or two .NET and Oniguruma syntax items, and there is an option |
| 12 |
|
|
for requesting some minor changes that give better JavaScript compatibility. |
| 13 |
nigel |
75 |
.P |
| 14 |
ph10 |
572 |
The current implementation of PCRE corresponds approximately with Perl 5.12, |
| 15 |
|
|
including support for UTF-8 encoded strings and Unicode general category |
| 16 |
|
|
properties. However, UTF-8 and Unicode support has to be explicitly enabled; it |
| 17 |
ph10 |
598 |
is not the default. The Unicode tables correspond to Unicode release 6.0.0. |
| 18 |
nigel |
93 |
.P |
| 19 |
|
|
In addition to the Perl-compatible matching function, PCRE contains an |
| 20 |
ph10 |
456 |
alternative function that matches the same compiled patterns in a different |
| 21 |
|
|
way. In certain circumstances, the alternative function has some advantages. |
| 22 |
|
|
For a discussion of the two matching algorithms, see the |
| 23 |
nigel |
77 |
.\" HREF |
| 24 |
|
|
\fBpcrematching\fP |
| 25 |
|
|
.\" |
| 26 |
|
|
page. |
| 27 |
|
|
.P |
| 28 |
nigel |
75 |
PCRE is written in C and released as a C library. A number of people have |
| 29 |
nigel |
77 |
written wrappers and interfaces of various kinds. In particular, Google Inc. |
| 30 |
|
|
have provided a comprehensive C++ wrapper. This is now included as part of the |
| 31 |
|
|
PCRE distribution. The |
| 32 |
|
|
.\" HREF |
| 33 |
|
|
\fBpcrecpp\fP |
| 34 |
|
|
.\" |
| 35 |
|
|
page has details of this interface. Other people's contributions can be found |
| 36 |
ph10 |
583 |
in the \fIContrib\fP directory at the primary FTP site, which is: |
| 37 |
nigel |
75 |
.sp |
| 38 |
nigel |
63 |
.\" HTML <a href="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre"> |
| 39 |
|
|
.\" </a> |
| 40 |
|
|
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre |
| 41 |
nigel |
75 |
.P |
| 42 |
nigel |
63 |
Details of exactly which Perl regular expression features are and are not |
| 43 |
|
|
supported by PCRE are given in separate documents. See the |
| 44 |
|
|
.\" HREF |
| 45 |
ph10 |
583 |
\fBpcrepattern\fP |
| 46 |
nigel |
63 |
.\" |
| 47 |
|
|
and |
| 48 |
|
|
.\" HREF |
| 49 |
ph10 |
583 |
\fBpcrecompat\fP |
| 50 |
nigel |
63 |
.\" |
| 51 |
ph10 |
208 |
pages. There is a syntax summary in the |
| 52 |
|
|
.\" HREF |
| 53 |
ph10 |
583 |
\fBpcresyntax\fP |
| 54 |
ph10 |
208 |
.\" |
| 55 |
|
|
page. |
| 56 |
nigel |
75 |
.P |
| 57 |
nigel |
63 |
Some features of PCRE can be included, excluded, or changed when the library is |
| 58 |
|
|
built. The |
| 59 |
|
|
.\" HREF |
| 60 |
ph10 |
583 |
\fBpcre_config()\fP |
| 61 |
nigel |
63 |
.\" |
| 62 |
|
|
function makes it possible for a client to discover which features are |
| 63 |
nigel |
75 |
available. The features themselves are described in the |
| 64 |
|
|
.\" HREF |
| 65 |
|
|
\fBpcrebuild\fP |
| 66 |
|
|
.\" |
| 67 |
|
|
page. Documentation about building PCRE for various operating systems can be |
| 68 |
ph10 |
456 |
found in the \fBREADME\fP and \fBNON-UNIX-USE\fP files in the source |
| 69 |
|
|
distribution. |
| 70 |
nigel |
77 |
.P |
| 71 |
|
|
The library contains a number of undocumented internal functions and data |
| 72 |
|
|
tables that are used by more than one of the exported external functions, but |
| 73 |
|
|
which are not intended for use by external callers. Their names all begin with |
| 74 |
nigel |
83 |
"_pcre_", which hopefully will not provoke any name clashes. In some |
| 75 |
|
|
environments, it is possible to control which external symbols are exported |
| 76 |
|
|
when a shared library is built, and in these cases the undocumented symbols are |
| 77 |
|
|
not exported. |
| 78 |
nigel |
75 |
. |
| 79 |
|
|
. |
| 80 |
|
|
.SH "USER DOCUMENTATION" |
| 81 |
nigel |
63 |
.rs |
| 82 |
|
|
.sp |
| 83 |
nigel |
75 |
The user documentation for PCRE comprises a number of different sections. In |
| 84 |
|
|
the "man" format, each of these is a separate "man page". In the HTML format, |
| 85 |
|
|
each is a separate page, linked from the index page. In the plain text format, |
| 86 |
ph10 |
429 |
all the sections, except the \fBpcredemo\fP section, are concatenated, for ease |
| 87 |
|
|
of searching. The sections are as follows: |
| 88 |
nigel |
75 |
.sp |
| 89 |
nigel |
63 |
pcre this document |
| 90 |
ph10 |
153 |
pcre-config show PCRE installation configuration information |
| 91 |
nigel |
77 |
pcreapi details of PCRE's native C API |
| 92 |
nigel |
63 |
pcrebuild options for building PCRE |
| 93 |
|
|
pcrecallout details of the callout feature |
| 94 |
|
|
pcrecompat discussion of Perl compatibility |
| 95 |
nigel |
77 |
pcrecpp details of the C++ wrapper |
| 96 |
ph10 |
429 |
pcredemo a demonstration C program that uses PCRE |
| 97 |
nigel |
75 |
pcregrep description of the \fBpcregrep\fP command |
| 98 |
ph10 |
678 |
pcrejit discussion of the just-in-time optimization support |
| 99 |
|
|
pcrelimits details of size and other limits |
| 100 |
nigel |
77 |
pcrematching discussion of the two matching algorithms |
| 101 |
nigel |
75 |
pcrepartial details of the partial matching facility |
| 102 |
|
|
.\" JOIN |
| 103 |
nigel |
63 |
pcrepattern syntax and semantics of supported |
| 104 |
|
|
regular expressions |
| 105 |
|
|
pcreperform discussion of performance issues |
| 106 |
nigel |
77 |
pcreposix the POSIX-compatible C API |
| 107 |
nigel |
75 |
pcreprecompile details of saving and re-using precompiled patterns |
| 108 |
ph10 |
429 |
pcresample discussion of the pcredemo program |
| 109 |
nigel |
91 |
pcrestack discussion of stack usage |
| 110 |
ph10 |
456 |
pcresyntax quick syntax reference |
| 111 |
nigel |
75 |
pcretest description of the \fBpcretest\fP testing command |
| 112 |
ph10 |
678 |
pcreunicode discussion of Unicode and UTF-8 support |
| 113 |
nigel |
75 |
.sp |
| 114 |
nigel |
63 |
In addition, in the "man" and HTML formats, there is a short page for each |
| 115 |
nigel |
77 |
C library function, listing its arguments and results. |
| 116 |
nigel |
75 |
. |
| 117 |
|
|
. |
| 118 |
nigel |
41 |
.SH AUTHOR |
| 119 |
nigel |
63 |
.rs |
| 120 |
|
|
.sp |
| 121 |
ph10 |
99 |
.nf |
| 122 |
nigel |
77 |
Philip Hazel |
| 123 |
ph10 |
99 |
University Computing Service |
| 124 |
nigel |
93 |
Cambridge CB2 3QH, England. |
| 125 |
ph10 |
99 |
.fi |
| 126 |
nigel |
77 |
.P |
| 127 |
|
|
Putting an actual email address here seems to have been a spam magnet, so I've |
| 128 |
ph10 |
153 |
taken it away. If you want to email me, use my two initials, followed by the |
| 129 |
|
|
two digits 10, at the domain cam.ac.uk. |
| 130 |
ph10 |
99 |
. |
| 131 |
|
|
. |
| 132 |
|
|
.SH REVISION |
| 133 |
|
|
.rs |
| 134 |
nigel |
75 |
.sp |
| 135 |
ph10 |
99 |
.nf |
| 136 |
ph10 |
678 |
Last updated: 24 August 2011 |
| 137 |
ph10 |
598 |
Copyright (c) 1997-2011 University of Cambridge. |
| 138 |
ph10 |
99 |
.fi |