| 6 |
.sp |
.sp |
| 7 |
The PCRE library is a set of functions that implement regular expression |
The PCRE library is a set of functions that implement regular expression |
| 8 |
pattern matching using the same syntax and semantics as Perl, with just a few |
pattern matching using the same syntax and semantics as Perl, with just a few |
| 9 |
differences. The current implementation of PCRE (release 5.x) corresponds |
differences. The current implementation of PCRE (release 6.x) corresponds |
| 10 |
approximately with Perl 5.8, including support for UTF-8 encoded strings and |
approximately with Perl 5.8, including support for UTF-8 encoded strings and |
| 11 |
Unicode general category properties. However, this support has to be explicitly |
Unicode general category properties. However, this support has to be explicitly |
| 12 |
enabled; it is not the default. |
enabled; it is not the default. |
| 13 |
.P |
.P |
| 14 |
|
In addition to the Perl-compatible matching function, PCRE also contains an |
| 15 |
|
alternative matching function that matches the same compiled patterns in a |
| 16 |
|
different way. In certain circumstances, the alternative function has some |
| 17 |
|
advantages. For a discussion of the two matching algorithms, see the |
| 18 |
|
.\" HREF |
| 19 |
|
\fBpcrematching\fP |
| 20 |
|
.\" |
| 21 |
|
page. |
| 22 |
|
.P |
| 23 |
PCRE is written in C and released as a C library. A number of people have |
PCRE is written in C and released as a C library. A number of people have |
| 24 |
written wrappers and interfaces of various kinds. A C++ class is included in |
written wrappers and interfaces of various kinds. In particular, Google Inc. |
| 25 |
these contributions, which can be found in the \fIContrib\fR directory at the |
have provided a comprehensive C++ wrapper. This is now included as part of the |
| 26 |
primary FTP site, which is: |
PCRE distribution. The |
| 27 |
|
.\" HREF |
| 28 |
|
\fBpcrecpp\fP |
| 29 |
|
.\" |
| 30 |
|
page has details of this interface. Other people's contributions can be found |
| 31 |
|
in the \fIContrib\fR directory at the primary FTP site, which is: |
| 32 |
.sp |
.sp |
| 33 |
.\" HTML <a href="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre"> |
.\" HTML <a href="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre"> |
| 34 |
.\" </a> |
.\" </a> |
| 57 |
.\" |
.\" |
| 58 |
page. Documentation about building PCRE for various operating systems can be |
page. Documentation about building PCRE for various operating systems can be |
| 59 |
found in the \fBREADME\fP file in the source distribution. |
found in the \fBREADME\fP file in the source distribution. |
| 60 |
|
.P |
| 61 |
|
The library contains a number of undocumented internal functions and data |
| 62 |
|
tables that are used by more than one of the exported external functions, but |
| 63 |
|
which are not intended for use by external callers. Their names all begin with |
| 64 |
|
"_pcre_", which hopefully will not provoke any name clashes. |
| 65 |
. |
. |
| 66 |
. |
. |
| 67 |
.SH "USER DOCUMENTATION" |
.SH "USER DOCUMENTATION" |
| 74 |
follows: |
follows: |
| 75 |
.sp |
.sp |
| 76 |
pcre this document |
pcre this document |
| 77 |
pcreapi details of PCRE's native API |
pcreapi details of PCRE's native C API |
| 78 |
pcrebuild options for building PCRE |
pcrebuild options for building PCRE |
| 79 |
pcrecallout details of the callout feature |
pcrecallout details of the callout feature |
| 80 |
pcrecompat discussion of Perl compatibility |
pcrecompat discussion of Perl compatibility |
| 81 |
|
pcrecpp details of the C++ wrapper |
| 82 |
pcregrep description of the \fBpcregrep\fP command |
pcregrep description of the \fBpcregrep\fP command |
| 83 |
|
pcrematching discussion of the two matching algorithms |
| 84 |
pcrepartial details of the partial matching facility |
pcrepartial details of the partial matching facility |
| 85 |
.\" JOIN |
.\" JOIN |
| 86 |
pcrepattern syntax and semantics of supported |
pcrepattern syntax and semantics of supported |
| 87 |
regular expressions |
regular expressions |
| 88 |
pcreperform discussion of performance issues |
pcreperform discussion of performance issues |
| 89 |
pcreposix the POSIX-compatible API |
pcreposix the POSIX-compatible C API |
| 90 |
pcreprecompile details of saving and re-using precompiled patterns |
pcreprecompile details of saving and re-using precompiled patterns |
| 91 |
pcresample discussion of the sample program |
pcresample discussion of the sample program |
| 92 |
pcretest description of the \fBpcretest\fP testing command |
pcretest description of the \fBpcretest\fP testing command |
| 93 |
.sp |
.sp |
| 94 |
In addition, in the "man" and HTML formats, there is a short page for each |
In addition, in the "man" and HTML formats, there is a short page for each |
| 95 |
library function, listing its arguments and results. |
C library function, listing its arguments and results. |
| 96 |
. |
. |
| 97 |
. |
. |
| 98 |
.SH LIMITATIONS |
.SH LIMITATIONS |
| 120 |
subpatterns, assertions, and other types of subpattern, is 200. |
subpatterns, assertions, and other types of subpattern, is 200. |
| 121 |
.P |
.P |
| 122 |
The maximum length of a subject string is the largest positive number that an |
The maximum length of a subject string is the largest positive number that an |
| 123 |
integer variable can hold. However, PCRE uses recursion to handle subpatterns |
integer variable can hold. However, when using the traditional matching |
| 124 |
and indefinite repetition. This means that the available stack space may limit |
function, PCRE uses recursion to handle subpatterns and indefinite repetition. |
| 125 |
the size of a subject string that can be processed by certain patterns. |
This means that the available stack space may limit the size of a subject |
| 126 |
|
string that can be processed by certain patterns. |
| 127 |
.sp |
.sp |
| 128 |
.\" HTML <a name="utf8support"></a> |
.\" HTML <a name="utf8support"></a> |
| 129 |
. |
. |
| 189 |
5. The dot metacharacter matches one UTF-8 character instead of a single byte. |
5. The dot metacharacter matches one UTF-8 character instead of a single byte. |
| 190 |
.P |
.P |
| 191 |
6. The escape sequence \eC can be used to match a single byte in UTF-8 mode, |
6. The escape sequence \eC can be used to match a single byte in UTF-8 mode, |
| 192 |
but its use can lead to some strange effects. |
but its use can lead to some strange effects. This facility is not available in |
| 193 |
|
the alternative matching function, \fBpcre_dfa_exec()\fP. |
| 194 |
.P |
.P |
| 195 |
7. The character escapes \eb, \eB, \ed, \eD, \es, \eS, \ew, and \eW correctly |
7. The character escapes \eb, \eB, \ed, \eD, \es, \eS, \ew, and \eW correctly |
| 196 |
test characters of any code value, but the characters that PCRE recognizes as |
test characters of any code value, but the characters that PCRE recognizes as |
| 213 |
.SH AUTHOR |
.SH AUTHOR |
| 214 |
.rs |
.rs |
| 215 |
.sp |
.sp |
| 216 |
Philip Hazel <ph10@cam.ac.uk> |
Philip Hazel |
| 217 |
.br |
.br |
| 218 |
University Computing Service, |
University Computing Service, |
| 219 |
.br |
.br |
| 220 |
Cambridge CB2 3QG, England. |
Cambridge CB2 3QG, England. |
| 221 |
.br |
.P |
| 222 |
Phone: +44 1223 334714 |
Putting an actual email address here seems to have been a spam magnet, so I've |
| 223 |
|
taken it away. If you want to email me, use my initial and surname, separated |
| 224 |
|
by a dot, at the domain ucs.cam.ac.uk. |
| 225 |
.sp |
.sp |
| 226 |
.in 0 |
.in 0 |
| 227 |
Last updated: 09 September 2004 |
Last updated: 07 March 2005 |
| 228 |
.br |
.br |
| 229 |
Copyright (c) 1997-2004 University of Cambridge. |
Copyright (c) 1997-2005 University of Cambridge. |