Browse Source

upgrade to PCRE 7.6.

#changes to code are minimal. this fixes a security bug
PECL
Nuno Lopes 18 years ago
parent
commit
3f7b92c06c
  1. 4
      ext/pcre/pcrelib/AUTHORS
  2. 48
      ext/pcre/pcrelib/ChangeLog
  3. 4
      ext/pcre/pcrelib/LICENCE
  4. 8
      ext/pcre/pcrelib/NEWS
  5. 76
      ext/pcre/pcrelib/NON-UNIX-USE
  6. 23
      ext/pcre/pcrelib/README
  7. 6
      ext/pcre/pcrelib/config.h
  8. 2
      ext/pcre/pcrelib/dftables.c
  9. 239
      ext/pcre/pcrelib/doc/pcre.txt
  10. 6
      ext/pcre/pcrelib/pcre.h
  11. 17
      ext/pcre/pcrelib/pcre_compile.c
  12. 2
      ext/pcre/pcrelib/pcre_config.c
  13. 2
      ext/pcre/pcrelib/pcre_exec.c
  14. 2
      ext/pcre/pcrelib/pcre_fullinfo.c
  15. 2
      ext/pcre/pcrelib/pcre_get.c
  16. 2
      ext/pcre/pcrelib/pcre_globals.c
  17. 2
      ext/pcre/pcrelib/pcre_info.c
  18. 2
      ext/pcre/pcrelib/pcre_internal.h
  19. 2
      ext/pcre/pcrelib/pcre_maketables.c
  20. 2
      ext/pcre/pcrelib/pcre_newline.c
  21. 2
      ext/pcre/pcrelib/pcre_ord2utf8.c
  22. 2
      ext/pcre/pcrelib/pcre_printint.src
  23. 2
      ext/pcre/pcrelib/pcre_refcount.c
  24. 2
      ext/pcre/pcrelib/pcre_study.c
  25. 2
      ext/pcre/pcrelib/pcre_tables.c
  26. 2
      ext/pcre/pcrelib/pcre_try_flipped.c
  27. 2
      ext/pcre/pcrelib/pcre_ucp_searchfuncs.c
  28. 2
      ext/pcre/pcrelib/pcre_valid_utf8.c
  29. 2
      ext/pcre/pcrelib/pcre_version.c
  30. 2
      ext/pcre/pcrelib/pcre_xclass.c
  31. 21
      ext/pcre/pcrelib/pcredemo.c
  32. 2
      ext/pcre/pcrelib/pcreposix.c
  33. 2
      ext/pcre/pcrelib/pcreposix.h
  34. 2
      ext/pcre/pcrelib/testdata/testinput4
  35. 2
      ext/pcre/pcrelib/testdata/testoutput4

4
ext/pcre/pcrelib/AUTHORS

@ -8,7 +8,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service, University of Cambridge Computing Service,
Cambridge, England. Cambridge, England.
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
All rights reserved All rights reserved
@ -17,7 +17,7 @@ THE C++ WRAPPER LIBRARY
Written by: Google Inc. Written by: Google Inc.
Copyright (c) 2007 Google Inc
Copyright (c) 2007-2008 Google Inc
All rights reserved All rights reserved
#### ####

48
ext/pcre/pcrelib/ChangeLog

@ -1,6 +1,54 @@
ChangeLog for PCRE ChangeLog for PCRE
------------------ ------------------
Version 7.6 28-Jan-08
---------------------
1. A character class containing a very large number of characters with
codepoints greater than 255 (in UTF-8 mode, of course) caused a buffer
overflow.
2. Patch to cut out the "long long" test in pcrecpp_unittest when
HAVE_LONG_LONG is not defined.
3. Applied Christian Ehrlicher's patch to update the CMake build files to
bring them up to date and include new features. This patch includes:
- Fixed PH's badly added libz and libbz2 support.
- Fixed a problem with static linking.
- Added pcredemo. [But later removed - see 7 below.]
- Fixed dftables problem and added an option.
- Added a number of HAVE_XXX tests, including HAVE_WINDOWS_H and
HAVE_LONG_LONG.
- Added readline support for pcretest.
- Added an listing of the option settings after cmake has run.
4. A user submitted a patch to Makefile that makes it easy to create
"pcre.dll" under mingw when using Configure/Make. I added stuff to
Makefile.am that cause it to include this special target, without
affecting anything else. Note that the same mingw target plus all
the other distribution libraries and programs are now supported
when configuring with CMake (see 6 below) instead of with
Configure/Make.
5. Applied Craig's patch that moves no_arg into the RE class in the C++ code.
This is an attempt to solve the reported problem "pcrecpp::no_arg is not
exported in the Windows port". It has not yet been confirmed that the patch
solves the problem, but it does no harm.
6. Applied Sheri's patch to CMakeLists.txt to add NON_STANDARD_LIB_PREFIX and
NON_STANDARD_LIB_SUFFIX for dll names built with mingw when configured
with CMake, and also correct the comment about stack recursion.
7. Remove the automatic building of pcredemo from the ./configure system and
from CMakeLists.txt. The whole idea of pcredemo.c is that it is an example
of a program that users should build themselves after PCRE is installed, so
building it automatically is not really right. What is more, it gave
trouble in some build environments.
8. Further tidies to CMakeLists.txt from Sheri and Christian.
Version 7.5 10-Jan-08 Version 7.5 10-Jan-08
--------------------- ---------------------

4
ext/pcre/pcrelib/LICENCE

@ -22,7 +22,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service, University of Cambridge Computing Service,
Cambridge, England. Cambridge, England.
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
All rights reserved. All rights reserved.
@ -31,7 +31,7 @@ THE C++ WRAPPER FUNCTIONS
Contributed by: Google Inc. Contributed by: Google Inc.
Copyright (c) 2007, Google Inc.
Copyright (c) 2007-2008, Google Inc.
All rights reserved. All rights reserved.

8
ext/pcre/pcrelib/NEWS

@ -1,6 +1,14 @@
News about PCRE releases News about PCRE releases
------------------------ ------------------------
Release 7.6 28-Jan-08
---------------------
The main reason for having this release so soon after 7.5 is because it fixes a
potential buffer overflow problem in pcre_compile() when run in UTF-8 mode. In
addition, the CMake configuration files have been brought up to date.
Release 7.5 10-Jan-08 Release 7.5 10-Jan-08
--------------------- ---------------------

76
ext/pcre/pcrelib/NON-UNIX-USE

