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