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