@ -8,8 +8,11 @@ This document contains the following sections:
The C++ wrapper functions The C++ wrapper functions
Building for virtual Pascal Building for virtual Pascal
Stack size in Windows environments Stack size in Windows environments
Linking programs in Windows environments
Comments about Win32 builds Comments about Win32 builds
Building PCRE with CMake
Building PCRE on Windows with CMake
Use of relative paths with CMake on Windows
Testing with runtest.bat
Building under Windows with BCC5.5 Building under Windows with BCC5.5
Building PCRE on OpenVMS Building PCRE on OpenVMS
@ -31,10 +34,12 @@ library consists entirely of code written in Standard C, and so should compile
successfully on any system that has a Standard C compiler and library. The C++ successfully on any system that has a Standard C compiler and library. The C++
wrapper functions are a separate issue (see below). wrapper functions are a separate issue (see below).
The PCRE distribution includes support for CMake. This support is relatively
new, but has already been used successfully to build PCRE in multiple build
environments on Windows. There are some instructions in the section entitled
"Building PCRE with CMake" below.
The PCRE distribution includes a "configure" file for use by the Configure/Make
build system, as found in many Unix-like environments. There is also support
support for CMake, which some users prefer, in particular in Windows
environments. There are some instructions for CMake under Windows in the
section entitled "Building PCRE with CMake" below. CMake can also be used to
build PCRE in Unix-like systems.
GENERIC INSTRUCTIONS FOR THE PCRE C LIBRARY GENERIC INSTRUCTIONS FOR THE PCRE C LIBRARY
@ -177,15 +182,22 @@ significantly slower when this is done. There is more about stack usage in the
"pcrestack" documentation. "pcrestack" documentation.
LINKING PROGRAMS IN WINDOWS ENVIRONMENTS
If you want to statically link a program against a PCRE library in the form of
a non-dll .a file, you must define PCRE_STATIC before including pcre.h,
otherwise the pcre_malloc() and pcre_free() exported functions will be declared
__declspec(dllimport), with unwanted results.
COMMENTS ABOUT WIN32 BUILDS (see also "BUILDING PCRE WITH CMAKE" below) COMMENTS ABOUT WIN32 BUILDS (see also "BUILDING PCRE WITH CMAKE" below)
There are two ways of building PCRE using the "configure, make, make install" There are two ways of building PCRE using the "configure, make, make install"
paradigm on Windows systems: using MinGW or using Cygwin. These are not at all paradigm on Windows systems: using MinGW or using Cygwin. These are not at all
the same thing; they are completely different from each other. There is also the same thing; they are completely different from each other. There is also
some experimental, undocumented support for building using "cmake", which you
might like to try if you are familiar with "cmake". However, at the present
time, the "cmake" process builds only a static library (not a dll), and the
tests are not automatically run.
support for building using CMake, which some users find a more straightforward
way of building PCRE under Windows. However, the tests are not run
automatically when CMake is used.
The MinGW home page (http://www.mingw.org/) says this: The MinGW home page (http://www.mingw.org/) says this:
@ -217,10 +229,13 @@ also link with libpcre, which contains the basic functions. (Some earlier
releases of PCRE included the basic libpcre functions in libpcreposix. This no releases of PCRE included the basic libpcre functions in libpcreposix. This no
longer happens.) longer happens.)
If you want to statically link your program against a non-dll .a file, you must
define PCRE_STATIC before including pcre.h, otherwise the pcre_malloc() and
pcre_free() exported functions will be declared __declspec(dllimport), with
unwanted results.
A user submitted a special-purpose patch that makes it easy to create
"pcre.dll" under mingw32 using the "msys" environment. It provides "pcre.dll"
as a special target. If you use this target, no other files are built, and in
particular, the pcretest and pcregrep programs are not built. An example of how
this might be used is:
./configure --enable-utf --disable-cpp CFLAGS="-03 -s"; make pcre.dll
Using Cygwin's compiler generates libraries and executables that depend on Using Cygwin's compiler generates libraries and executables that depend on
cygwin1.dll. If a library that is generated this way is distributed, cygwin1.dll. If a library that is generated this way is distributed,
@ -252,7 +267,7 @@ terminators in order to get some of the tests to work. We hope to improve
things in this area in future. things in this area in future.
BUILDING PCRE WITH CMAKE
BUILDING PCRE ON WINDOWS WITH CMAKE
CMake is an alternative build facility that can be used instead of the CMake is an alternative build facility that can be used instead of the
traditional Unix "configure". CMake version 2.4.7 supports Borland makefiles, traditional Unix "configure". CMake version 2.4.7 supports Borland makefiles,
@ -289,7 +304,36 @@ were contributed by a PCRE user.
11. The build directory should now contain a usable build system, be it a 11. The build directory should now contain a usable build system, be it a
solution file for Visual Studio, makefiles for MinGW, etc. solution file for Visual Studio, makefiles for MinGW, etc.
Testing with RunTest.bat
USE OF RELATIVE PATHS WITH CMAKE ON WINDOWS
A PCRE user comments as follows:
I thought that others may want to know the current state of
CMAKE_USE_RELATIVE_PATHS support on Windows.
Here it is:
-- AdditionalIncludeDirectories is only partially modified (only the
first path - see below)
-- Only some of the contained file paths are modified - shown below for
pcre.vcproj
-- It properly modifies
I am sure CMake people can fix that if they want to. Until then one will
need to replace existing absolute paths in project files with relative
paths manually (e.g. from VS) - relative to project file location. I did
just that before being told to try CMAKE_USE_RELATIVE_PATHS. Not a big
deal.
AdditionalIncludeDirectories="E:\builds\pcre\build;E:\builds\pcre\pcre-7.5;"
AdditionalIncludeDirectories=".;E:\builds\pcre\pcre-7.5;"
RelativePath="pcre.h">
RelativePath="pcre_chartables.c">
RelativePath="pcre_chartables.c.rule">
TESTING WITH RUNTEST.BAT
1. Copy RunTest.bat into the directory where pcretest.exe has been created. 1. Copy RunTest.bat into the directory where pcretest.exe has been created.
@ -384,5 +428,5 @@ $! Locale could not be set to fr
$! $!
========================= =========================
Last Updated: 21 September 2007
Last Updated: 25 January 2008
**** ****

23
ext/pcre/pcrelib/README

