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