@ -119,9 +119,9 @@ If you are using HP's ANSI C++ compiler (aCC), please see the special note
in the section entitled "Using HP's ANSI C++ compiler (aCC)" below. in the section entitled "Using HP's ANSI C++ compiler (aCC)" below.
The following instructions assume the use of the widely used "configure, make, The following instructions assume the use of the widely used "configure, make,
make install" process. There is also some experimental support for "cmake" in
the PCRE distribution, but it is incomplete and not documented. However, if you
are a "cmake" user, you might want to try it.
make install" process. There is also support for CMake in the PCRE
distribution; there are some comments about using CMake in the NON-UNIX-USE
file, though it can also be used in Unix-like systems.
To build PCRE on a Unix-like system, first run the "configure" command from the To build PCRE on a Unix-like system, first run the "configure" command from the
PCRE distribution directory, with your current directory set to the directory PCRE distribution directory, with your current directory set to the directory
@ -303,12 +303,12 @@ script that can be run to recreate the configuration, and config.log, which
contains compiler output from tests that "configure" runs. contains compiler output from tests that "configure" runs.
Once "configure" has run, you can run "make". It builds two libraries, called Once "configure" has run, you can run "make". It builds two libraries, called
libpcre and libpcreposix, a test program called pcretest, a demonstration
program called pcredemo, and the pcregrep command. If a C++ compiler was found
on your system, "make" also builds the C++ wrapper library, which is called
libpcrecpp, and some test programs called pcrecpp_unittest,
pcre_scanner_unittest, and pcre_stringpiece_unittest. Building the C++ wrapper
can be disabled by adding --disable-cpp to the "configure" command.
libpcre and libpcreposix, a test program called pcretest, and the pcregrep
command. If a C++ compiler was found on your system, "make" also builds the C++
wrapper library, which is called libpcrecpp, and some test programs called
pcrecpp_unittest, pcre_scanner_unittest, and pcre_stringpiece_unittest.
Building the C++ wrapper can be disabled by adding --disable-cpp to the
"configure" command.
The command "make check" runs all the appropriate tests. Details of the PCRE The command "make check" runs all the appropriate tests. Details of the PCRE
tests are given below in a separate section of this document. tests are given below in a separate section of this document.
@ -360,9 +360,6 @@ system. The following are installed (file names are all relative to the
pcretest.txt the pcretest man page pcretest.txt the pcretest man page
pcregrep.txt the pcregrep man page pcregrep.txt the pcregrep man page
Note that the pcredemo program that is built by "configure" is *not* installed
anywhere. It is a demonstration for programmers wanting to use PCRE.
If you want to remove PCRE from your system, you can run "make uninstall". If you want to remove PCRE from your system, you can run "make uninstall".
This removes all the files that "make install" installed. However, it does not This removes all the files that "make install" installed. However, it does not
remove any directories, because these are often shared with other programs. remove any directories, because these are often shared with other programs.
@ -743,4 +740,4 @@ The distribution should contain the following files:
Philip Hazel Philip Hazel
Email local part: ph10 Email local part: ph10
Email domain: cam.ac.uk Email domain: cam.ac.uk
Last updated: 18 December 2007
Last updated: 25 January 2008

6
ext/pcre/pcrelib/config.h

@ -251,13 +251,13 @@ them both to 0; an emulation function will be used. */
#define PACKAGE_NAME "PCRE" #define PACKAGE_NAME "PCRE"
/* Define to the full name and version of this package. */ /* Define to the full name and version of this package. */
#define PACKAGE_STRING "PCRE 7.5"
#define PACKAGE_STRING "PCRE 7.6"
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "pcre" #define PACKAGE_TARNAME "pcre"
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "7.5"
#define PACKAGE_VERSION "7.6"
/* If you are compiling for a system other than a Unix-like system or /* If you are compiling for a system other than a Unix-like system or
@ -310,7 +310,7 @@ them both to 0; an emulation function will be used. */
/* Version number of package */ /* Version number of package */
#ifndef VERSION #ifndef VERSION
#define VERSION "7.5"
#define VERSION "7.6"
#endif #endif
/* Define to empty if `const' does not conform to ANSI C. */ /* Define to empty if `const' does not conform to ANSI C. */

2
ext/pcre/pcrelib/dftables.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

239
ext/pcre/pcrelib/doc/pcre.txt

@ -271,11 +271,16 @@ NAME
PCRE BUILD-TIME OPTIONS PCRE BUILD-TIME OPTIONS
This document describes the optional features of PCRE that can be This document describes the optional features of PCRE that can be
selected when the library is compiled. They are all selected, or dese-
lected, by providing options to the configure script that is run before
the make command. The complete list of options for configure (which
includes the standard ones such as the selection of the installation
directory) can be obtained by running
selected when the library is compiled. It assumes use of the configure
script, where the optional features are selected or deselected by pro-
viding options to configure before running the make command. However,
the same options can be selected in both Unix-like and non-Unix-like
environments using the GUI facility of CMakeSetup if you are using
CMake instead of configure to build PCRE.
The complete list of options for configure (which includes the standard
ones such as the selection of the installation directory) can be
obtained by running
./configure --help ./configure --help
@ -361,6 +366,19 @@ CODE VALUE OF NEWLINE
conventional to use the standard for your operating system. conventional to use the standard for your operating system.
WHAT \R MATCHES
By default, the sequence \R in a pattern matches any Unicode newline
sequence, whatever has been selected as the line ending sequence. If
you specify
--enable-bsr-anycrlf
the default is changed so that \R matches only CR, LF, or CRLF. What-
ever is selected when PCRE is built can be overridden when the library
functions are called.
BUILDING SHARED AND STATIC LIBRARIES BUILDING SHARED AND STATIC LIBRARIES
The PCRE building process uses libtool to build both shared and static The PCRE building process uses libtool to build both shared and static
@ -499,6 +517,33 @@ USING EBCDIC CODE
environment (for example, an IBM mainframe operating system). environment (for example, an IBM mainframe operating system).
PCREGREP OPTIONS FOR COMPRESSED FILE SUPPORT
By default, pcregrep reads all files as plain text. You can build it so
that it recognizes files whose names end in .gz or .bz2, and reads them
with libz or libbz2, respectively, by adding one or both of
--enable-pcregrep-libz
--enable-pcregrep-libbz2
to the configure command. These options naturally require that the rel-
evant libraries are installed on your system. Configuration will fail
if they are not.
PCRETEST OPTION FOR LIBREADLINE SUPPORT
If you add
--enable-pcretest-libreadline
to the configure command, pcretest is linked with the libreadline
library, and when its input is from a terminal, it reads it using the
readline() function. This provides line-editing and history facilities.
Note that libreadline is GPL-licenced, so if you distribute a binary of
pcretest linked in this way, there may be licensing issues.
SEE ALSO SEE ALSO
pcreapi(3), pcre_config(3). pcreapi(3), pcre_config(3).
@ -513,7 +558,7 @@ AUTHOR
REVISION REVISION
Last updated: 30 July 2007
Last updated: 18 December 2007
Copyright (c) 1997-2007 University of Cambridge. Copyright (c) 1997-2007 University of Cambridge.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
@ -824,7 +869,7 @@ PCRE API OVERVIEW
a Perl-compatible manner. A sample program that demonstrates the sim- a Perl-compatible manner. A sample program that demonstrates the sim-
plest way of using them is provided in the file called pcredemo.c in plest way of using them is provided in the file called pcredemo.c in
the source distribution. The pcresample documentation describes how to the source distribution. The pcresample documentation describes how to
run it.
compile and run it.
A second matching function, pcre_dfa_exec(), which is not Perl-compati- A second matching function, pcre_dfa_exec(), which is not Perl-compati-
ble, is also provided. This uses a different algorithm for the match- ble, is also provided. This uses a different algorithm for the match-
@ -919,8 +964,11 @@ NEWLINES
dollar metacharacters, the handling of #-comments in /x mode, and, when dollar metacharacters, the handling of #-comments in /x mode, and, when
CRLF is a recognized line ending sequence, the match position advance- CRLF is a recognized line ending sequence, the match position advance-
ment for a non-anchored pattern. There is more detail about this in the ment for a non-anchored pattern. There is more detail about this in the
section on pcre_exec() options below. The choice of newline convention
does not affect the interpretation of the \n or \r escape sequences.
section on pcre_exec() options below.
The choice of newline convention does not affect the interpretation of
the \n or \r escape sequences, nor does it affect what \R matches,
which is controlled in a similar way, but by separate options.
MULTITHREADING MULTITHREADING
@ -977,6 +1025,14 @@ CHECKING BUILD-TIME OPTIONS
and -1 for ANY. The default should normally be the standard sequence and -1 for ANY. The default should normally be the standard sequence
for your operating system. for your operating system.
PCRE_CONFIG_BSR
The output is an integer whose value indicates what character sequences
the \R escape sequence matches by default. A value of 0 means that \R
matches any Unicode line ending sequence; a value of 1 means that \R
matches only CR, LF, or CRLF. The default can be overridden when a pat-
tern is compiled or matched.
PCRE_CONFIG_LINK_SIZE PCRE_CONFIG_LINK_SIZE
The output is an integer that contains the number of bytes used for The output is an integer that contains the number of bytes used for
@ -1106,6 +1162,15 @@ COMPILING A PATTERN
all with number 255, before each pattern item. For discussion of the all with number 255, before each pattern item. For discussion of the
callout facility, see the pcrecallout documentation. callout facility, see the pcrecallout documentation.
PCRE_BSR_ANYCRLF
PCRE_BSR_UNICODE
These options (which are mutually exclusive) control what the \R escape
sequence matches. The choice is either to match only CR, LF, or CRLF,
or to match any Unicode newline sequence. The default is specified when
PCRE is built. It can be overridden from within the pattern, or by set-
ting an option when a compiled pattern is matched.
PCRE_CASELESS PCRE_CASELESS
If this bit is set, letters in the pattern match both upper and lower If this bit is set, letters in the pattern match both upper and lower
@ -1291,7 +1356,7 @@ COMPILATION ERROR CODES
9 nothing to repeat 9 nothing to repeat
10 [this code is not in use] 10 [this code is not in use]
11 internal error: unexpected repeat 11 internal error: unexpected repeat
12 unrecognized character after (?
12 unrecognized character after (? or (?-
13 POSIX named classes are supported only within a class 13 POSIX named classes are supported only within a class
14 missing ) 14 missing )
15 reference to non-existent subpattern 15 reference to non-existent subpattern
@ -1299,7 +1364,7 @@ COMPILATION ERROR CODES
17 unknown option bit(s) set 17 unknown option bit(s) set
18 missing ) after comment 18 missing ) after comment
19 [this code is not in use] 19 [this code is not in use]
20 regular expression too large
20 regular expression is too large
21 failed to get memory 21 failed to get memory
22 unmatched parentheses 22 unmatched parentheses
23 internal error: code overflow 23 internal error: code overflow
@ -1328,7 +1393,7 @@ COMPILATION ERROR CODES
46 malformed \P or \p sequence 46 malformed \P or \p sequence
47 unknown property name after \P or \p 47 unknown property name after \P or \p
48 subpattern name is too long (maximum 32 characters) 48 subpattern name is too long (maximum 32 characters)
49 too many named subpatterns (maximum 10,000)
49 too many named subpatterns (maximum 10000)
50 [this code is not in use] 50 [this code is not in use]
51 octal value is greater than \377 (not in UTF-8 mode) 51 octal value is greater than \377 (not in UTF-8 mode)
52 internal error: overran compiling workspace 52 internal error: overran compiling workspace
@ -1336,10 +1401,18 @@ COMPILATION ERROR CODES
found found
54 DEFINE group contains more than one branch 54 DEFINE group contains more than one branch
55 repeating a DEFINE group is not allowed 55 repeating a DEFINE group is not allowed
56 inconsistent NEWLINE options"
56 inconsistent NEWLINE options
57 \g is not followed by a braced name or an optionally braced 57 \g is not followed by a braced name or an optionally braced
non-zero number non-zero number
58 (?+ or (?- or (?(+ or (?(- must be followed by a non-zero number 58 (?+ or (?- or (?(+ or (?(- must be followed by a non-zero number
59 (*VERB) with an argument is not supported
60 (*VERB) not recognized
61 number is too big
62 subpattern name expected
63 digit expected after (?+
The numbers 32 and 10000 in errors 48 and 49 are defaults; different
values may be used if the limits were changed when PCRE was built.
STUDYING A PATTERN STUDYING A PATTERN
@ -1532,13 +1605,14 @@ INFORMATION ABOUT A PATTERN
Return 1 if the pattern contains any explicit matches for CR or LF Return 1 if the pattern contains any explicit matches for CR or LF
characters, otherwise 0. The fourth argument should point to an int characters, otherwise 0. The fourth argument should point to an int
variable.
variable. An explicit match is either a literal CR or LF character, or
\r or \n.
PCRE_INFO_JCHANGED PCRE_INFO_JCHANGED
Return 1 if the (?J) option setting is used in the pattern, otherwise
0. The fourth argument should point to an int variable. The (?J) inter-
nal option setting changes the local PCRE_DUPNAMES option.
Return 1 if the (?J) or (?-J) option setting is used in the pattern,
otherwise 0. The fourth argument should point to an int variable. (?J)
and (?-J) set and unset the local PCRE_DUPNAMES option, respectively.
PCRE_INFO_LASTLITERAL PCRE_INFO_LASTLITERAL
@ -1813,6 +1887,14 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
turned out to be anchored by virtue of its contents, it cannot be made turned out to be anchored by virtue of its contents, it cannot be made
unachored at matching time. unachored at matching time.
PCRE_BSR_ANYCRLF
PCRE_BSR_UNICODE
These options (which are mutually exclusive) control what the \R escape
sequence matches. The choice is either to match only CR, LF, or CRLF,
or to match any Unicode newline sequence. These options override the
choice that was made or defaulted when the pattern was compiled.
PCRE_NEWLINE_CR PCRE_NEWLINE_CR
PCRE_NEWLINE_LF PCRE_NEWLINE_LF
PCRE_NEWLINE_CRLF PCRE_NEWLINE_CRLF
@ -1829,7 +1911,7 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
When PCRE_NEWLINE_CRLF, PCRE_NEWLINE_ANYCRLF, or PCRE_NEWLINE_ANY is When PCRE_NEWLINE_CRLF, PCRE_NEWLINE_ANYCRLF, or PCRE_NEWLINE_ANY is
set, and a match attempt for an unanchored pattern fails when the cur- set, and a match attempt for an unanchored pattern fails when the cur-
rent position is at a CRLF sequence, and the pattern contains no rent position is at a CRLF sequence, and the pattern contains no
explicit matches for CR or NL characters, the match position is
explicit matches for CR or LF characters, the match position is
advanced by two characters instead of one, in other words, to after the advanced by two characters instead of one, in other words, to after the
CRLF. CRLF.
@ -1839,9 +1921,12 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
failing at the start, it skips both the CR and the LF before retrying. failing at the start, it skips both the CR and the LF before retrying.
However, the pattern [\r\n]A does match that string, because it con- However, the pattern [\r\n]A does match that string, because it con-
tains an explicit CR or LF reference, and so advances only by one char- tains an explicit CR or LF reference, and so advances only by one char-
acter after the first failure. Note than an explicit CR or LF refer-
ence occurs for negated character classes such as [^X] because they can
match CR or LF characters.
acter after the first failure.
An explicit match for CR of LF is either a literal appearance of one of
those characters, or one of the \r or \n escape sequences. Implicit
matches such as [^X] do not count, nor does \s (which includes CR and
LF in the characters that it matches).
Notwithstanding the above, anomalous effects may still occur when CRLF Notwithstanding the above, anomalous effects may still occur when CRLF
is a valid newline sequence and explicit \r or \n escapes appear in the is a valid newline sequence and explicit \r or \n escapes appear in the
@ -2480,8 +2565,8 @@ AUTHOR
REVISION REVISION
Last updated: 21 August 2007
Copyright (c) 1997-2007 University of Cambridge.
Last updated: 23 January 2008
Copyright (c) 1997-2008 University of Cambridge.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
@ -2765,16 +2850,23 @@ DIFFERENCES BETWEEN PCRE AND PERL
(f) The PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and PCRE_NO_AUTO_CAP- (f) The PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and PCRE_NO_AUTO_CAP-
TURE options for pcre_exec() have no Perl equivalents. TURE options for pcre_exec() have no Perl equivalents.
(g) The callout facility is PCRE-specific.
(g) The \R escape sequence can be restricted to match only CR, LF, or
CRLF by the PCRE_BSR_ANYCRLF option.
(h) The callout facility is PCRE-specific.
(h) The partial matching facility is PCRE-specific.
(i) The partial matching facility is PCRE-specific.
(i) Patterns compiled by PCRE can be saved and re-used at a later time,
(j) Patterns compiled by PCRE can be saved and re-used at a later time,
even on different hosts that have the other endianness. even on different hosts that have the other endianness.
(j) The alternative matching function (pcre_dfa_exec()) matches in a
(k) The alternative matching function (pcre_dfa_exec()) matches in a
different way and is not Perl-compatible. different way and is not Perl-compatible.
(l) PCRE recognizes some special sequences such as (*CR) at the start
of a pattern that set overall options that cannot be changed within the
pattern.
AUTHOR AUTHOR
@ -2785,7 +2877,7 @@ AUTHOR
REVISION REVISION
Last updated: 08 August 2007
Last updated: 11 September 2007
Copyright (c) 1997-2007 University of Cambridge. Copyright (c) 1997-2007 University of Cambridge.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
@ -2853,7 +2945,14 @@ NEWLINE CONVENTIONS
changes the convention to CR. That pattern matches "a\nb" because LF is changes the convention to CR. That pattern matches "a\nb" because LF is
no longer a newline. Note that these special settings, which are not no longer a newline. Note that these special settings, which are not
Perl-compatible, are recognized only at the very start of a pattern, Perl-compatible, are recognized only at the very start of a pattern,
and that they must be in upper case.
and that they must be in upper case. If more than one of them is
present, the last one is used.
The newline convention does not affect what the \R escape sequence
matches. By default, this is any Unicode newline sequence, for Perl
compatibility. However, this can be changed; see the description of \R
in the section entitled "Newline sequences" below. A change of \R set-
ting can be combined with a change of newline convention.
CHARACTERS AND METACHARACTERS CHARACTERS AND METACHARACTERS
@ -3128,9 +3227,9 @@ BACKSLASH
Newline sequences Newline sequences
Outside a character class, the escape sequence \R matches any Unicode
newline sequence. This is a Perl 5.10 feature. In non-UTF-8 mode \R is
equivalent to the following:
Outside a character class, by default, the escape sequence \R matches
any Unicode newline sequence. This is a Perl 5.10 feature. In non-UTF-8
mode \R is equivalent to the following:
(?>\r\n|\n|\x0b|\f|\r|\x85) (?>\r\n|\n|\x0b|\f|\r|\x85)
@ -3146,6 +3245,28 @@ BACKSLASH
rator, U+2029). Unicode character property support is not needed for rator, U+2029). Unicode character property support is not needed for
these characters to be recognized. these characters to be recognized.
It is possible to restrict \R to match only CR, LF, or CRLF (instead of
the complete set of Unicode line endings) by setting the option
PCRE_BSR_ANYCRLF either at compile time or when the pattern is matched.
(BSR is an abbrevation for "backslash R".) This can be made the default
when PCRE is built; if this is the case, the other behaviour can be
requested via the PCRE_BSR_UNICODE option. It is also possible to
specify these settings by starting a pattern string with one of the
following sequences:
(*BSR_ANYCRLF) CR, LF, or CRLF only
(*BSR_UNICODE) any Unicode newline sequence
These override the default and the options given to pcre_compile(), but
they can be overridden by options given to pcre_exec(). Note that these
special settings, which are not Perl-compatible, are recognized only at
the very start of a pattern, and that they must be in upper case. If
more than one of them is present, the last one is used. They can be
combined with a change of newline convention, for example, a pattern
can start with:
(*ANY)(*BSR_ANYCRLF)
Inside a character class, \R matches the letter "R". Inside a character class, \R matches the letter "R".
Unicode character properties Unicode character properties
@ -3601,9 +3722,9 @@ VERTICAL BAR
INTERNAL OPTION SETTING INTERNAL OPTION SETTING
The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and
PCRE_EXTENDED options can be changed from within the pattern by a
sequence of Perl option letters enclosed between "(?" and ")". The
option letters are
PCRE_EXTENDED options (which are Perl-compatible) can be changed from
within the pattern by a sequence of Perl option letters enclosed
between "(?" and ")". The option letters are
i for PCRE_CASELESS i for PCRE_CASELESS
m for PCRE_MULTILINE m for PCRE_MULTILINE
@ -3617,6 +3738,10 @@ INTERNAL OPTION SETTING
is also permitted. If a letter appears both before and after the is also permitted. If a letter appears both before and after the
hyphen, the option is unset. hyphen, the option is unset.
The PCRE-specific options PCRE_DUPNAMES, PCRE_UNGREEDY, and PCRE_EXTRA
can be changed in the same way as the Perl-compatible options by using
the characters J, U and X respectively.
When an option change occurs at top level (that is, not inside subpat- When an option change occurs at top level (that is, not inside subpat-
tern parentheses), the change applies to the remainder of the pattern tern parentheses), the change applies to the remainder of the pattern
that follows. If the change is placed right at the start of a pattern, that follows. If the change is placed right at the start of a pattern,
@ -3642,9 +3767,11 @@ INTERNAL OPTION SETTING
the effects of option settings happen at compile time. There would be the effects of option settings happen at compile time. There would be
some very weird behaviour otherwise. some very weird behaviour otherwise.
The PCRE-specific options PCRE_DUPNAMES, PCRE_UNGREEDY, and PCRE_EXTRA
can be changed in the same way as the Perl-compatible options by using
the characters J, U and X respectively.
Note: There are other PCRE-specific options that can be set by the
application when the compile or match functions are called. In some
cases the pattern can contain special leading sequences to override
what the application has set or what has been defaulted. Details are
given in the section entitled "Newline sequences" above.
SUBPATTERNS SUBPATTERNS
@ -4644,7 +4771,7 @@ CALLOUTS
is given in the pcrecallout documentation. is given in the pcrecallout documentation.
BACTRACKING CONTROL
BACKTRACKING CONTROL
Perl 5.10 introduced a number of "Special Backtracking Control Verbs", Perl 5.10 introduced a number of "Special Backtracking Control Verbs",
which are described in the Perl documentation as "experimental and sub- which are described in the Perl documentation as "experimental and sub-
@ -4775,7 +4902,7 @@ AUTHOR
REVISION REVISION
Last updated: 21 August 2007
Last updated: 17 September 2007
Copyright (c) 1997-2007 University of Cambridge. Copyright (c) 1997-2007 University of Cambridge.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
@ -4904,7 +5031,7 @@ CHARACTER CLASSES
[^...] negative character class [^...] negative character class
[x-y] range (can be used for hex characters) [x-y] range (can be used for hex characters)
[[:xxx:]] positive POSIX named set [[:xxx:]] positive POSIX named set
[[^:xxx:]] negative POSIX named set
[[:^xxx:]] negative POSIX named set
alnum alphanumeric alnum alphanumeric
alpha alphabetic alpha alphabetic
@ -5074,7 +5201,8 @@ BACKTRACKING CONTROL
NEWLINE CONVENTIONS NEWLINE CONVENTIONS
These are recognized only at the very start of a pattern.
These are recognized only at the very start of the pattern or after a
(*BSR_...) option.
(*CR) (*CR)
(*LF) (*LF)
@ -5083,6 +5211,15 @@ NEWLINE CONVENTIONS
(*ANY) (*ANY)
WHAT \R MATCHES
These are recognized only at the very start of the pattern or after a
(*...) option that sets the newline convention.
(*BSR_ANYCRLF)
(*BSR_UNICODE)
CALLOUTS CALLOUTS
(?C) callout (?C) callout
@ -5103,7 +5240,7 @@ AUTHOR
REVISION REVISION
Last updated: 21 August 2007
Last updated: 14 November 2007
Copyright (c) 1997-2007 University of Cambridge. Copyright (c) 1997-2007 University of Cambridge.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
@ -5907,7 +6044,8 @@ MATCHING INTERFACE
c. The "i"th argument has a suitable type for holding the c. The "i"th argument has a suitable type for holding the
string captured as the "i"th sub-pattern. If you pass in string captured as the "i"th sub-pattern. If you pass in
NULL for the "i"th argument, or pass fewer arguments than
void * NULL for the "i"th argument, or a non-void * NULL
of the correct type, or pass fewer arguments than the
number of sub-patterns, "i"th captured sub-pattern is number of sub-patterns, "i"th captured sub-pattern is
ignored. ignored.
@ -6155,7 +6293,7 @@ AUTHOR
REVISION REVISION
Last updated: 06 March 2007
Last updated: 12 November 2007
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
@ -6183,10 +6321,9 @@ PCRE SAMPLE PROGRAM
bility of matching an empty string. Comments in the code explain what bility of matching an empty string. Comments in the code explain what
is going on. is going on.
The demonstration program is automatically built if you use "./config-
ure;make" to build PCRE. Otherwise, if PCRE is installed in the stan-
dard include and library directories for your system, you should be
able to compile the demonstration program using this command:
If PCRE is installed in the standard include and library directories
for your system, you should be able to compile the demonstration pro-
gram using this command:
gcc -o pcredemo pcredemo.c -lpcre gcc -o pcredemo pcredemo.c -lpcre
@ -6233,8 +6370,8 @@ AUTHOR
REVISION REVISION
Last updated: 13 June 2007
Copyright (c) 1997-2007 University of Cambridge.
Last updated: 23 January 2008
Copyright (c) 1997-2008 University of Cambridge.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
PCRESTACK(3) PCRESTACK(3) PCRESTACK(3) PCRESTACK(3)

6
ext/pcre/pcrelib/pcre.h

@ -5,7 +5,7 @@
/* This is the public header file for the PCRE library, to be #included by /* This is the public header file for the PCRE library, to be #included by
applications that call the PCRE functions. applications that call the PCRE functions.
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
/* The current PCRE version information. */ /* The current PCRE version information. */
#define PCRE_MAJOR 7 #define PCRE_MAJOR 7
#define PCRE_MINOR 5
#define PCRE_MINOR 6
#define PCRE_PRERELEASE #define PCRE_PRERELEASE
#define PCRE_DATE 2008-01-10
#define PCRE_DATE 2008-01-28
/* When an application links to a PCRE DLL in Windows, the symbols that are /* When an application links to a PCRE DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE, the appropriate imported have to be identified as such. When building PCRE, the appropriate

17
ext/pcre/pcrelib/pcre_compile.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@ -2374,6 +2374,7 @@ uschar classbits[32];
BOOL class_utf8; BOOL class_utf8;
BOOL utf8 = (options & PCRE_UTF8) != 0; BOOL utf8 = (options & PCRE_UTF8) != 0;
uschar *class_utf8data; uschar *class_utf8data;
uschar *class_utf8data_base;
uschar utf8_char[6]; uschar utf8_char[6];
#else #else
BOOL utf8 = FALSE; BOOL utf8 = FALSE;
@ -2685,6 +2686,7 @@ for (;; ptr++)
#ifdef SUPPORT_UTF8 #ifdef SUPPORT_UTF8
class_utf8 = FALSE; /* No chars >= 256 */ class_utf8 = FALSE; /* No chars >= 256 */
class_utf8data = code + LINK_SIZE + 2; /* For UTF-8 items */ class_utf8data = code + LINK_SIZE + 2; /* For UTF-8 items */
class_utf8data_base = class_utf8data; /* For resetting in pass 1 */
#endif #endif
/* Process characters until ] is reached. By writing this as a "do" it /* Process characters until ] is reached. By writing this as a "do" it
@ -2700,6 +2702,18 @@ for (;; ptr++)
{ /* Braces are required because the */ { /* Braces are required because the */
GETCHARLEN(c, ptr, ptr); /* macro generates multiple statements */ GETCHARLEN(c, ptr, ptr); /* macro generates multiple statements */
} }
/* In the pre-compile phase, accumulate the length of any UTF-8 extra
data and reset the pointer. This is so that very large classes that
contain a zillion UTF-8 characters no longer overwrite the work space
(which is on the stack). */
if (lengthptr != NULL)
{
*lengthptr += class_utf8data - class_utf8data_base;
class_utf8data = class_utf8data_base;
}
#endif #endif
/* Inside \Q...\E everything is literal except \E */ /* Inside \Q...\E everything is literal except \E */
@ -5805,7 +5819,6 @@ to fill in forward references to subpatterns. */
uschar cworkspace[COMPILE_WORK_SIZE]; uschar cworkspace[COMPILE_WORK_SIZE];
/* Set this early so that early errors get offset 0. */ /* Set this early so that early errors get offset 0. */
ptr = (const uschar *)pattern; ptr = (const uschar *)pattern;

2
ext/pcre/pcrelib/pcre_config.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_exec.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_fullinfo.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_get.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_globals.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_info.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_internal.h

@ -7,7 +7,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_maketables.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_newline.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_ord2utf8.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_printint.src

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_refcount.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_study.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_tables.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_try_flipped.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_ucp_searchfuncs.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_valid_utf8.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_version.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcre_xclass.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

21
ext/pcre/pcrelib/pcredemo.c

@ -4,9 +4,11 @@
/* This is a demonstration program to illustrate the most straightforward ways /* This is a demonstration program to illustrate the most straightforward ways
of calling the PCRE regular expression library from a C program. See the of calling the PCRE regular expression library from a C program. See the
pcresample documentation for a short discussion.
pcresample documentation for a short discussion ("man pcresample" if you have
the PCRE man pages installed).
In Unix-like environments, compile this program thuswise:
Compile thuswise:
gcc -Wall pcredemo.c -I/usr/local/include -L/usr/local/lib \ gcc -Wall pcredemo.c -I/usr/local/include -L/usr/local/lib \
-R/usr/local/lib -lpcre -R/usr/local/lib -lpcre
@ -14,8 +16,15 @@ Replace "/usr/local/include" and "/usr/local/lib" with wherever the include and
library files for PCRE are installed on your system. You don't need -I and -L library files for PCRE are installed on your system. You don't need -I and -L
if PCRE is installed in the standard system libraries. Only some operating if PCRE is installed in the standard system libraries. Only some operating
systems (e.g. Solaris) use the -R option. systems (e.g. Solaris) use the -R option.
*/
Building under Windows:
If you want to statically link this program against a non-dll .a file, you must
define PCRE_STATIC before including pcre.h, otherwise the pcre_malloc() and
pcre_free() exported functions will be declared __declspec(dllimport), with
unwanted results. So in this environment, uncomment the following line. */
/* #define PCRE_STATIC */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -129,8 +138,8 @@ printf("\nMatch succeeded at offset %d\n", ovector[0]);
/************************************************************************* /*************************************************************************
* We have found the first match within the subject string. If the output * * We have found the first match within the subject string. If the output *
* vector wasn't big enough, set its size to the maximum. Then output any *
* substrings that were captured. *
* vector wasn't big enough, say so. Then output any substrings that were *
* captured. *
*************************************************************************/ *************************************************************************/
/* The output vector wasn't big enough */ /* The output vector wasn't big enough */
@ -155,7 +164,7 @@ for (i = 0; i < rc; i++)
/************************************************************************** /**************************************************************************
* That concludes the basic part of this demonstration program. We have * * That concludes the basic part of this demonstration program. We have *
* compiled a pattern, and performed a single match. The code that follows * * compiled a pattern, and performed a single match. The code that follows *
* first shows how to access named substrings, and then how to code for *
* shows first how to access named substrings, and then how to code for *
* repeated matches on the same subject. * * repeated matches on the same subject. *
**************************************************************************/ **************************************************************************/

2
ext/pcre/pcrelib/pcreposix.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/pcreposix.h

@ -9,7 +9,7 @@
Compatible Regular Expression library. It defines the things POSIX says should Compatible Regular Expression library. It defines the things POSIX says should
be there. I hope. be there. I hope.
Copyright (c) 1997-2007 University of Cambridge
Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

2
ext/pcre/pcrelib/testdata/testinput4

@ -607,4 +607,6 @@
/[[:^xdigit:]]/8g /[[:^xdigit:]]/8g
M\x{442} M\x{442}
/[^ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽƁƂƄƆƇƉƊƋƎƏƐƑƓƔƖƗƘƜƝƟƠƢƤƦƧƩƬƮƯƱƲƳƵƷƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶǷǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺȻȽȾɁΆΈΉΊΌΎΏΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΪΫϒϓϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹϺϽϾϿЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸԀԂԄԆԈԊԌԎԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔՕՖႠႡႢႣႤႥႦႧႨႩႪႫႬႭႮႯႰႱႲႳႴႵႶႷႸႹႺႻႼႽႾႿჀჁჂჃჄჅḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸἈἉἊἋἌἍἎἏἘἙἚἛἜἝἨἩἪἫἬἭἮἯἸἹἺἻἼἽἾἿὈὉὊὋὌὍὙὛὝὟὨὩὪὫὬὭὮὯᾸᾹᾺΆῈΈῊΉῘῙῚΊῨῩῪΎῬῸΌῺΏabcdefghijklmnopqrstuvwxyzªµºßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķĸĺļľŀłńņňʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżžſƀƃƅƈƌƍƒƕƙƚƛƞơƣƥƨƪƫƭưƴƶƹƺƽƾƿdžljnjǎǐǒǔǖǘǚǜǝǟǡǣǥǧǩǫǭǯǰdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳȴȵȶȷȸȹȼȿɀɐɑɒɓɔɕɖɗɘəɚɛɜɝɞɟɠɡɢɣɤɥɦɧɨɩɪɫɬɭɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿʀʁʂʃʄʅʆʇʈʉʊʋʌʍʎʏʐʑʒʓʔʕʖʗʘʙʚʛʜʝʞʟʠʡʢʣʤʥʦʧʨʩʪʫʬʭʮʯΐάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώϐϑϕϖϗϙϛϝϟϡϣϥϧϩϫϭϯϰϱϲϳϵϸϻϼабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹԁԃԅԇԉԋԍԏաբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆևᴀᴁᴂᴃᴄᴅᴆᴇᴈᴉᴊᴋᴌᴍᴎᴏᴐᴑᴒᴓᴔᴕᴖᴗᴘᴙᴚᴛᴜᴝᴞᴟᴠᴡᴢᴣᴤᴥᴦᴧᴨᴩᴪᴫᵢᵣᵤᵥᵦᵧᵨᵩᵪᵫᵬᵭᵮᵯᵰᵱᵲᵳᵴᵵᵶᵷᵹᵺᵻᵼᵽᵾᵿᶀᶁᶂᶃᶄᶅᶆᶇᶈᶉᶊᶋᶌᶍᶎᶏᶐᶑᶒᶓᶔᶕᶖᶗᶘᶙᶚḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕẖẗẘẙẚẛạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹἀἁἂἃἄἅἆἇἐἑἒἓἔἕἠἡἢἣἤἥἦἧἰἱἲἳἴἵἶἷὀὁὂὃὄὅὐὑὒὓὔὕὖὗὠὡὢὣὤὥὦὧὰάὲέὴήὶίὸόὺύὼώᾀᾁᾂᾃᾄᾅᾆᾇᾐᾑᾒᾓᾔᾕᾖᾗᾠᾡᾢᾣᾤᾥᾦᾧᾰᾱᾲᾳᾴᾶᾷιῂῃῄῆῇῐῑῒΐῖῗῠῡῢΰῤῥῦῧῲῳῴῶῷⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣⳤⴀⴁⴂⴃⴄⴅⴆⴇⴈⴉⴊⴋⴌⴍⴎⴏⴐⴑⴒⴓⴔⴕⴖⴗⴘⴙⴚⴛⴜⴝⴞⴟⴠⴡⴢⴣⴤⴥfffiflffifflſtstﬓﬔﬕﬖﬗ\d-_^]/8
/ End of testinput4 / / End of testinput4 /

2
ext/pcre/pcrelib/testdata/testoutput4

@ -1069,4 +1069,6 @@ No match
0: M 0: M
0: \x{442} 0: \x{442}
/[^ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽƁƂƄƆƇƉƊƋƎƏƐƑƓƔƖƗƘƜƝƟƠƢƤƦƧƩƬƮƯƱƲƳƵƷƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶǷǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺȻȽȾɁΆΈΉΊΌΎΏΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΪΫϒϓϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹϺϽϾϿЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸԀԂԄԆԈԊԌԎԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔՕՖႠႡႢႣႤႥႦႧႨႩႪႫႬႭႮႯႰႱႲႳႴႵႶႷႸႹႺႻႼႽႾႿჀჁჂჃჄჅḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸἈἉἊἋἌἍἎἏἘἙἚἛἜἝἨἩἪἫἬἭἮἯἸἹἺἻἼἽἾἿὈὉὊὋὌὍὙὛὝὟὨὩὪὫὬὭὮὯᾸᾹᾺΆῈΈῊΉῘῙῚΊῨῩῪΎῬῸΌῺΏabcdefghijklmnopqrstuvwxyzªµºßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķĸĺļľŀłńņňʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżžſƀƃƅƈƌƍƒƕƙƚƛƞơƣƥƨƪƫƭưƴƶƹƺƽƾƿdžljnjǎǐǒǔǖǘǚǜǝǟǡǣǥǧǩǫǭǯǰdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳȴȵȶȷȸȹȼȿɀɐɑɒɓɔɕɖɗɘəɚɛɜɝɞɟɠɡɢɣɤɥɦɧɨɩɪɫɬɭɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿʀʁʂʃʄʅʆʇʈʉʊʋʌʍʎʏʐʑʒʓʔʕʖʗʘʙʚʛʜʝʞʟʠʡʢʣʤʥʦʧʨʩʪʫʬʭʮʯΐάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώϐϑϕϖϗϙϛϝϟϡϣϥϧϩϫϭϯϰϱϲϳϵϸϻϼабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹԁԃԅԇԉԋԍԏաբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆևᴀᴁᴂᴃᴄᴅᴆᴇᴈᴉᴊᴋᴌᴍᴎᴏᴐᴑᴒᴓᴔᴕᴖᴗᴘᴙᴚᴛᴜᴝᴞᴟᴠᴡᴢᴣᴤᴥᴦᴧᴨᴩᴪᴫᵢᵣᵤᵥᵦᵧᵨᵩᵪᵫᵬᵭᵮᵯᵰᵱᵲᵳᵴᵵᵶᵷᵹᵺᵻᵼᵽᵾᵿᶀᶁᶂᶃᶄᶅᶆᶇᶈᶉᶊᶋᶌᶍᶎᶏᶐᶑᶒᶓᶔᶕᶖᶗᶘᶙᶚḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕẖẗẘẙẚẛạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹἀἁἂἃἄἅἆἇἐἑἒἓἔἕἠἡἢἣἤἥἦἧἰἱἲἳἴἵἶἷὀὁὂὃὄὅὐὑὒὓὔὕὖὗὠὡὢὣὤὥὦὧὰάὲέὴήὶίὸόὺύὼώᾀᾁᾂᾃᾄᾅᾆᾇᾐᾑᾒᾓᾔᾕᾖᾗᾠᾡᾢᾣᾤᾥᾦᾧᾰᾱᾲᾳᾴᾶᾷιῂῃῄῆῇῐῑῒΐῖῗῠῡῢΰῤῥῦῧῲῳῴῶῷⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣⳤⴀⴁⴂⴃⴄⴅⴆⴇⴈⴉⴊⴋⴌⴍⴎⴏⴐⴑⴒⴓⴔⴕⴖⴗⴘⴙⴚⴛⴜⴝⴞⴟⴠⴡⴢⴣⴤⴥfffiflffifflſtstﬓﬔﬕﬖﬗ\d-_^]/8
/ End of testinput4 / / End of testinput4 /
Loading…
Cancel
Save