Imported Upstream version 10.21
authorMatthew Vernon <matthew@debian.org>
Sat, 27 Feb 2016 15:00:32 +0000 (15:00 +0000)
committerMatthew Vernon <matthew@debian.org>
Sat, 27 Feb 2016 15:00:32 +0000 (15:00 +0000)
173 files changed:
132html
AUTHORS
CMakeLists.txt
COPYING
ChangeLog
LICENCE
Makefile.am
Makefile.in
NEWS
NON-AUTOTOOLS-BUILD
PrepareRelease
README
RunGrepTest
RunTest
RunTest.bat
aclocal.m4
config-cmake.h.in
configure
configure.ac
doc/html/NON-AUTOTOOLS-BUILD.txt
doc/html/README.txt
doc/html/index.html
doc/html/pcre2.html
doc/html/pcre2_code_free.html
doc/html/pcre2_match_data_create.html
doc/html/pcre2_match_data_create_from_pattern.html
doc/html/pcre2_pattern_info.html
doc/html/pcre2_serialize_decode.html
doc/html/pcre2_serialize_encode.html
doc/html/pcre2_set_offset_limit.html [new file with mode: 0644]
doc/html/pcre2_substitute.html
doc/html/pcre2api.html
doc/html/pcre2build.html
doc/html/pcre2jit.html
doc/html/pcre2limits.html
doc/html/pcre2pattern.html
doc/html/pcre2perform.html
doc/html/pcre2posix.html
doc/html/pcre2serialize.html
doc/html/pcre2syntax.html
doc/html/pcre2test.html
doc/html/pcre2unicode.html
doc/index.html.src
doc/pcre2.3
doc/pcre2.txt
doc/pcre2_code_free.3
doc/pcre2_match_data_create.3
doc/pcre2_match_data_create_from_pattern.3
doc/pcre2_pattern_info.3
doc/pcre2_serialize_decode.3
doc/pcre2_serialize_encode.3
doc/pcre2_set_offset_limit.3 [new file with mode: 0644]
doc/pcre2_substitute.3
doc/pcre2api.3
doc/pcre2build.3
doc/pcre2jit.3
doc/pcre2limits.3
doc/pcre2pattern.3
doc/pcre2posix.3
doc/pcre2serialize.3
doc/pcre2syntax.3
doc/pcre2test.1
doc/pcre2test.txt
doc/pcre2unicode.3
perltest.sh
src/config.h.generic
src/config.h.in
src/dftables.c
src/pcre2.h.generic
src/pcre2.h.in
src/pcre2_auto_possess.c
src/pcre2_compile.c
src/pcre2_config.c
src/pcre2_context.c
src/pcre2_dfa_match.c
src/pcre2_error.c
src/pcre2_find_bracket.c [new file with mode: 0644]
src/pcre2_internal.h
src/pcre2_intmodedep.h
src/pcre2_jit_compile.c
src/pcre2_jit_match.c
src/pcre2_jit_misc.c
src/pcre2_jit_test.c
src/pcre2_maketables.c
src/pcre2_match.c
src/pcre2_match_data.c
src/pcre2_newline.c
src/pcre2_ord2utf.c
src/pcre2_pattern_info.c
src/pcre2_printint.c
src/pcre2_serialize.c
src/pcre2_string_utils.c
src/pcre2_study.c
src/pcre2_substitute.c
src/pcre2_substring.c
src/pcre2_tables.c
src/pcre2_ucd.c
src/pcre2_ucp.h
src/pcre2_valid_utf.c
src/pcre2_xclass.c
src/pcre2grep.c
src/pcre2posix.c
src/pcre2posix.h
src/pcre2test.c
src/sljit/sljitConfigInternal.h
src/sljit/sljitLir.h
src/sljit/sljitNativeTILEGX_64.c
src/sljit/sljitNativeX86_common.c
testdata/grepoutput
testdata/testinput1
testdata/testinput10
testdata/testinput11
testdata/testinput12
testdata/testinput14
testdata/testinput15
testdata/testinput16
testdata/testinput17
testdata/testinput18
testdata/testinput19
testdata/testinput2
testdata/testinput20 [new file with mode: 0644]
testdata/testinput21 [new file with mode: 0644]
testdata/testinput22 [new file with mode: 0644]
testdata/testinput23 [new file with mode: 0644]
testdata/testinput3
testdata/testinput4
testdata/testinput5
testdata/testinput6
testdata/testinput7
testdata/testinput8
testdata/testinput9
testdata/testoutput1
testdata/testoutput10
testdata/testoutput11-16
testdata/testoutput11-32
testdata/testoutput12-16
testdata/testoutput12-32
testdata/testoutput14 [deleted file]
testdata/testoutput14-16 [new file with mode: 0644]
testdata/testoutput14-32 [new file with mode: 0644]
testdata/testoutput14-8 [new file with mode: 0644]
testdata/testoutput15
testdata/testoutput16
testdata/testoutput17
testdata/testoutput18
testdata/testoutput19
testdata/testoutput2
testdata/testoutput20 [new file with mode: 0644]
testdata/testoutput21 [new file with mode: 0644]
testdata/testoutput22-16 [new file with mode: 0644]
testdata/testoutput22-32 [new file with mode: 0644]
testdata/testoutput22-8 [new file with mode: 0644]
testdata/testoutput23 [new file with mode: 0644]
testdata/testoutput3
testdata/testoutput3A
testdata/testoutput3B
testdata/testoutput4
testdata/testoutput5
testdata/testoutput6
testdata/testoutput7
testdata/testoutput8-16 [deleted file]
testdata/testoutput8-16-2 [new file with mode: 0644]
testdata/testoutput8-16-3 [new file with mode: 0644]
testdata/testoutput8-32 [deleted file]
testdata/testoutput8-32-2 [new file with mode: 0644]
testdata/testoutput8-32-3 [new file with mode: 0644]
testdata/testoutput8-32-4 [new file with mode: 0644]
testdata/testoutput8-8 [deleted file]
testdata/testoutput8-8-2 [new file with mode: 0644]
testdata/testoutput8-8-3 [new file with mode: 0644]
testdata/testoutput8-8-4 [new file with mode: 0644]
testdata/testoutput9
testdata/valgrind-jit.supp [new file with mode: 0644]

diff --git a/132html b/132html
index b062598483b0c3584a1533a9b949765fd48cf37c..3a16a59e0c3afced6aa038bd586d2493f11540b0 100755 (executable)
--- a/132html
+++ b/132html
@@ -148,7 +148,7 @@ while (<STDIN>)
         printf("<li><a name=\"TOC%d\" href=\"#SEC%d\">$title</a>\n",
           $ref, $ref);
         printf TEMP ("<br><a name=\"SEC%d\" href=\"#TOC1\">$title</a><br>\n",
-          $ref, $ref);
+          $ref);
         $ref++;
         }
       else
diff --git a/AUTHORS b/AUTHORS
index 14a1a19fdd5df73cd105c732e841662fa04f5f79..d9a0e15690178f4a50389d1e637c3a22f8a296dd 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -8,7 +8,7 @@ Email domain:     cam.ac.uk
 University of Cambridge Computing Service,
 Cambridge, England.
 
-Copyright (c) 1997-2015 University of Cambridge
+Copyright (c) 1997-2016 University of Cambridge
 All rights reserved
 
 
@@ -19,7 +19,7 @@ Written by:       Zoltan Herczeg
 Email local part: hzmester
 Emain domain:     freemail.hu
 
-Copyright(c) 2010-2015 Zoltan Herczeg
+Copyright(c) 2010-2016 Zoltan Herczeg
 All rights reserved.
 
 
@@ -30,7 +30,7 @@ Written by:       Zoltan Herczeg
 Email local part: hzmester
 Emain domain:     freemail.hu
 
-Copyright(c) 2009-2015 Zoltan Herczeg
+Copyright(c) 2009-2016 Zoltan Herczeg
 All rights reserved.
 
 ####
index b76a95309396d9924dedb400c559382540b4d85f..2c84b054d92a1717d334b2c07a602aee97e7df46 100644 (file)
 # 2013-10-08 PH got rid of the "source" command, which is a bash-ism (use ".")
 # 2013-11-05 PH added support for PARENS_NEST_LIMIT
 # 2014-08-29 PH converted the file for PCRE2 (which has no C++).
-# 2015-04024 PH added support for PCRE2_DEBUG
+# 2015-04-24 PH added support for PCRE2_DEBUG
+# 2015-07-16 PH updated for new pcre2_find_bracket source module
+# 2015-08-24 PH correct C_FLAGS setting (patch from Roy Ivy III)
+# 2015-10=16 PH added support for never-backslash-C
 
 PROJECT(PCRE2 C)
 
@@ -79,7 +82,7 @@ CMAKE_POLICY(SET CMP0026 OLD)
 
 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake
 
-SET(CMAKE_C_FLAGS -I${PROJECT_SOURCE_DIR}/src)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${PROJECT_SOURCE_DIR}/src")
 
 # external packages
 FIND_PACKAGE( BZip2 )
@@ -160,6 +163,9 @@ SET(PCRE2_SUPPORT_UNICODE ON CACHE BOOL
 SET(PCRE2_SUPPORT_BSR_ANYCRLF OFF CACHE BOOL
     "ON=Backslash-R matches only LF CR and CRLF, OFF=Backslash-R matches all Unicode Linebreaks")
 
+SET(PCRE2_NEVER_BACKSLASH_C OFF CACHE BOOL
+    "If ON, backslash-C (upper case C) is locked out.")
+
 SET(PCRE2_SUPPORT_VALGRIND OFF CACHE BOOL
     "Enable Valgrind support.")
 
@@ -250,6 +256,10 @@ IF(PCRE2_SUPPORT_BSR_ANYCRLF)
         SET(BSR_ANYCRLF 1)
 ENDIF(PCRE2_SUPPORT_BSR_ANYCRLF)
 
+IF(PCRE2_NEVER_BACKSLASH_C)
+        SET(NEVER_BACKSLASH_C 1)
+ENDIF(PCRE2_NEVER_BACKSLASH_C)
+
 IF(PCRE2_SUPPORT_UNICODE)
         SET(SUPPORT_UNICODE 1)
 ENDIF(PCRE2_SUPPORT_UNICODE)
@@ -390,6 +400,7 @@ SET(PCRE2_SOURCES
   src/pcre2_context.c
   src/pcre2_dfa_match.c
   src/pcre2_error.c
+  src/pcre2_find_bracket.c
   src/pcre2_jit_compile.c
   src/pcre2_maketables.c
   src/pcre2_match.c
@@ -716,6 +727,7 @@ IF(PCRE2_SHOW_REPORT)
   MESSAGE(STATUS "  Enable Unicode support .......... : ${PCRE2_SUPPORT_UNICODE}")
   MESSAGE(STATUS "  Newline char/sequence ........... : ${PCRE2_NEWLINE}")
   MESSAGE(STATUS "  \\R matches only ANYCRLF ......... : ${PCRE2_SUPPORT_BSR_ANYCRLF}")
+  MESSAGE(STATUS "  \\C is disabled .................. : ${PCRE2_NEVER_BACKSLASH_C}")
   MESSAGE(STATUS "  EBCDIC coding ................... : ${PCRE2_EBCDIC}")
   MESSAGE(STATUS "  EBCDIC coding with NL=0x25 ...... : ${PCRE2_EBCDIC_NL25}")
   MESSAGE(STATUS "  Rebuild char tables ............. : ${PCRE2_REBUILD_CHARTABLES}")
diff --git a/COPYING b/COPYING
index 94a9ed024d3859793618152ea559a168bbcbb5e2..c233950f6f1766b1b1023373dcbee51dbc9a8669 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -1,674 +1,5 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
+PCRE2 LICENCE
 
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
+Please see the file LICENCE in the PCRE2 distribution for licensing details.
 
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+End
index 196e95320af159cda43c46034f175db73ef32a3c..2035490c661a18fa9b2b7e9a12d8055c8bd05960 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,397 @@
 Change Log for PCRE2
 --------------------
 
+Version 10.21 12-January-2016
+-----------------------------
+
+1. Improve matching speed of patterns starting with + or * in JIT.
+
+2. Use memchr() to find the first character in an unanchored match in 8-bit
+mode in the interpreter. This gives a significant speed improvement.
+
+3. Removed a redundant copy of the opcode_possessify table in the
+pcre2_auto_possessify.c source.
+
+4. Fix typos in dftables.c for z/OS.
+
+5. Change 36 for 10.20 broke the handling of [[:>:]] and [[:<:]] in that
+processing them could involve a buffer overflow if the following character was
+an opening parenthesis.
+
+6. Change 36 for 10.20 also introduced a bug in processing this pattern:
+/((?x)(*:0))#(?'/. Specifically: if a setting of (?x) was followed by a (*MARK)
+setting (which (*:0) is), then (?x) did not get unset at the end of its group
+during the scan for named groups, and hence the external # was incorrectly
+treated as a comment and the invalid (?' at the end of the pattern was not
+diagnosed. This caused a buffer overflow during the real compile. This bug was
+discovered by Karl Skomski with the LLVM fuzzer.
+
+7. Moved the pcre2_find_bracket() function from src/pcre2_compile.c into its
+own source module to avoid a circular dependency between src/pcre2_compile.c
+and src/pcre2_study.c
+
+8. A callout with a string argument containing an opening square bracket, for
+example /(?C$[$)(?<]/, was incorrectly processed and could provoke a buffer
+overflow. This bug was discovered by Karl Skomski with the LLVM fuzzer.
+
+9. The handling of callouts during the pre-pass for named group identification
+has been tightened up.
+
+10. The quantifier {1} can be ignored, whether greedy, non-greedy, or
+possessive. This is a very minor optimization.
+
+11. A possessively repeated conditional group that could match an empty string,
+for example, /(?(R))*+/, was incorrectly compiled.
+
+12. The Unicode tables have been updated to Unicode 8.0.0 (thanks to Christian
+Persch).
+
+13. An empty comment (?#) in a pattern was incorrectly processed and could
+provoke a buffer overflow. This bug was discovered by Karl Skomski with the
+LLVM fuzzer.
+
+14. Fix infinite recursion in the JIT compiler when certain patterns such as
+/(?:|a|){100}x/ are analysed.
+
+15. Some patterns with character classes involving [: and \\ were incorrectly
+compiled and could cause reading from uninitialized memory or an incorrect
+error diagnosis. Examples are: /[[:\\](?<[::]/ and /[[:\\](?'abc')[a:]. The
+first of these bugs was discovered by Karl Skomski with the LLVM fuzzer.
+
+16. Pathological patterns containing many nested occurrences of [: caused
+pcre2_compile() to run for a very long time. This bug was found by the LLVM
+fuzzer.
+
+17. A missing closing parenthesis for a callout with a string argument was not
+being diagnosed, possibly leading to a buffer overflow. This bug was found by
+the LLVM fuzzer.
+
+18. A conditional group with only one branch has an implicit empty alternative
+branch and must therefore be treated as potentially matching an empty string.
+
+19. If (?R was followed by - or + incorrect behaviour happened instead of a
+diagnostic. This bug was discovered by Karl Skomski with the LLVM fuzzer.
+
+20. Another bug that was introduced by change 36 for 10.20: conditional groups
+whose condition was an assertion preceded by an explicit callout with a string
+argument might be incorrectly processed, especially if the string contained \Q.
+This bug was discovered by Karl Skomski with the LLVM fuzzer.
+
+21. Compiling PCRE2 with the sanitize options of clang showed up a number of
+very pedantic coding infelicities and a buffer overflow while checking a UTF-8
+string if the final multi-byte UTF-8 character was truncated.
+
+22. For Perl compatibility in EBCDIC environments, ranges such as a-z in a
+class, where both values are literal letters in the same case, omit the
+non-letter EBCDIC code points within the range.
+
+23. Finding the minimum matching length of complex patterns with back
+references and/or recursions can take a long time. There is now a cut-off that
+gives up trying to find a minimum length when things get too complex.
+
+24. An optimization has been added that speeds up finding the minimum matching
+length for patterns containing repeated capturing groups or recursions.
+
+25. If a pattern contained a back reference to a group whose number was
+duplicated as a result of appearing in a (?|...) group, the computation of the
+minimum matching length gave a wrong result, which could cause incorrect "no
+match" errors. For such patterns, a minimum matching length cannot at present
+be computed.
+
+26. Added a check for integer overflow in conditions (?(<digits>) and
+(?(R<digits>). This omission was discovered by Karl Skomski with the LLVM
+fuzzer.
+
+27. Fixed an issue when \p{Any} inside an xclass did not read the current
+character.
+
+28. If pcre2grep was given the -q option with -c or -l, or when handling a
+binary file, it incorrectly wrote output to stdout.
+
+29. The JIT compiler did not restore the control verb head in case of *THEN
+control verbs. This issue was found by Karl Skomski with a custom LLVM fuzzer.
+
+30. The way recursive references such as (?3) are compiled has been re-written
+because the old way was the cause of many issues. Now, conversion of the group
+number into a pattern offset does not happen until the pattern has been
+completely compiled. This does mean that detection of all infinitely looping
+recursions is postponed till match time. In the past, some easy ones were
+detected at compile time. This re-writing was done in response to yet another
+bug found by the LLVM fuzzer.
+
+31. A test for a back reference to a non-existent group was missing for items
+such as \987. This caused incorrect code to be compiled. This issue was found
+by Karl Skomski with a custom LLVM fuzzer.
+
+32. Error messages for syntax errors following \g and \k were giving inaccurate
+offsets in the pattern.
+
+33. Improve the performance of starting single character repetitions in JIT.
+
+34. (*LIMIT_MATCH=) now gives an error instead of setting the value to 0.
+
+35. Error messages for syntax errors in *LIMIT_MATCH and *LIMIT_RECURSION now
+give the right offset instead of zero.
+
+36. The JIT compiler should not check repeats after a {0,1} repeat byte code.
+This issue was found by Karl Skomski with a custom LLVM fuzzer.
+
+37. The JIT compiler should restore the control chain for empty possessive
+repeats. This issue was found by Karl Skomski with a custom LLVM fuzzer.
+
+38. A bug which was introduced by the single character repetition optimization
+was fixed.
+
+39. Match limit check added to recursion. This issue was found by Karl Skomski
+with a custom LLVM fuzzer.
+
+40. Arrange for the UTF check in pcre2_match() and pcre2_dfa_match() to look
+only at the part of the subject that is relevant when the starting offset is
+non-zero.
+
+41. Improve first character match in JIT with SSE2 on x86.
+
+42. Fix two assertion fails in JIT. These issues were found by Karl Skomski
+with a custom LLVM fuzzer.
+
+43. Correct the setting of CMAKE_C_FLAGS in CMakeLists.txt (patch from Roy Ivy
+III).
+
+44. Fix bug in RunTest.bat for new test 14, and adjust the script for the added
+test (there are now 20 in total).
+
+45. Fixed a corner case of range optimization in JIT.
+
+46. Add the ${*MARK} facility to pcre2_substitute().
+
+47. Modifier lists in pcre2test were splitting at spaces without the required
+commas.
+
+48. Implemented PCRE2_ALT_VERBNAMES.
+
+49. Fixed two issues in JIT. These were found by Karl Skomski with a custom
+LLVM fuzzer.
+
+50. The pcre2test program has been extended by adding the #newline_default
+command. This has made it possible to run the standard tests when PCRE2 is
+compiled with either CR or CRLF as the default newline convention. As part of
+this work, the new command was added to several test files and the testing
+scripts were modified. The pcre2grep tests can now also be run when there is no
+LF in the default newline convention.
+
+51. The RunTest script has been modified so that, when JIT is used and valgrind
+is specified, a valgrind suppressions file is set up to ignore "Invalid read of
+size 16" errors because these are false positives when the hardware supports
+the SSE2 instruction set.
+
+52. It is now possible to have comment lines amid the subject strings in
+pcre2test (and perltest.sh) input.
+
+53. Implemented PCRE2_USE_OFFSET_LIMIT and pcre2_set_offset_limit().
+
+54. Add the null_context modifier to pcre2test so that calling pcre2_compile()
+and the matching functions with NULL contexts can be tested.
+
+55. Implemented PCRE2_SUBSTITUTE_EXTENDED.
+
+56. In a character class such as [\W\p{Any}] where both a negative-type escape
+("not a word character") and a property escape were present, the property
+escape was being ignored.
+
+57. Fixed integer overflow for patterns whose minimum matching length is very,
+very large.
+
+58. Implemented --never-backslash-C.
+
+59. Change 55 above introduced a bug by which certain patterns provoked the
+erroneous error "\ at end of pattern".
+
+60. The special sequences [[:<:]] and [[:>:]] gave rise to incorrect compiling
+errors or other strange effects if compiled in UCP mode. Found with libFuzzer
+and AddressSanitizer.
+
+61. Whitespace at the end of a pcre2test pattern line caused a spurious error
+message if there were only single-character modifiers. It should be ignored.
+
+62. The use of PCRE2_NO_AUTO_CAPTURE could cause incorrect compilation results
+or segmentation errors for some patterns. Found with libFuzzer and
+AddressSanitizer.
+
+63. Very long names in (*MARK) or (*THEN) etc. items could provoke a buffer
+overflow.
+
+64. Improve error message for overly-complicated patterns.
+
+65. Implemented an optional replication feature for patterns in pcre2test, to
+make it easier to test long repetitive patterns. The tests for 63 above are
+converted to use the new feature.
+
+66. In the POSIX wrapper, if regerror() was given too small a buffer, it could
+misbehave.
+
+67. In pcre2_substitute() in UTF mode, the UTF validity check on the
+replacement string was happening before the length setting when the replacement
+string was zero-terminated.
+
+68. In pcre2_substitute() in UTF mode, PCRE2_NO_UTF_CHECK can be set for the
+second and subsequent calls to pcre2_match().
+
+69. There was no check for integer overflow for a replacement group number in
+pcre2_substitute(). An added check for a number greater than the largest group
+number in the pattern means this is not now needed.
+
+70. The PCRE2-specific VERSION condition didn't work correctly if only one
+digit was given after the decimal point, or if more than two digits were given.
+It now works with one or two digits, and gives a compile time error if more are
+given.
+
+71. In pcre2_substitute() there was the possibility of reading one code unit
+beyond the end of the replacement string.
+
+72. The code for checking a subject's UTF-32 validity for a pattern with a
+lookbehind involved an out-of-bounds pointer, which could potentially cause
+trouble in some environments.
+
+73. The maximum lookbehind length was incorrectly calculated for patterns such
+as /(?<=(a)(?-1))x/ which have a recursion within a backreference.
+
+74. Give an error if a lookbehind assertion is longer than 65535 code units.
+
+75. Give an error in pcre2_substitute() if a match ends before it starts (as a
+result of the use of \K).
+
+76. Check the length of subpattern names and the names in (*MARK:xx) etc.
+dynamically to avoid the possibility of integer overflow.
+
+77. Implement pcre2_set_max_pattern_length() so that programs can restrict the
+size of patterns that they are prepared to handle.
+
+78. (*NO_AUTO_POSSESS) was not working.
+
+79. Adding group information caching improves the speed of compiling when
+checking whether a group has a fixed length and/or could match an empty string,
+especially when recursion or subroutine calls are involved. However, this
+cannot be used when (?| is present in the pattern because the same number may
+be used for groups of different sizes. To catch runaway patterns in this
+situation, counts have been introduced to the functions that scan for empty
+branches or compute fixed lengths.
+
+80. Allow for the possibility of the size of the nest_save structure not being
+a factor of the size of the compiling workspace (it currently is).
+
+81. Check for integer overflow in minimum length calculation and cap it at
+65535.
+
+82. Small optimizations in code for finding the minimum matching length.
+
+83. Lock out configuring for EBCDIC with non-8-bit libraries.
+
+84. Test for error code <= 0 in regerror().
+
+85. Check for too many replacements (more than INT_MAX) in pcre2_substitute().
+
+86. Avoid the possibility of computing with an out-of-bounds pointer (though
+not dereferencing it) while handling lookbehind assertions.
+
+87. Failure to get memory for the match data in regcomp() is now given as a
+regcomp() error instead of waiting for regexec() to pick it up.
+
+88. In pcre2_substitute(), ensure that CRLF is not split when it is a valid
+newline sequence.
+
+89. Paranoid check in regcomp() for bad error code from pcre2_compile().
+
+90. Run test 8 (internal offsets and code sizes) for link sizes 3 and 4 as well
+as for link size 2.
+
+91. Document that JIT has a limit on pattern size, and give more information
+about JIT compile failures in pcre2test.
+
+92. Implement PCRE2_INFO_HASBACKSLASHC.
+
+93. Re-arrange valgrind support code in pcre2test to avoid spurious reports
+with JIT (possibly caused by SSE2?).
+
+94. Support offset_limit in JIT.
+
+95. A sequence such as [[:punct:]b] that is, a POSIX character class followed
+by a single ASCII character in a class item, was incorrectly compiled in UCP
+mode. The POSIX class got lost, but only if the single character followed it.
+
+96. [:punct:] in UCP mode was matching some characters in the range 128-255
+that should not have been matched.
+
+97. If [:^ascii:] or [:^xdigit:] are present in a non-negated class, all
+characters with code points greater than 255 are in the class. When a Unicode
+property was also in the class (if PCRE2_UCP is set, escapes such as \w are
+turned into Unicode properties), wide characters were not correctly handled,
+and could fail to match.
+
+98. In pcre2test, make the "startoffset" modifier a synonym of "offset",
+because it sets the "startoffset" parameter for pcre2_match().
+
+99. If PCRE2_AUTO_CALLOUT was set on a pattern that had a (?# comment between
+an item and its qualifier (for example, A(?#comment)?B) pcre2_compile()
+misbehaved. This bug was found by the LLVM fuzzer.
+
+100. The error for an invalid UTF pattern string always gave the code unit
+offset as zero instead of where the invalidity was found.
+
+101. Further to 97 above, negated classes such as [^[:^ascii:]\d] were also not
+working correctly in UCP mode.
+
+102. Similar to 99 above, if an isolated \E was present between an item and its
+qualifier when PCRE2_AUTO_CALLOUT was set, pcre2_compile() misbehaved. This bug
+was found by the LLVM fuzzer.
+
+103. The POSIX wrapper function regexec() crashed if the option REG_STARTEND
+was set when the pmatch argument was NULL. It now returns REG_INVARG.
+
+104. Allow for up to 32-bit numbers in the ordin() function in pcre2grep.
+
+105. An empty \Q\E sequence between an item and its qualifier caused
+pcre2_compile() to misbehave when auto callouts were enabled. This bug
+was found by the LLVM fuzzer.
+
+106. If both PCRE2_ALT_VERBNAMES and PCRE2_EXTENDED were set, and a (*MARK) or
+other verb "name" ended with whitespace immediately before the closing
+parenthesis, pcre2_compile() misbehaved. Example: /(*:abc )/, but only when
+both those options were set.
+
+107. In a number of places pcre2_compile() was not handling NULL characters
+correctly, and pcre2test with the "bincode" modifier was not always correctly
+displaying fields containing NULLS:
+
+   (a) Within /x extended #-comments
+   (b) Within the "name" part of (*MARK) and other *verbs
+   (c) Within the text argument of a callout
+
+108. If a pattern that was compiled with PCRE2_EXTENDED started with white
+space or a #-type comment that was followed by (?-x), which turns off
+PCRE2_EXTENDED, and there was no subsequent (?x) to turn it on again,
+pcre2_compile() assumed that (?-x) applied to the whole pattern and
+consequently mis-compiled it. This bug was found by the LLVM fuzzer. The fix
+for this bug means that a setting of any of the (?imsxU) options at the start
+of a pattern is no longer transferred to the options that are returned by
+PCRE2_INFO_ALLOPTIONS. In fact, this was an anachronism that should have
+changed when the effects of those options were all moved to compile time.
+
+109. An escaped closing parenthesis in the "name" part of a (*verb) when
+PCRE2_ALT_VERBNAMES was set caused pcre2_compile() to malfunction. This bug
+was found by the LLVM fuzzer.
+
+110. Implemented PCRE2_SUBSTITUTE_UNSET_EMPTY, and updated pcre2test to make it
+possible to test it.
+
+111. "Harden" pcre2test against ridiculously large values in modifiers and
+command line arguments.
+
+112. Implemented PCRE2_SUBSTITUTE_UNKNOWN_UNSET and PCRE2_SUBSTITUTE_OVERFLOW_
+LENGTH.
+
+113. Fix printing of *MARK names that contain binary zeroes in pcre2test.
+
+
 Version 10.20 30-June-2015
 --------------------------
 
diff --git a/LICENCE b/LICENCE
index 30416d843e6f4e53c6602a48e4028968ed679c3b..6600a659074f5f71c6dc4e71099961d2bfc5ab5b 100644 (file)
--- a/LICENCE
+++ b/LICENCE
@@ -25,7 +25,7 @@ Email domain:     cam.ac.uk
 University of Cambridge Computing Service,
 Cambridge, England.
 
-Copyright (c) 1997-2015 University of Cambridge
+Copyright (c) 1997-2016 University of Cambridge
 All rights reserved.
 
 
@@ -36,7 +36,7 @@ Written by:       Zoltan Herczeg
 Email local part: hzmester
 Emain domain:     freemail.hu
 
-Copyright(c) 2010-2015 Zoltan Herczeg
+Copyright(c) 2010-2016 Zoltan Herczeg
 All rights reserved.
 
 
@@ -47,7 +47,7 @@ Written by:       Zoltan Herczeg
 Email local part: hzmester
 Emain domain:     freemail.hu
 
-Copyright(c) 2009-2015 Zoltan Herczeg
+Copyright(c) 2009-2016 Zoltan Herczeg
 All rights reserved.
 
 
index 56f93db2e6537647e296fe97f9ad714d2a48ec72..5977ba06b90005bd1c5a96d28147b6cb6bcfddb6 100644 (file)
@@ -64,6 +64,7 @@ dist_html_DATA = \
   doc/html/pcre2_set_character_tables.html \
   doc/html/pcre2_set_compile_recursion_guard.html \
   doc/html/pcre2_set_match_limit.html \
+  doc/html/pcre2_set_offset_limit.html \
   doc/html/pcre2_set_newline.html \
   doc/html/pcre2_set_parens_nest_limit.html \
   doc/html/pcre2_set_recursion_limit.html \
@@ -143,6 +144,7 @@ dist_man_MANS = \
   doc/pcre2_set_character_tables.3 \
   doc/pcre2_set_compile_recursion_guard.3 \
   doc/pcre2_set_match_limit.3 \
+  doc/pcre2_set_offset_limit.3 \
   doc/pcre2_set_newline.3 \
   doc/pcre2_set_parens_nest_limit.3 \
   doc/pcre2_set_recursion_limit.3 \
@@ -319,6 +321,7 @@ COMMON_SOURCES = \
   src/pcre2_context.c \
   src/pcre2_dfa_match.c \
   src/pcre2_error.c \
+  src/pcre2_find_bracket.c \
   src/pcre2_internal.h \
   src/pcre2_intmodedep.h \
   src/pcre2_jit_compile.c \
@@ -586,6 +589,10 @@ EXTRA_DIST += \
   testdata/testinput17 \
   testdata/testinput18 \
   testdata/testinput19 \
+  testdata/testinput20 \
+  testdata/testinput21 \
+  testdata/testinput22 \
+  testdata/testinput23 \
   testdata/testinputEBC \
   testdata/testoutput1 \
   testdata/testoutput2 \
@@ -596,9 +603,15 @@ EXTRA_DIST += \
   testdata/testoutput5 \
   testdata/testoutput6 \
   testdata/testoutput7 \
-  testdata/testoutput8-16 \
-  testdata/testoutput8-32 \
-  testdata/testoutput8-8 \
+  testdata/testoutput8-16-2 \
+  testdata/testoutput8-16-3 \
+  testdata/testoutput8-16-3 \
+  testdata/testoutput8-32-2 \
+  testdata/testoutput8-32-3 \
+  testdata/testoutput8-32-4 \
+  testdata/testoutput8-8-2 \
+  testdata/testoutput8-8-3 \
+  testdata/testoutput8-8-4 \
   testdata/testoutput9 \
   testdata/testoutput10 \
   testdata/testoutput11-16 \
@@ -606,13 +619,22 @@ EXTRA_DIST += \
   testdata/testoutput12-16 \
   testdata/testoutput12-32 \
   testdata/testoutput13 \
-  testdata/testoutput14 \
+  testdata/testoutput14-16 \
+  testdata/testoutput14-32 \
+  testdata/testoutput14-8 \
   testdata/testoutput15 \
   testdata/testoutput16 \
   testdata/testoutput17 \
   testdata/testoutput18 \
   testdata/testoutput19 \
+  testdata/testoutput20 \
+  testdata/testoutput21 \
+  testdata/testoutput22-16 \
+  testdata/testoutput22-32 \
+  testdata/testoutput22-8 \
+  testdata/testoutput23 \
   testdata/testoutputEBC \
+  testdata/valgrind-jit.supp \
   testdata/wintestinput3 \
   testdata/wintestoutput3 \
   perltest.sh
index 9c24e5a2e4c0e470bbdf5316379ce09fe6bcce13..d86120b5b00fa89f75a1ed3dd084fae292fe043f 100644 (file)
@@ -186,7 +186,8 @@ LTLIBRARIES = $(lib_LTLIBRARIES)
 libpcre2_16_la_DEPENDENCIES =
 am__libpcre2_16_la_SOURCES_DIST = src/pcre2_auto_possess.c \
        src/pcre2_compile.c src/pcre2_config.c src/pcre2_context.c \
-       src/pcre2_dfa_match.c src/pcre2_error.c src/pcre2_internal.h \
+       src/pcre2_dfa_match.c src/pcre2_error.c \
+       src/pcre2_find_bracket.c src/pcre2_internal.h \
        src/pcre2_intmodedep.h src/pcre2_jit_compile.c \
        src/pcre2_maketables.c src/pcre2_match.c \
        src/pcre2_match_data.c src/pcre2_newline.c src/pcre2_ord2utf.c \
@@ -202,6 +203,7 @@ am__objects_1 = src/libpcre2_16_la-pcre2_auto_possess.lo \
        src/libpcre2_16_la-pcre2_context.lo \
        src/libpcre2_16_la-pcre2_dfa_match.lo \
        src/libpcre2_16_la-pcre2_error.lo \
+       src/libpcre2_16_la-pcre2_find_bracket.lo \
        src/libpcre2_16_la-pcre2_jit_compile.lo \
        src/libpcre2_16_la-pcre2_maketables.lo \
        src/libpcre2_16_la-pcre2_match.lo \
@@ -235,7 +237,8 @@ libpcre2_16_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
 libpcre2_32_la_DEPENDENCIES =
 am__libpcre2_32_la_SOURCES_DIST = src/pcre2_auto_possess.c \
        src/pcre2_compile.c src/pcre2_config.c src/pcre2_context.c \
-       src/pcre2_dfa_match.c src/pcre2_error.c src/pcre2_internal.h \
+       src/pcre2_dfa_match.c src/pcre2_error.c \
+       src/pcre2_find_bracket.c src/pcre2_internal.h \
        src/pcre2_intmodedep.h src/pcre2_jit_compile.c \
        src/pcre2_maketables.c src/pcre2_match.c \
        src/pcre2_match_data.c src/pcre2_newline.c src/pcre2_ord2utf.c \
@@ -250,6 +253,7 @@ am__objects_3 = src/libpcre2_32_la-pcre2_auto_possess.lo \
        src/libpcre2_32_la-pcre2_context.lo \
        src/libpcre2_32_la-pcre2_dfa_match.lo \
        src/libpcre2_32_la-pcre2_error.lo \
+       src/libpcre2_32_la-pcre2_find_bracket.lo \
        src/libpcre2_32_la-pcre2_jit_compile.lo \
        src/libpcre2_32_la-pcre2_maketables.lo \
        src/libpcre2_32_la-pcre2_match.lo \
@@ -279,7 +283,8 @@ libpcre2_32_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
 libpcre2_8_la_DEPENDENCIES =
 am__libpcre2_8_la_SOURCES_DIST = src/pcre2_auto_possess.c \
        src/pcre2_compile.c src/pcre2_config.c src/pcre2_context.c \
-       src/pcre2_dfa_match.c src/pcre2_error.c src/pcre2_internal.h \
+       src/pcre2_dfa_match.c src/pcre2_error.c \
+       src/pcre2_find_bracket.c src/pcre2_internal.h \
        src/pcre2_intmodedep.h src/pcre2_jit_compile.c \
        src/pcre2_maketables.c src/pcre2_match.c \
        src/pcre2_match_data.c src/pcre2_newline.c src/pcre2_ord2utf.c \
@@ -294,6 +299,7 @@ am__objects_5 = src/libpcre2_8_la-pcre2_auto_possess.lo \
        src/libpcre2_8_la-pcre2_context.lo \
        src/libpcre2_8_la-pcre2_dfa_match.lo \
        src/libpcre2_8_la-pcre2_error.lo \
+       src/libpcre2_8_la-pcre2_find_bracket.lo \
        src/libpcre2_8_la-pcre2_jit_compile.lo \
        src/libpcre2_8_la-pcre2_maketables.lo \
        src/libpcre2_8_la-pcre2_match.lo \
@@ -864,6 +870,7 @@ dist_html_DATA = \
   doc/html/pcre2_set_character_tables.html \
   doc/html/pcre2_set_compile_recursion_guard.html \
   doc/html/pcre2_set_match_limit.html \
+  doc/html/pcre2_set_offset_limit.html \
   doc/html/pcre2_set_newline.html \
   doc/html/pcre2_set_parens_nest_limit.html \
   doc/html/pcre2_set_recursion_limit.html \
@@ -943,6 +950,7 @@ dist_man_MANS = \
   doc/pcre2_set_character_tables.3 \
   doc/pcre2_set_compile_recursion_guard.3 \
   doc/pcre2_set_match_limit.3 \
+  doc/pcre2_set_offset_limit.3 \
   doc/pcre2_set_newline.3 \
   doc/pcre2_set_parens_nest_limit.3 \
   doc/pcre2_set_recursion_limit.3 \
@@ -1051,21 +1059,30 @@ EXTRA_DIST = m4/ax_pthread.m4 m4/pcre2_visibility.m4 \
        testdata/testinput11 testdata/testinput12 testdata/testinput13 \
        testdata/testinput14 testdata/testinput15 testdata/testinput16 \
        testdata/testinput17 testdata/testinput18 testdata/testinput19 \
-       testdata/testinputEBC testdata/testoutput1 \
-       testdata/testoutput2 testdata/testoutput3 \
+       testdata/testinput20 testdata/testinput21 testdata/testinput22 \
+       testdata/testinput23 testdata/testinputEBC \
+       testdata/testoutput1 testdata/testoutput2 testdata/testoutput3 \
        testdata/testoutput3A testdata/testoutput3B \
        testdata/testoutput4 testdata/testoutput5 testdata/testoutput6 \
-       testdata/testoutput7 testdata/testoutput8-16 \
-       testdata/testoutput8-32 testdata/testoutput8-8 \
+       testdata/testoutput7 testdata/testoutput8-16-2 \
+       testdata/testoutput8-16-3 testdata/testoutput8-16-3 \
+       testdata/testoutput8-32-2 testdata/testoutput8-32-3 \
+       testdata/testoutput8-32-4 testdata/testoutput8-8-2 \
+       testdata/testoutput8-8-3 testdata/testoutput8-8-4 \
        testdata/testoutput9 testdata/testoutput10 \
        testdata/testoutput11-16 testdata/testoutput11-32 \
        testdata/testoutput12-16 testdata/testoutput12-32 \
-       testdata/testoutput13 testdata/testoutput14 \
+       testdata/testoutput13 testdata/testoutput14-16 \
+       testdata/testoutput14-32 testdata/testoutput14-8 \
        testdata/testoutput15 testdata/testoutput16 \
        testdata/testoutput17 testdata/testoutput18 \
-       testdata/testoutput19 testdata/testoutputEBC \
-       testdata/wintestinput3 testdata/wintestoutput3 perltest.sh \
-       src/pcre2demo.c cmake/COPYING-CMAKE-SCRIPTS \
+       testdata/testoutput19 testdata/testoutput20 \
+       testdata/testoutput21 testdata/testoutput22-16 \
+       testdata/testoutput22-32 testdata/testoutput22-8 \
+       testdata/testoutput23 testdata/testoutputEBC \
+       testdata/valgrind-jit.supp testdata/wintestinput3 \
+       testdata/wintestoutput3 perltest.sh src/pcre2demo.c \
+       cmake/COPYING-CMAKE-SCRIPTS \
        cmake/FindPackageHandleStandardArgs.cmake \
        cmake/FindReadline.cmake cmake/FindEditline.cmake \
        CMakeLists.txt config-cmake.h.in
@@ -1087,6 +1104,7 @@ COMMON_SOURCES = \
   src/pcre2_context.c \
   src/pcre2_dfa_match.c \
   src/pcre2_error.c \
+  src/pcre2_find_bracket.c \
   src/pcre2_internal.h \
   src/pcre2_intmodedep.h \
   src/pcre2_jit_compile.c \
@@ -1308,6 +1326,8 @@ src/libpcre2_16_la-pcre2_dfa_match.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_16_la-pcre2_error.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
+src/libpcre2_16_la-pcre2_find_bracket.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_16_la-pcre2_jit_compile.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_16_la-pcre2_maketables.lo: src/$(am__dirstamp) \
@@ -1357,6 +1377,8 @@ src/libpcre2_32_la-pcre2_dfa_match.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_32_la-pcre2_error.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
+src/libpcre2_32_la-pcre2_find_bracket.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_32_la-pcre2_jit_compile.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_32_la-pcre2_maketables.lo: src/$(am__dirstamp) \
@@ -1406,6 +1428,8 @@ src/libpcre2_8_la-pcre2_dfa_match.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_8_la-pcre2_error.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
+src/libpcre2_8_la-pcre2_find_bracket.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_8_la-pcre2_jit_compile.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_8_la-pcre2_maketables.lo: src/$(am__dirstamp) \
@@ -1582,6 +1606,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_dfa_match.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_error.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_find_bracket.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_jit_compile.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_maketables.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_match.Plo@am__quote@
@@ -1605,6 +1630,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_dfa_match.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_error.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_find_bracket.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_jit_compile.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_maketables.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_match.Plo@am__quote@
@@ -1628,6 +1654,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_dfa_match.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_error.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_find_bracket.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_jit_compile.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_maketables.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_match.Plo@am__quote@
@@ -1715,6 +1742,13 @@ src/libpcre2_16_la-pcre2_error.lo: src/pcre2_error.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_16_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_16_la-pcre2_error.lo `test -f 'src/pcre2_error.c' || echo '$(srcdir)/'`src/pcre2_error.c
 
+src/libpcre2_16_la-pcre2_find_bracket.lo: src/pcre2_find_bracket.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_16_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_16_la-pcre2_find_bracket.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_16_la-pcre2_find_bracket.Tpo -c -o src/libpcre2_16_la-pcre2_find_bracket.lo `test -f 'src/pcre2_find_bracket.c' || echo '$(srcdir)/'`src/pcre2_find_bracket.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_16_la-pcre2_find_bracket.Tpo src/$(DEPDIR)/libpcre2_16_la-pcre2_find_bracket.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/pcre2_find_bracket.c' object='src/libpcre2_16_la-pcre2_find_bracket.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_16_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_16_la-pcre2_find_bracket.lo `test -f 'src/pcre2_find_bracket.c' || echo '$(srcdir)/'`src/pcre2_find_bracket.c
+
 src/libpcre2_16_la-pcre2_jit_compile.lo: src/pcre2_jit_compile.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_16_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_16_la-pcre2_jit_compile.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_16_la-pcre2_jit_compile.Tpo -c -o src/libpcre2_16_la-pcre2_jit_compile.lo `test -f 'src/pcre2_jit_compile.c' || echo '$(srcdir)/'`src/pcre2_jit_compile.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_16_la-pcre2_jit_compile.Tpo src/$(DEPDIR)/libpcre2_16_la-pcre2_jit_compile.Plo
@@ -1876,6 +1910,13 @@ src/libpcre2_32_la-pcre2_error.lo: src/pcre2_error.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_32_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_32_la-pcre2_error.lo `test -f 'src/pcre2_error.c' || echo '$(srcdir)/'`src/pcre2_error.c
 
+src/libpcre2_32_la-pcre2_find_bracket.lo: src/pcre2_find_bracket.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_32_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_32_la-pcre2_find_bracket.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_32_la-pcre2_find_bracket.Tpo -c -o src/libpcre2_32_la-pcre2_find_bracket.lo `test -f 'src/pcre2_find_bracket.c' || echo '$(srcdir)/'`src/pcre2_find_bracket.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_32_la-pcre2_find_bracket.Tpo src/$(DEPDIR)/libpcre2_32_la-pcre2_find_bracket.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/pcre2_find_bracket.c' object='src/libpcre2_32_la-pcre2_find_bracket.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_32_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_32_la-pcre2_find_bracket.lo `test -f 'src/pcre2_find_bracket.c' || echo '$(srcdir)/'`src/pcre2_find_bracket.c
+
 src/libpcre2_32_la-pcre2_jit_compile.lo: src/pcre2_jit_compile.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_32_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_32_la-pcre2_jit_compile.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_32_la-pcre2_jit_compile.Tpo -c -o src/libpcre2_32_la-pcre2_jit_compile.lo `test -f 'src/pcre2_jit_compile.c' || echo '$(srcdir)/'`src/pcre2_jit_compile.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_32_la-pcre2_jit_compile.Tpo src/$(DEPDIR)/libpcre2_32_la-pcre2_jit_compile.Plo
@@ -2037,6 +2078,13 @@ src/libpcre2_8_la-pcre2_error.lo: src/pcre2_error.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_8_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_8_la-pcre2_error.lo `test -f 'src/pcre2_error.c' || echo '$(srcdir)/'`src/pcre2_error.c
 
+src/libpcre2_8_la-pcre2_find_bracket.lo: src/pcre2_find_bracket.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_8_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_8_la-pcre2_find_bracket.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_8_la-pcre2_find_bracket.Tpo -c -o src/libpcre2_8_la-pcre2_find_bracket.lo `test -f 'src/pcre2_find_bracket.c' || echo '$(srcdir)/'`src/pcre2_find_bracket.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_8_la-pcre2_find_bracket.Tpo src/$(DEPDIR)/libpcre2_8_la-pcre2_find_bracket.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/pcre2_find_bracket.c' object='src/libpcre2_8_la-pcre2_find_bracket.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_8_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_8_la-pcre2_find_bracket.lo `test -f 'src/pcre2_find_bracket.c' || echo '$(srcdir)/'`src/pcre2_find_bracket.c
+
 src/libpcre2_8_la-pcre2_jit_compile.lo: src/pcre2_jit_compile.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_8_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_8_la-pcre2_jit_compile.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_8_la-pcre2_jit_compile.Tpo -c -o src/libpcre2_8_la-pcre2_jit_compile.lo `test -f 'src/pcre2_jit_compile.c' || echo '$(srcdir)/'`src/pcre2_jit_compile.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_8_la-pcre2_jit_compile.Tpo src/$(DEPDIR)/libpcre2_8_la-pcre2_jit_compile.Plo
diff --git a/NEWS b/NEWS
index 84f051355e2e9542a17a9ec81da6d1f520364192..aaeee5c24232061d8c19300df3be761ea5a253c1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,47 @@
 News about PCRE2 releases
 -------------------------
 
+Version 10.21 12-January-2016
+-----------------------------
+
+1. Many bugs have been fixed. A large number of them were provoked only by very
+strange pattern input, and were discovered by fuzzers. Some others were
+discovered by code auditing. See ChangeLog for details.
+
+2. The Unicode tables have been updated to Unicode version 8.0.0.
+
+3. For Perl compatibility in EBCDIC environments, ranges such as a-z in a
+class, where both values are literal letters in the same case, omit the
+non-letter EBCDIC code points within the range.
+
+4. There have been a number of enhancements to the pcre2_substitute() function,
+giving more flexibility to replacement facilities. It is now also possible to
+cause the function to return the needed buffer size if the one given is too
+small.
+
+5. The PCRE2_ALT_VERBNAMES option causes the "name" parts of special verbs such
+as (*THEN:name) to be processed for backslashes and to take note of
+PCRE2_EXTENDED.
+
+6. PCRE2_INFO_HASBACKSLASHC makes it possible for a client to find out if a
+pattern uses \C, and --never-backslash-C makes it possible to compile a version
+PCRE2 in which the use of \C is always forbidden.
+
+7. A limit to the length of pattern that can be handled can now be set by
+calling pcre2_set_max_pattern_length().
+
+8. When matching an unanchored pattern, a match can be required to begin within
+a given number of code units after the start of the subject by calling
+pcre2_set_offset_limit().
+
+9. The pcre2test program has been extended to test new facilities, and it can
+now run the tests when LF on its own is not a valid newline sequence.
+
+10. The RunTest script has also been updated to enable more tests to be run.
+
+11. There have been some minor performance enhancements.
+
+
 Version 10.20 30-June-2015
 --------------------------
 
index d8d9d2b494078372f9025f10f31f349cbbf732d5..ceb92450cad7b5e997586c54cf2e25dc74a4c398 100644 (file)
@@ -97,6 +97,7 @@ can skip ahead to the CMake section.
        pcre2_context.c
        pcre2_dfa_match.c
        pcre2_error.c
+       pcre2_find_bracket.c
        pcre2_jit_compile.c
        pcre2_maketables.c
        pcre2_match.c
@@ -388,4 +389,4 @@ and executable, is in EBCDIC and native z/OS file formats and this is the
 recommended download site.
 
 =============================
-Last Updated: 15 June 2015
+Last Updated: 16 July 2015
index f6b138f87d2ca15b19292f3d5ae239a445803644..114fce01de1018e30e74381d019575471845be3d 100755 (executable)
@@ -65,13 +65,9 @@ End
 
 echo "Making pcre2.txt"
 for file in pcre2 pcre2api pcre2build pcre2callout pcre2compat pcre2jit \
-            pcre2limits pcre2matching pcre2partial pcre2unicode ; do
-
-#for file in  \
-#            pcre2syntax \
-#            pcre2precompile pcre2perform pcre2posix pcre2sample \
-#            pcre2stack ; do
-
+            pcre2limits pcre2matching pcre2partial pcre2pattern pcre2perform \
+            pcre2posix pcre2sample pcre2serialize pcre2stack pcre2syntax \
+            pcre2unicode ; do
   echo "  Processing $file.3"
   nroff -c -man $file.3 >$file.rawtxt
   perl ../CleanTxt <$file.rawtxt >>pcre2.txt
@@ -153,7 +149,6 @@ for file in *.3 ; do
      [ "$base" = "pcre2stack" ]   || \
      [ "$base" = "pcre2compat" ]  || \
      [ "$base" = "pcre2limits" ]  || \
-     [ "$base" = "pcre2perform" ] || \
      [ "$base" = "pcre2unicode" ] ; then
     toc=""
   fi
@@ -204,6 +199,7 @@ files="\
   src/pcre2_context.c \
   src/pcre2_dfa_match.c \
   src/pcre2_error.c \
+  src/pcre2_find_bracket.c \
   src/pcre2_internal.h \
   src/pcre2_intmodedep.h \
   src/pcre2_jit_compile.c \
diff --git a/README b/README
index 7367924c8e081d9d8fd7f9ffeeabc632cd31884f..48d2ffdd7cbcacdd5dee1af65e2f52b84b3201cb 100644 (file)
--- a/README
+++ b/README
@@ -220,6 +220,13 @@ library. They are also documented in the pcre2build man page.
   restrict \R to match only CR, LF, or CRLF. You can make this the default by
   adding --enable-bsr-anycrlf to the "configure" command (bsr = "backslash R").
 
+. In a pattern, the escape sequence \C matches a single code unit, even in a
+  UTF mode. This can be dangerous because it breaks up multi-code-unit
+  characters. You can build PCRE2 with the use of \C permanently locked out by
+  adding --enable-never-backslash-C (note the upper case C) to the "configure"
+  command. When \C is allowed by the library, individual applications can lock
+  it out by calling pcre2_compile() with the PCRE2_NEVER_BACKSLASH_C option.
+
 . PCRE2 has a counter that limits the depth of nesting of parentheses in a
   pattern. This limits the amount of system stack that a pattern uses when it
   is compiled. The default is 250, but you can change it by setting, for
@@ -724,6 +731,7 @@ The distribution should contain the files listed below.
   src/pcre2_context.c      )
   src/pcre2_dfa_match.c    )
   src/pcre2_error.c        )
+  src/pcre2_find_bracket.c )
   src/pcre2_jit_compile.c  )
   src/pcre2_jit_match.c    ) sources for the functions in the library,
   src/pcre2_jit_misc.c     )   and some internal functions that they use
@@ -832,4 +840,4 @@ The distribution should contain the files listed below.
 Philip Hazel
 Email local part: ph10
 Email domain: cam.ac.uk
-Last updated: 24 April 2015
+Last updated: 16 October 2015
index f7db29e6cb3d19a19d773b9b8fd389859a8ef28c..67d672ba37bea642b3756e655871427fdafccbcd 100755 (executable)
@@ -19,12 +19,18 @@ unset cp ls mv rm
 
 builddir=`pwd`
 pcre2grep=$builddir/pcre2grep
+pcre2test=$builddir/pcre2test
 
 if [ ! -x $pcre2grep ] ; then
   echo "** $pcre2grep does not exist or is not execuatble."
   exit 1
 fi
 
+if [ ! -x $pcre2test ] ; then
+  echo "** $pcre2test does not exist or is not execuatble."
+  exit 1
+fi
+
 valgrind=
 while [ $# -gt 0 ] ; do
   case $1 in
@@ -34,7 +40,6 @@ while [ $# -gt 0 ] ; do
   shift
 done
 
-echo " "
 pcre2grep_version=`$pcre2grep -V`
 if [ "$valgrind" = "" ] ; then
   echo "Testing $pcre2grep_version"
@@ -69,14 +74,22 @@ fi
 
 # Check for the availability of UTF-8 support
 
-./pcre2test -C unicode >/dev/null
+$pcre2test -C unicode >/dev/null
 utf8=$?
 
+# Check default newline convention. If it does not include LF, force LF.
+
+nl=`$pcre2test -C newline`
+if [ "$nl" != "LF" -a "$nl" != "ANY" -a "$nl" != "ANYCRLF" ]; then
+  pcre2grep="$pcre2grep -N LF"
+  echo "Default newline setting forced to LF"
+fi
+
 # ------ Function to run and check a special pcre2grep arguments test -------
 
 checkspecial()
   {
-  $valgrind ./pcre2grep $1 >>testtrygrep 2>&1
+  $valgrind $pcre2grep $1 >>testtrygrep 2>&1
   if [ $? -ne $2 ] ; then
     echo "** pcre2grep $1 failed - check testtrygrep"
     exit 1
@@ -530,6 +543,14 @@ echo "aaaaa" >>testtemp1grep
 (cd $srcdir; $valgrind $pcre2grep  --line-offsets '(?<=\Ka)' $builddir/testtemp1grep) >>testtrygrep 2>&1
 echo "RC=$?" >>testtrygrep
 
+echo "---------------------------- Test 108 ------------------------------" >>testtrygrep
+(cd $srcdir; $valgrind $pcre2grep -lq PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtrygrep
+echo "RC=$?" >>testtrygrep
+
+echo "---------------------------- Test 109 -----------------------------" >>testtrygrep
+(cd $srcdir; $valgrind $pcre2grep -cq lazy ./testdata/grepinput*) >>testtrygrep
+echo "RC=$?" >>testtrygrep
+
 # Now compare the results.
 
 $cf $srcdir/testdata/grepoutput testtrygrep
diff --git a/RunTest b/RunTest
index c4d659c763f34813dcf2625792af48c81dcd16a8..36dc638edd7c689313299e4e90da363018f0b4b5 100755 (executable)
--- a/RunTest
+++ b/RunTest
 # For backwards compatibility, -nojit, -valgrind, -valgrind-log, and -sim may
 # be given without the leading "-" character.
 #
+# When PCRE2 is compiled by clang with -fsanitize arguments, some tests need
+# very much more stack than normal. In environments where the stack can be
+# set at runtime, -bigstack sets a gigantic stack.
+#
 # There are two special cases where only one argument is allowed:
 #
 # If the first and only argument is "ebcdic", the script runs the special
@@ -64,13 +68,17 @@ title10="Test 10: Specials for the 8-bit library with UTF-8 and UCP support"
 title11="Test 11: Specials for the basic 16-bit and 32-bit libraries"
 title12="Test 12: Specials for the 16-bit and 32-bit libraries UTF and UCP support"
 title13="Test 13: DFA specials for the basic 16-bit and 32-bit libraries"
-title14="Test 14: Non-JIT limits and other non-JIT tests"
-title15="Test 15: JIT-specific features when JIT is not available"
-title16="Test 16: JIT-specific features when JIT is available"
-title17="Test 17: Tests of the POSIX interface, excluding UTF/UCP"
-title18="Test 18: Tests of the POSIX interface with UTF/UCP"
-title19="Test 19: Serialization tests"
-maxtest=18
+title14="Test 14: DFA specials for UTF and UCP support"
+title15="Test 15: Non-JIT limits and other non-JIT tests"
+title16="Test 16: JIT-specific features when JIT is not available"
+title17="Test 17: JIT-specific features when JIT is available"
+title18="Test 18: Tests of the POSIX interface, excluding UTF/UCP"
+title19="Test 19: Tests of the POSIX interface with UTF/UCP"
+title20="Test 20: Serialization tests"
+title21="Test 21: \C tests without UTF (supported for DFA matching)"
+title22="Test 22: \C tests with UTF (not supported for DFA matching)"
+title23="Test 23: \C disabled test"
+maxtest=23
 
 if [ $# -eq 1 -a "$1" = "list" ]; then
   echo $title0
@@ -93,6 +101,10 @@ if [ $# -eq 1 -a "$1" = "list" ]; then
   echo $title17
   echo $title18
   echo $title19
+  echo $title20
+  echo $title21
+  echo $title22
+  echo $title23
   exit 0
 fi
 
@@ -151,7 +163,7 @@ checkresult()
 
 checkspecial()
   {
-  $valgrind ./pcre2test $1 >>testtry
+  $valgrind  $vjs ./pcre2test $1 >>testtry
   if [ $? -ne 0 ] ; then
     echo "** pcre2test $1 failed - check testtry"
     exit 1
@@ -184,9 +196,11 @@ arg8=
 arg16=
 arg32=
 nojit=
+bigstack=
 sim=
 skip=
 valgrind=
+vjs=
 
 # This is in case the caller has set aliases (as I do - PH)
 unset cp ls mv rm
@@ -214,6 +228,10 @@ do16=no
 do17=no
 do18=no
 do19=no
+do20=no
+do21=no
+do22=no
+do23=no
 
 while [ $# -gt 0 ] ; do
   case $1 in
@@ -237,9 +255,14 @@ while [ $# -gt 0 ] ; do
    17) do17=yes;;
    18) do18=yes;;
    19) do19=yes;;
+   20) do20=yes;;
+   21) do21=yes;;
+   22) do22=yes;;
+   23) do23=yes;;
    -8) arg8=yes;;
   -16) arg16=yes;;
   -32) arg32=yes;;
+   bigstack|-bigstack) bigstack=yes;;
    nojit|-nojit) nojit=yes;;
    sim|-sim) shift; sim=$1;;
    valgrind|-valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all";;
@@ -287,13 +310,22 @@ fi
 
 # If it is possible to set the system stack size, arrange to set a value for
 # test 2, which needs more than the even the Linux default when PCRE2 has been
-# compiled with -fsanitize=address.
+# compiled by gcc with -fsanitize=address. When the compiler is clang, sanitize
+# options require an even bigger stack for test 2, and an increased stack for
+# some of the other tests.
 
 $sim ./pcre2test -S 1 /dev/null /dev/null
 if [ $? -eq 0 ] ; then
-  test2stack="-S 16"
+  if [ "$bigstack" = "" ] ; then
+    test2stack="-S 16"
+    defaultstack=""
+  else
+    test2stack="-S 1024"
+    defaultstack="-S 64"
+  fi
 else
   test2stack=""
+  defaultstack=""
 fi
 
 # All of 8-bit, 16-bit, and 32-bit character strings may be supported, but only
@@ -306,6 +338,11 @@ support16=$?
 $sim ./pcre2test -C pcre2-32 >/dev/null
 support32=$?
 
+# \C may be disabled
+
+$sim ./pcre2test -C backslash-C >/dev/null
+supportBSC=$?
+
 # Initialize all bitsizes skipped
 
 test8=skip
@@ -358,11 +395,18 @@ fi
 $sim ./pcre2test -C unicode >/dev/null
 utf=$?
 
+# When JIT is used with valgrind, we need to set up valgrind suppressions as
+# otherwise there are a lot of false positive valgrind reports when the
+# the hardware supports SSE2.
+
 jitopt=
 $sim ./pcre2test -C jit >/dev/null
 jit=$?
 if [ $jit -ne 0 -a "$nojit" != "yes" ] ; then
   jitopt=-jit
+  if [ "$valgrind" != "" ] ; then
+    vjs="--suppressions=$testdata/valgrind-jit.supp"
+  fi
 fi
 
 # If no specific tests were requested, select all. Those that are not
@@ -372,7 +416,8 @@ if [ $do0  = no -a $do1  = no -a $do2  = no -a $do3  = no -a \
      $do4  = no -a $do5  = no -a $do6  = no -a $do7  = no -a \
      $do8  = no -a $do9  = no -a $do10 = no -a $do11 = no -a \
      $do12 = no -a $do13 = no -a $do14 = no -a $do15 = no -a \
-     $do16 = no -a $do17 = no -a $do18 = no -a $do19 = no \
+     $do16 = no -a $do17 = no -a $do18 = no -a $do19 = no -a \
+     $do20 = no -a $do21 = no -a $do22 = no -a $do23 = no \
    ]; then
   do0=yes
   do1=yes
@@ -394,6 +439,10 @@ if [ $do0  = no -a $do1  = no -a $do2  = no -a $do3  = no -a \
   do17=yes
   do18=yes
   do19=yes
+  do20=yes
+  do21=yes
+  do22=yes
+  do23=yes
 fi
 
 # Handle any explicit skips at this stage, so that an argument list may consist
@@ -438,7 +487,7 @@ for bmode in "$test8" "$test16" "$test32"; do
   if [ $do1 = yes ] ; then
     echo $title1
     for opt in "" $jitopt; do
-      $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput1 testtry
+      $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput1 testtry
       checkresult $? 1 "$opt"
     done
   fi
@@ -448,7 +497,7 @@ for bmode in "$test8" "$test16" "$test32"; do
   if [ $do2 = yes ] ; then
     echo $title2 "(excluding UTF-$bits)"
     for opt in "" $jitopt; do
-      $sim $valgrind ./pcre2test -q $test2stack $bmode $opt $testdata/testinput2 testtry
+      $sim $valgrind ${opt:+$vjs} ./pcre2test -q $test2stack $bmode $opt $testdata/testinput2 testtry
       if [ $? = 0 ] ; then
         checkresult $? 2 "$opt"
       else
@@ -508,7 +557,7 @@ for bmode in "$test8" "$test16" "$test32"; do
     if [ "$locale" != "" ] ; then
       echo $title3 "(using '$locale' locale)"
       for opt in "" $jitopt; do
-        $sim $valgrind ./pcre2test -q $bmode $opt $infile testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $infile testtry
         if [ $? = 0 ] ; then
           case "$opt" in
             -jit) with=" with JIT";;
@@ -545,7 +594,7 @@ for bmode in "$test8" "$test16" "$test32"; do
       echo "  Skipped because UTF-$bits support is not available"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput4 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput4 testtry
         checkresult $? 4 "$opt"
       done
     fi
@@ -557,7 +606,7 @@ for bmode in "$test8" "$test16" "$test32"; do
       echo "  Skipped because UTF-$bits support is not available"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput5 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput5 testtry
         checkresult $? 5 "$opt"
       done
     fi
@@ -567,7 +616,7 @@ for bmode in "$test8" "$test16" "$test32"; do
 
   if [ $do6 = yes ] ; then
     echo $title6
-    $sim $valgrind ./pcre2test -q $bmode $testdata/testinput6 testtry
+    $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput6 testtry
     checkresult $? 6 ""
   fi
 
@@ -576,28 +625,26 @@ for bmode in "$test8" "$test16" "$test32"; do
     if [ $utf -eq 0 ] ; then
       echo "  Skipped because UTF-$bits support is not available"
     else
-      $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput7 testtry
+      $sim $valgrind ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput7 testtry
       checkresult $? 7 ""
     fi
   fi
 
   # Test of internal offsets and code sizes. This test is run only when there
-  # is UTF/UCP support and the link size is 2. The actual tests are
-  # mostly the same as in some of the above, but in this test we inspect some
-  # offsets and sizes that require a known link size. This is a doublecheck for
-  # the maintainer, just in case something changes unexpectely. The output from
-  # this test is different in 8-bit, 16-bit, and 32-bit modes, so there are
-  # mode-specific output files.
+  # is UTF/UCP support. The actual tests are mostly the same as in some of the
+  # above, but in this test we inspect some offsets and sizes. This is a
+  # doublecheck for the maintainer, just in case something changes unexpectely.
+  # The output from this test is different in 8-bit, 16-bit, and 32-bit modes
+  # and for different link sizes, so there are different output files for each
+  # mode and link size.
 
   if [ $do8 = yes ] ; then
     echo $title8
-    if [ $link_size -ne 2 ] ; then
-      echo "  Skipped because link size is not 2"
-    elif [ $utf -eq 0 ] ; then
+    if [ $utf -eq 0 ] ; then
       echo "  Skipped because UTF-$bits support is not available"
     else
-      $sim $valgrind ./pcre2test -q $bmode $testdata/testinput8 testtry
-      checkresult $? 8-$bits ""
+      $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput8 testtry
+      checkresult $? 8-$bits-$link_size ""
     fi
   fi
 
@@ -609,7 +656,7 @@ for bmode in "$test8" "$test16" "$test32"; do
       echo "  Skipped when running 16/32-bit tests"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput9 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput9 testtry
         checkresult $? 9 "$opt"
       done
     fi
@@ -625,7 +672,7 @@ for bmode in "$test8" "$test16" "$test32"; do
       echo "  Skipped because UTF-$bits support is not available"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput10 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput10 testtry
         checkresult $? 10 "$opt"
       done
     fi
@@ -639,7 +686,7 @@ for bmode in "$test8" "$test16" "$test32"; do
       echo "  Skipped when running 8-bit tests"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput11 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput11 testtry
         checkresult $? 11-$bits "$opt"
       done
     fi
@@ -656,7 +703,7 @@ for bmode in "$test8" "$test16" "$test32"; do
       echo "  Skipped because UTF-$bits support is not available"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput12 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput12 testtry
         checkresult $? 12-$bits "$opt"
       done
     fi
@@ -669,75 +716,129 @@ for bmode in "$test8" "$test16" "$test32"; do
     if [ "$bits" = "8" ] ; then
       echo "  Skipped when running 8-bit tests"
     else
-      $sim $valgrind ./pcre2test -q $bmode $testdata/testinput13 testtry
+      $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput13 testtry
       checkresult $? 13 ""
     fi
   fi
 
-  # Test non-JIT match and recursion limits
+  # Tests for DFA UTF and UCP features. Output is different for the different widths.
 
   if [ $do14 = yes ] ; then
     echo $title14
-    $sim $valgrind ./pcre2test -q $bmode $testdata/testinput14 testtry
-    checkresult $? 14 ""
+    if [ $utf -eq 0 ] ; then
+      echo "  Skipped because UTF-$bits support is not available"
+    else
+      $sim $valgrind ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput14 testtry
+      checkresult $? 14-$bits ""
+    fi
   fi
 
-  # Test JIT-specific features when JIT is not available
+  # Test non-JIT match and recursion limits
 
   if [ $do15 = yes ] ; then
     echo $title15
+    $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput15 testtry
+    checkresult $? 15 ""
+  fi
+
+  # Test JIT-specific features when JIT is not available
+
+  if [ $do16 = yes ] ; then
+    echo $title16
     if [ $jit -ne 0 ] ; then
       echo "  Skipped because JIT is available"
     else
-      $sim $valgrind ./pcre2test -q $bmode $testdata/testinput15 testtry
-      checkresult $? 15 ""
+      $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput16 testtry
+      checkresult $? 16 ""
     fi
   fi
 
   # Test JIT-specific features when JIT is available
 
-  if [ $do16 = yes ] ; then
-    echo $title16
+  if [ $do17 = yes ] ; then
+    echo $title17
     if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then
       echo "  Skipped because JIT is not available or nojit was specified"
     else
-      $sim $valgrind ./pcre2test -q $bmode $testdata/testinput16 testtry
-      checkresult $? 16 ""
+      $sim $valgrind $vjs ./pcre2test -q $defaultstack $bmode $testdata/testinput17 testtry
+      checkresult $? 17 ""
     fi
   fi
 
   # Tests for the POSIX interface without UTF/UCP (8-bit only)
 
-  if [ $do17 = yes ] ; then
-    echo $title17
+  if [ $do18 = yes ] ; then
+    echo $title18
     if [ "$bits" = "16" -o "$bits" = "32" ] ; then
       echo "  Skipped when running 16/32-bit tests"
     else
-      $sim $valgrind ./pcre2test -q $bmode $testdata/testinput17 testtry
-      checkresult $? 17 ""
+      $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput18 testtry
+      checkresult $? 18 ""
     fi
   fi
 
   # Tests for the POSIX interface with UTF/UCP (8-bit only)
 
-  if [ $do18 = yes ] ; then
-    echo $title18
+  if [ $do19 = yes ] ; then
+    echo $title19
     if [ "$bits" = "16" -o "$bits" = "32" ] ; then
       echo "  Skipped when running 16/32-bit tests"
     elif [ $utf -eq 0 ] ; then
       echo "  Skipped because UTF-$bits support is not available"
     else
-      $sim $valgrind ./pcre2test -q $bmode $testdata/testinput18 testtry
-      checkresult $? 18 ""
+      $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput19 testtry
+      checkresult $? 19 ""
     fi
   fi
 
   # Serialization tests
 
-  if [ $do19 = yes ] ; then
-    echo $title19
-    $sim $valgrind ./pcre2test -q $bmode $testdata/testinput19 testtry
-    checkresult $? 19 ""
+  if [ $do20 = yes ] ; then
+    echo $title20
+    $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput20 testtry
+    checkresult $? 20 ""
+  fi
+
+  # \C tests without UTF - DFA matching is supported
+
+  if [ "$do21" = yes ] ; then
+    echo $title21
+    if [ $supportBSC -eq 0 ] ; then
+      echo "  Skipped because \C is disabled"
+    else
+      for opt in "" $jitopt -dfa; do
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput21 testtry
+        checkresult $? 21 "$opt"
+      done
+    fi
+  fi
+
+  # \C tests with UTF - DFA matching is not supported for \C in UTF mode
+
+  if [ "$do22" = yes ] ; then
+    echo $title22
+    if [ $supportBSC -eq 0 ] ; then
+      echo "  Skipped because \C is disabled"
+    elif [ $utf -eq 0 ] ; then
+      echo "  Skipped because UTF-$bits support is not available"
+    else
+      for opt in "" $jitopt; do
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput22 testtry
+        checkresult $? 22-$bits "$opt"
+      done
+    fi
+  fi
+
+  # Test when \C is disabled
+
+  if [ "$do23" = yes ] ; then
+    echo $title23
+    if [ $supportBSC -ne 0 ] ; then
+      echo "  Skipped because \C is not disabled"
+    else
+      $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput23 testtry
+      checkresult $? 23 ""
+    fi
   fi
 
 # End of loop for 8/16/32-bit tests
index 45bdfcbcb4e2873f1297eeae5448fee9bf888173..ce9d5b577eb57c2ff541c998afbe8e23a785b073 100644 (file)
 @rem line. Added argument validation and added error reporting.\r
 @rem\r
 @rem Sheri Pierce added logic to skip feature dependent tests\r
-@rem tests 4 5 9 15 and 18 require utf support\r
-@rem tests 6 7 10 16 and 19 require ucp support\r
-@rem 11 requires ucp and link size 2\r
-@rem 12 requires presence of jit support\r
-@rem 13 requires absence of jit support\r
+@rem tests 4 5 7 10 12 14 19 and 22 require Unicode support\r
+@rem 8 requires Unicode and link size 2\r
+@rem 16 requires absence of jit support\r
+@rem 17 requires presence of jit support\r
 @rem Sheri P also added override tests for study and jit testing\r
 @rem Zoltan Herczeg added libpcre16 support\r
 @rem Zoltan Herczeg added libpcre32 support\r
 @rem -------------------------------------------------------------------\r
 @rem\r
 @rem The file was converted for PCRE2 by PH, February 2015.\r
+@rem Updated for new test 14 (moving others up a number), August 2015.\r
+@rem Tidied and updated for new tests 21, 22, 23 by PH, October 2015.\r
 \r
 \r
 setlocal enabledelayedexpansion\r
@@ -64,6 +65,8 @@ set support32=%ERRORLEVEL%
 set unicode=%ERRORLEVEL%\r
 %pcre2test% -C jit >NUL\r
 set jit=%ERRORLEVEL%\r
+%pcre2test% -C backslash-C >NUL\r
+set supportBSC=%ERRORLEVEL%\r
 \r
 if %support8% EQU 1 (\r
 if not exist testout8 md testout8\r
@@ -99,18 +102,22 @@ set do16=no
 set do17=no\r
 set do18=no\r
 set do19=no\r
+set do20=no\r
+set do21=no\r
+set do22=no\r
+set do23=no\r
 set all=yes\r
 \r
 for %%a in (%*) do (\r
   set valid=no\r
-  for %%v in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19) do if %%v == %%a set valid=yes\r
+  for %%v in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23) do if %%v == %%a set valid=yes\r
   if "!valid!" == "yes" (\r
     set do%%a=yes\r
     set all=no\r
 ) else (\r
     echo Invalid test number - %%a!\r
         echo Usage %0 [ test_number ] ...\r
-        echo Where test_number is one or more optional test numbers 1 through 19, default is all tests.\r
+        echo Where test_number is one or more optional test numbers 1 through 23, default is all tests.\r
         exit /b 1\r
 )\r
 )\r
@@ -136,6 +143,10 @@ if "%all%" == "yes" (
   set do17=yes\r
   set do18=yes\r
   set do19=yes\r
+  set do20=yes\r
+  set do21=yes\r
+  set do22=yes\r
+  set do23=yes\r
 )\r
 \r
 @echo RunTest.bat's pcre2test output is written to newly created subfolders\r
@@ -183,6 +194,10 @@ if "%do16%" == "yes" call :do16
 if "%do17%" == "yes" call :do17\r
 if "%do18%" == "yes" call :do18\r
 if "%do19%" == "yes" call :do19\r
+if "%do20%" == "yes" call :do20\r
+if "%do21%" == "yes" call :do21\r
+if "%do22%" == "yes" call :do22\r
+if "%do23%" == "yes" call :do23\r
 :modeSkip\r
 if "%mode%" == "" (\r
   set mode=-16\r
@@ -253,6 +268,9 @@ if [%1]==[11] (
 if [%1]==[12] (\r
   set type=-%bits%\r
 )\r
+if [%1]==[14] (\r
+  set type=-%bits%\r
+)\r
 \r
 fc /n %srcdir%\testdata\%testoutput%%type% %2%bits%\%testoutput% >NUL\r
 \r
@@ -316,7 +334,7 @@ if %unicode% EQU 0 (
 goto :eof\r
 \r
 :do6\r
-  call :runsub 6 testout "DFA matching main non-UTF, non-UCP functionality" -q -dfa\r
+  call :runsub 6 testout "DFA matching main non-UTF, non-UCP functionality" -q\r
 goto :eof\r
 \r
 :do7\r
@@ -324,7 +342,7 @@ if %unicode% EQU 0 (
   echo Test 7 Skipped due to absence of Unicode support.\r
   goto :eof\r
 )\r
-  call :runsub 7 testout "DFA matching with UTF-%bits% and Unicode property support" -q -dfa\r
+  call :runsub 7 testout "DFA matching with UTF-%bits% and Unicode property support" -q\r
   goto :eof\r
 \r
 :do8\r
@@ -388,55 +406,98 @@ if %bits% EQU 8 (
   echo Test 13 Skipped when running 8-bit tests.\r
   goto :eof\r
 )\r
-  call :runsub 13 testout "DFA specials for the basic 16/32-bit library" -q -dfa\r
+  call :runsub 13 testout "DFA specials for the basic 16/32-bit library" -q\r
 goto :eof\r
 \r
 :do14\r
-call :runsub 14 testout "Non-JIT limits and other non_JIT tests" -q\r
-goto :eof\r
+if %unicode% EQU 0 (\r
+  echo Test 14 Skipped due to absence of Unicode support.\r
+  goto :eof\r
+)\r
+  call :runsub 14 testout "DFA specials for UTF and UCP support" -q\r
+  goto :eof\r
 \r
 :do15\r
+call :runsub 15 testout "Non-JIT limits and other non_JIT tests" -q\r
+goto :eof\r
+\r
+:do16\r
 if %jit% EQU 1 (\r
-  echo Test 15 Skipped due to presence of JIT support.\r
+  echo Test 16 Skipped due to presence of JIT support.\r
   goto :eof\r
 )\r
-  call :runsub 15 testout "JIT-specific features when JIT is not available" -q\r
+  call :runsub 16 testout "JIT-specific features when JIT is not available" -q\r
 goto :eof\r
 \r
-:do16\r
+:do17\r
 if %jit% EQU 0 (\r
-  echo Test 16 Skipped due to absence of JIT support.\r
+  echo Test 17 Skipped due to absence of JIT support.\r
   goto :eof\r
 )\r
-  call :runsub 16 testout "JIT-specific features when JIT is available" -q\r
+  call :runsub 17 testout "JIT-specific features when JIT is available" -q\r
 goto :eof\r
 \r
-:do17\r
+:do18\r
 if %bits% EQU 16 (\r
-  echo Test 17 Skipped when running 16-bit tests.\r
+  echo Test 18 Skipped when running 16-bit tests.\r
   goto :eof\r
 )\r
 if %bits% EQU 32 (\r
-  echo Test 17 Skipped when running 32-bit tests.\r
+  echo Test 18 Skipped when running 32-bit tests.\r
   goto :eof\r
 )\r
-  call :runsub 17 testout "POSIX interface, excluding UTF-8 and UCP" -q\r
+  call :runsub 18 testout "POSIX interface, excluding UTF-8 and UCP" -q\r
 goto :eof\r
 \r
-:do18\r
+:do19\r
 if %bits% EQU 16 (\r
-  echo Test 18 Skipped when running 16-bit tests.\r
+  echo Test 19 Skipped when running 16-bit tests.\r
   goto :eof\r
 )\r
 if %bits% EQU 32 (\r
-  echo Test 18 Skipped when running 32-bit tests.\r
+  echo Test 19 Skipped when running 32-bit tests.\r
   goto :eof\r
 )\r
-  call :runsub 1 testout "POSIX interface with UTF-8 and UCP" -q\r
+if %unicode% EQU 0 (\r
+  echo Test 19 Skipped due to absence of Unicode support.\r
+  goto :eof\r
+)\r
+  call :runsub 19 testout "POSIX interface with UTF-8 and UCP" -q\r
 goto :eof\r
 \r
-:do19\r
-call :runsub 1 testout "Serialization tests" -q\r
+:do20\r
+call :runsub 20 testout "Serialization tests" -q\r
+goto :eof\r
+\r
+:do21\r
+if %supportBSC% EQU 0 (\r
+  echo Test 21 Skipped due to absence of backslash-C support.\r
+  goto :eof\r
+)\r
+  call :runsub 21 testout "Backslash-C tests without UTF" -q\r
+  call :runsub 21 testout "Backslash-C tests without UTF (DFA)" -q -dfa\r
+  if %jit% EQU 1 call :runsub 21 testoutjit "Test with JIT Override" -q -jit\r
+goto :eof\r
+\r
+:do22\r
+if %supportBSC% EQU 0 (\r
+  echo Test 22 Skipped due to absence of backslash-C support.\r
+  goto :eof\r
+)\r
+if %unicode% EQU 0 (\r
+  echo Test 22 Skipped due to absence of Unicode support.\r
+  goto :eof\r
+)\r
+  call :runsub 22 testout "Backslash-C tests with UTF" -q\r
+  if %jit% EQU 1 call :runsub 22 testoutjit "Test with JIT Override" -q -jit\r
+goto :eof\r
+\r
+:do23\r
+if %supportBSC% EQU 1 (\r
+  echo Test 23 Skipped due to presence of backslash-C support.\r
+  goto :eof\r
+)\r
+  call :runsub 23 testout "Backslash-C disabled test" -q\r
 goto :eof\r
 \r
 :conferror\r
index d1a41f71771d8b41ac4c676ea884cc2b68496eda..10c9cd1c989ff79ccfb3bdaa9853ddc481bbc7c0 100644 (file)
@@ -20,32 +20,63 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
-# serial 1 (pkg-config-0.24)
-# 
-# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
+dnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
+dnl serial 11 (pkg-config-0.29)
+dnl
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
@@ -67,18 +98,19 @@ if test -n "$PKG_CONFIG"; then
                PKG_CONFIG=""
        fi
 fi[]dnl
-])# PKG_PROG_PKG_CONFIG
+])dnl PKG_PROG_PKG_CONFIG
 
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists.  Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurence in configure.ac, so if the first place
-# it's called might be skipped (such as if it is within an "if", you
-# have to call PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
 AC_DEFUN([PKG_CHECK_EXISTS],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 if test -n "$PKG_CONFIG" && \
@@ -88,8 +120,10 @@ m4_ifvaln([$3], [else
   $3])dnl
 fi])
 
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
 m4_define([_PKG_CONFIG],
 [if test -n "$$1"; then
     pkg_cv_[]$1="$$1"
@@ -101,10 +135,11 @@ m4_define([_PKG_CONFIG],
  else
     pkg_failed=untried
 fi[]dnl
-])# _PKG_CONFIG
+])dnl _PKG_CONFIG
 
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -112,19 +147,17 @@ if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 else
         _pkg_short_errors_supported=no
 fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
 
 
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 AC_DEFUN([PKG_CHECK_MODULES],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
@@ -178,16 +211,40 @@ else
         AC_MSG_RESULT([yes])
        $3
 fi[]dnl
-])# PKG_CHECK_MODULES
+])dnl PKG_CHECK_MODULES
 
 
-# PKG_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable pkgconfigdir as the location where a module
-# should install pkg-config .pc files. By default the directory is
-# $libdir/pkgconfig, but the default can be changed by passing
-# DIRECTORY. The user can override through the --with-pkgconfigdir
-# parameter.
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
 AC_DEFUN([PKG_INSTALLDIR],
 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
 m4_pushdef([pkg_description],
@@ -198,16 +255,18 @@ AC_ARG_WITH([pkgconfigdir],
 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
 m4_popdef([pkg_default])
 m4_popdef([pkg_description])
-]) dnl PKG_INSTALLDIR
+])dnl PKG_INSTALLDIR
 
 
-# PKG_NOARCH_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable noarch_pkgconfigdir as the location where a
-# module should install arch-independent pkg-config .pc files. By
-# default the directory is $datadir/pkgconfig, but the default can be
-# changed by passing DIRECTORY. The user can override through the
-# --with-noarch-pkgconfigdir parameter.
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
 m4_pushdef([pkg_description],
@@ -218,13 +277,15 @@ AC_ARG_WITH([noarch-pkgconfigdir],
 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
 m4_popdef([pkg_default])
 m4_popdef([pkg_description])
-]) dnl PKG_NOARCH_INSTALLDIR
+])dnl PKG_NOARCH_INSTALLDIR
 
 
-# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
-# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# -------------------------------------------
-# Retrieves the value of the pkg-config variable for the given module.
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
 AC_DEFUN([PKG_CHECK_VAR],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
@@ -233,7 +294,7 @@ _PKG_CONFIG([$1], [variable="][$3]["], [$2])
 AS_VAR_COPY([$1], [pkg_cv_][$1])
 
 AS_VAR_IF([$1], [""], [$5], [$4])dnl
-])# PKG_CHECK_VAR
+])dnl PKG_CHECK_VAR
 
 # Copyright (C) 2002-2014 Free Software Foundation, Inc.
 #
index b74a7aaab1514b0f442729a895f532e9df4c14c6..0cfd8b134be3f8c9627d3df6538655a61701249b 100644 (file)
@@ -33,6 +33,7 @@
 #cmakedefine EBCDIC 1
 #cmakedefine EBCDIC_NL25 1
 #cmakedefine HEAP_MATCH_RECURSE 1
+#cmakedefine NEVER_BACKSLASH_C 1
 
 #define LINK_SIZE              @PCRE2_LINK_SIZE@
 #define MATCH_LIMIT            @PCRE2_MATCH_LIMIT@
index 15777d450b03372c838367e8ab1dd3306db86a42..e9f9e374d25a4cdcf148cfea4660cad34c3e9eae 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for PCRE2 10.20.
+# Generated by GNU Autoconf 2.69 for PCRE2 10.21.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='PCRE2'
 PACKAGE_TARNAME='pcre2'
-PACKAGE_VERSION='10.20'
-PACKAGE_STRING='PCRE2 10.20'
+PACKAGE_VERSION='10.21'
+PACKAGE_STRING='PCRE2 10.21'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -829,6 +829,7 @@ enable_newline_is_crlf
 enable_newline_is_anycrlf
 enable_newline_is_any
 enable_bsr_anycrlf
+enable_never_backslash_C
 enable_ebcdic
 enable_ebcdic_nl25
 enable_stack_for_recursion
@@ -1401,7 +1402,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures PCRE2 10.20 to adapt to many kinds of systems.
+\`configure' configures PCRE2 10.21 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1471,7 +1472,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of PCRE2 10.20:";;
+     short | recursive ) echo "Configuration of PCRE2 10.21:";;
    esac
   cat <<\_ACEOF
 
@@ -1508,6 +1509,8 @@ Optional Features:
                           use CR, LF, or CRLF as newline sequence
   --enable-newline-is-any use any valid Unicode newline sequence
   --enable-bsr-anycrlf    \R matches only CR, LF, CRLF by default
+  --enable-never-backslash-C
+                          use of \C causes an error
   --enable-ebcdic         assume EBCDIC coding rather than ASCII; incompatible
                           with --enable-utf; use only in (uncommon) EBCDIC
                           environments; it implies --enable-rebuild-chartables
@@ -1635,7 +1638,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-PCRE2 configure 10.20
+PCRE2 configure 10.21
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2130,7 +2133,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by PCRE2 $as_me 10.20, which was
+It was created by PCRE2 $as_me 10.21, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2994,7 +2997,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='pcre2'
- VERSION='10.20'
+ VERSION='10.21'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -13590,9 +13593,9 @@ _ACEOF
 # Versioning
 
 PCRE2_MAJOR="10"
-PCRE2_MINOR="20"
+PCRE2_MINOR="21"
 PCRE2_PRERELEASE=""
-PCRE2_DATE="2015-06-30"
+PCRE2_DATE="2016-01-12"
 
 if test "$PCRE2_MINOR" = "08" -o "$PCRE2_MINOR" = "09"
 then
@@ -13756,6 +13759,15 @@ else
 fi
 
 
+# Handle --enable-never-backslash-C
+# Check whether --enable-never-backslash-C was given.
+if test "${enable_never_backslash_C+set}" = set; then :
+  enableval=$enable_never_backslash_C;
+else
+  enable_never_backslash_C=no
+fi
+
+
 # Handle --enable-ebcdic
 # Check whether --enable-ebcdic was given.
 if test "${enable_ebcdic+set}" = set; then :
 # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled.
 # Also check that UTF support is not requested, because PCRE2 cannot handle
 # EBCDIC and UTF in the same build. To do so it would need to use different
-# character constants depending on the mode.
+# character constants depending on the mode. Also, EBCDIC cannot be used with
+# 16-bit and 32-bit libraries.
 #
 if test "x$enable_ebcdic" = "xyes"; then
   enable_rebuild_chartables=yes
   if test "x$enable_unicode" = "xyes"; then
     as_fn_error $? "support for EBCDIC and Unicode cannot be enabled at the same time" "$LINENO" 5
   fi
+  if test "x$enable_pcre2_16" = "xyes" -o "x$enable_pcre2_32" = "xyes"; then
+    as_fn_error $? "EBCDIC support is available only for the 8-bit library" "$LINENO" 5
+  fi
 fi
 
 # Check argument to --with-link-size
@@ -15287,6 +15303,12 @@ $as_echo "#define BSR_ANYCRLF /**/" >>confdefs.h
 
 fi
 
+if test "$enable_never_backslash_C" = "yes"; then
+
+$as_echo "#define NEVER_BACKSLASH_C /**/" >>confdefs.h
+
+fi
+
 
 cat >>confdefs.h <<_ACEOF
 #define LINK_SIZE $with_link_size
@@ -15361,16 +15383,16 @@ esac
 # are m4 variables, assigned above.
 
 EXTRA_LIBPCRE2_8_LDFLAGS="$EXTRA_LIBPCRE2_8_LDFLAGS \
-  $NO_UNDEFINED -version-info 2:0:2"
+  $NO_UNDEFINED -version-info 3:0:3"
 
 EXTRA_LIBPCRE2_16_LDFLAGS="$EXTRA_LIBPCRE2_16_LDFLAGS \
-  $NO_UNDEFINED -version-info 2:0:2"
+  $NO_UNDEFINED -version-info 3:0:3"
 
 EXTRA_LIBPCRE2_32_LDFLAGS="$EXTRA_LIBPCRE2_32_LDFLAGS \
-  $NO_UNDEFINED -version-info 2:0:2"
+  $NO_UNDEFINED -version-info 3:0:3"
 
 EXTRA_LIBPCRE2_POSIX_LDFLAGS="$EXTRA_LIBPCRE2_POSIX_LDFLAGS \
-  $NO_UNDEFINED -version-info 0:0:0"
+  $NO_UNDEFINED -version-info 0:1:0"
 
 
 
@@ -16413,7 +16435,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by PCRE2 $as_me 10.20, which was
+This file was extended by PCRE2 $as_me 10.21, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16479,7 +16501,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-PCRE2 config.status 10.20
+PCRE2 config.status 10.21
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -18211,6 +18233,7 @@ $PACKAGE-$VERSION configuration summary:
     Enable Unicode support .......... : ${enable_unicode}
     Newline char/sequence ........... : ${enable_newline}
     \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}
+    \C is disabled .................. : ${enable_never_backslash_C}
     EBCDIC coding ................... : ${enable_ebcdic}
     EBCDIC code for NL .............. : ${ebcdic_nl_code}
     Rebuild char tables ............. : ${enable_rebuild_chartables}
index 20f3937b653864253d72d5d7e63e9714aa50b290..99ad8a9f016f0b0d79023d5fa9c34471ab572af5 100644 (file)
@@ -9,18 +9,18 @@ dnl The PCRE2_PRERELEASE feature is for identifying release candidates. It might
 dnl be defined as -RC2, for example. For real releases, it should be empty.
 
 m4_define(pcre2_major, [10])
-m4_define(pcre2_minor, [20])
+m4_define(pcre2_minor, [21])
 m4_define(pcre2_prerelease, [])
-m4_define(pcre2_date, [2015-06-30])
+m4_define(pcre2_date, [2016-01-12])
 
 # NOTE: The CMakeLists.txt file searches for the above variables in the first
 # 50 lines of this file. Please update that if the variables above are moved.
 
 # Libtool shared library interface versions (current:revision:age)
-m4_define(libpcre2_8_version,     [2:0:2])
-m4_define(libpcre2_16_version,    [2:0:2])
-m4_define(libpcre2_32_version,    [2:0:2])
-m4_define(libpcre2_posix_version, [0:0:0])
+m4_define(libpcre2_8_version,     [3:0:3])
+m4_define(libpcre2_16_version,    [3:0:3])
+m4_define(libpcre2_32_version,    [3:0:3])
+m4_define(libpcre2_posix_version, [0:1:0])
 
 AC_PREREQ(2.57)
 AC_INIT(PCRE2, pcre2_major.pcre2_minor[]pcre2_prerelease, , pcre2)
@@ -190,6 +190,12 @@ AC_ARG_ENABLE(bsr-anycrlf,
                              [\R matches only CR, LF, CRLF by default]),
               , enable_bsr_anycrlf=no)
 
+# Handle --enable-never-backslash-C
+AC_ARG_ENABLE(never-backslash-C,
+              AS_HELP_STRING([--enable-never-backslash-C],
+                             [use of \C causes an error]),
+              , enable_never_backslash_C=no)
+
 # Handle --enable-ebcdic
 AC_ARG_ENABLE(ebcdic,
               AS_HELP_STRING([--enable-ebcdic],
@@ -333,13 +339,17 @@ fi
 # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled.
 # Also check that UTF support is not requested, because PCRE2 cannot handle
 # EBCDIC and UTF in the same build. To do so it would need to use different
-# character constants depending on the mode.
+# character constants depending on the mode. Also, EBCDIC cannot be used with
+# 16-bit and 32-bit libraries.
 #
 if test "x$enable_ebcdic" = "xyes"; then
   enable_rebuild_chartables=yes
   if test "x$enable_unicode" = "xyes"; then
     AC_MSG_ERROR([support for EBCDIC and Unicode cannot be enabled at the same time])
   fi
+  if test "x$enable_pcre2_16" = "xyes" -o "x$enable_pcre2_32" = "xyes"; then
+    AC_MSG_ERROR([EBCDIC support is available only for the 8-bit library])
+  fi
 fi
 
 # Check argument to --with-link-size
@@ -604,6 +614,11 @@ if test "$enable_bsr_anycrlf" = "yes"; then
     The build-time default can be overridden by the user of PCRE2 at runtime.])
 fi
 
+if test "$enable_never_backslash_C" = "yes"; then
+  AC_DEFINE([NEVER_BACKSLASH_C], [], [
+    Defining NEVER_BACKSLASH_C locks out the use of \C in all patterns.])
+fi
+
 AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [
   The value of LINK_SIZE determines the number of bytes used to store
   links as offsets within the compiled regex. The default is 2, which
@@ -881,6 +896,7 @@ $PACKAGE-$VERSION configuration summary:
     Enable Unicode support .......... : ${enable_unicode}
     Newline char/sequence ........... : ${enable_newline}
     \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}
+    \C is disabled .................. : ${enable_never_backslash_C}
     EBCDIC coding ................... : ${enable_ebcdic}
     EBCDIC code for NL .............. : ${ebcdic_nl_code}
     Rebuild char tables ............. : ${enable_rebuild_chartables}
index d8d9d2b494078372f9025f10f31f349cbbf732d5..ceb92450cad7b5e997586c54cf2e25dc74a4c398 100644 (file)
@@ -97,6 +97,7 @@ can skip ahead to the CMake section.
        pcre2_context.c
        pcre2_dfa_match.c
        pcre2_error.c
+       pcre2_find_bracket.c
        pcre2_jit_compile.c
        pcre2_maketables.c
        pcre2_match.c
@@ -388,4 +389,4 @@ and executable, is in EBCDIC and native z/OS file formats and this is the
 recommended download site.
 
 =============================
-Last Updated: 15 June 2015
+Last Updated: 16 July 2015
index 7367924c8e081d9d8fd7f9ffeeabc632cd31884f..48d2ffdd7cbcacdd5dee1af65e2f52b84b3201cb 100644 (file)
@@ -220,6 +220,13 @@ library. They are also documented in the pcre2build man page.
   restrict \R to match only CR, LF, or CRLF. You can make this the default by
   adding --enable-bsr-anycrlf to the "configure" command (bsr = "backslash R").
 
+. In a pattern, the escape sequence \C matches a single code unit, even in a
+  UTF mode. This can be dangerous because it breaks up multi-code-unit
+  characters. You can build PCRE2 with the use of \C permanently locked out by
+  adding --enable-never-backslash-C (note the upper case C) to the "configure"
+  command. When \C is allowed by the library, individual applications can lock
+  it out by calling pcre2_compile() with the PCRE2_NEVER_BACKSLASH_C option.
+
 . PCRE2 has a counter that limits the depth of nesting of parentheses in a
   pattern. This limits the amount of system stack that a pattern uses when it
   is compiled. The default is 250, but you can change it by setting, for
@@ -724,6 +731,7 @@ The distribution should contain the files listed below.
   src/pcre2_context.c      )
   src/pcre2_dfa_match.c    )
   src/pcre2_error.c        )
+  src/pcre2_find_bracket.c )
   src/pcre2_jit_compile.c  )
   src/pcre2_jit_match.c    ) sources for the functions in the library,
   src/pcre2_jit_misc.c     )   and some internal functions that they use
@@ -832,4 +840,4 @@ The distribution should contain the files listed below.
 Philip Hazel
 Email local part: ph10
 Email domain: cam.ac.uk
-Last updated: 24 April 2015
+Last updated: 16 October 2015
index ae938fd3c6d17c924e3a54f2d3e5ed8e566d4fc7..f459657143000ae6ef7a8c444972dd722b580f58 100644 (file)
@@ -210,9 +210,15 @@ in the library.
 <tr><td><a href="pcre2_set_match_limit.html">pcre2_set_match_limit</a></td>
     <td>&nbsp;&nbsp;Set the match limit</td></tr>
 
+<tr><td><a href="pcre2_set_max_pattern_length.html">pcre2_set_max_pattern_length</a></td>
+    <td>&nbsp;&nbsp;Set the maximum length of pattern</td></tr>
+
 <tr><td><a href="pcre2_set_newline.html">pcre2_set_newline</a></td>
     <td>&nbsp;&nbsp;Set the newline convention</td></tr>
 
+<tr><td><a href="pcre2_set_offset_limit.html">pcre2_set_offset_limit</a></td>
+    <td>&nbsp;&nbsp;Set the offset limit</td></tr>
+
 <tr><td><a href="pcre2_set_parens_nest_limit.html">pcre2_set_parens_nest_limit</a></td>
     <td>&nbsp;&nbsp;Set the parentheses nesting limit</td></tr>
 
index e94b355a3b4227593ede9d6d86d1dd3ab844fa60..07ab8e9e8e7edd13bc67ef2fc17de3d0583d665c 100644 (file)
@@ -126,8 +126,10 @@ running redundant checks.
 <P>
 The use of the \C escape sequence in a UTF-8 or UTF-16 pattern can lead to
 problems, because it may leave the current matching point in the middle of a
-multi-code-unit character. The PCRE2_NEVER_BACKSLASH_C option can be used to
-lock out the use of \C, causing a compile-time error if it is encountered.
+multi-code-unit character. The PCRE2_NEVER_BACKSLASH_C option can be used by an
+application to lock out the use of \C, causing a compile-time error if it is
+encountered. It is also possible to build PCRE2 with the use of \C permanently
+disabled.
 </P>
 <P>
 Another way that performance can be hit is by running a pattern that has a very
@@ -187,7 +189,7 @@ use my two initials, followed by the two digits 10, at the domain cam.ac.uk.
 </P>
 <br><a name="SEC5" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 13 April 2015
+Last updated: 16 October 2015
 <br>
 Copyright &copy; 1997-2015 University of Cambridge.
 <br>
index 405d16466cfb85060d76ee9ea9bb4915777c1ec5..0477abe4c093e28abb00f71619bdc839ec22d8d0 100644 (file)
@@ -19,7 +19,7 @@ SYNOPSIS
 <b>#include &#60;pcre2.h&#62;</b>
 </P>
 <P>
-<b>pcre2_code_free(pcre2_code *<i>code</i>);</b>
+<b>void pcre2_code_free(pcre2_code *<i>code</i>);</b>
 </P>
 <br><b>
 DESCRIPTION
index 03cbe244a50638c7b39056055259f41402081d77..8d0321b550450a08a523cefa72a4a0a1ff66b040 100644 (file)
@@ -19,7 +19,7 @@ SYNOPSIS
 <b>#include &#60;pcre2.h&#62;</b>
 </P>
 <P>
-<b>pcre2_match_data_create(uint32_t <i>ovecsize</i>,</b>
+<b>pcre2_match_data *pcre2_match_data_create(uint32_t <i>ovecsize</i>,</b>
 <b>  pcre2_general_context *<i>gcontext</i>);</b>
 </P>
 <br><b>
index 3f8d3f51a9b189baa629b867b31d3d6e0e5f8d05..f40cf1e1209543ce15e218cf429d1c282bac1be7 100644 (file)
@@ -19,8 +19,8 @@ SYNOPSIS
 <b>#include &#60;pcre2.h&#62;</b>
 </P>
 <P>
-<b>pcre2_match_data_create_from_pattern(const pcre2_code *<i>code</i>,</b>
-<b>  pcre2_general_context *<i>gcontext</i>);</b>
+<b>pcre2_match_data *pcre2_match_data_create_from_pattern(</b>
+<b>  const pcre2_code *<i>code</i>, pcre2_general_context *<i>gcontext</i>);</b>
 </P>
 <br><b>
 DESCRIPTION
index 4e007ee4cb6dea125fc65766651c6d7a8360c32f..b4cd6f5b113591d999e1b977f11563434ecd5316 100644 (file)
@@ -42,19 +42,20 @@ request are as follows:
                                PCRE2_BSR_ANYCRLF: CR, LF, or CRLF only
   PCRE2_INFO_CAPTURECOUNT    Number of capturing subpatterns
   PCRE2_INFO_FIRSTBITMAP     Bitmap of first code units, or NULL
-  PCRE2_INFO_FIRSTCODEUNIT   First code unit when type is 1
   PCRE2_INFO_FIRSTCODETYPE   Type of start-of-match information
                                0 nothing set
                                1 first code unit is set
                                2 start of string or after newline
+  PCRE2_INFO_FIRSTCODEUNIT   First code unit when type is 1
+  PCRE2_INFO_HASBACKSLASHC   Return 1 if pattern contains \C
   PCRE2_INFO_HASCRORLF       Return 1 if explicit CR or LF matches
                                exist in the pattern
   PCRE2_INFO_JCHANGED        Return 1 if (?J) or (?-J) was used
   PCRE2_INFO_JITSIZE         Size of JIT compiled code, or 0
-  PCRE2_INFO_LASTCODEUNIT    Last code unit when type is 1
   PCRE2_INFO_LASTCODETYPE    Type of must-be-present information
                                0 nothing set
                                1 code unit is set
+  PCRE2_INFO_LASTCODEUNIT    Last code unit when type is 1
   PCRE2_INFO_MATCHEMPTY      1 if the pattern can match an
                                empty string, 0 otherwise
   PCRE2_INFO_MATCHLIMIT      Match limit if set,
@@ -62,8 +63,8 @@ request are as follows:
   PCRE2_INFO_MAXLOOKBEHIND   Length (in characters) of the longest
                                lookbehind assertion
   PCRE2_INFO_MINLENGTH       Lower bound length of matching strings
-  PCRE2_INFO_NAMEENTRYSIZE   Size of name table entries
   PCRE2_INFO_NAMECOUNT       Number of named subpatterns
+  PCRE2_INFO_NAMEENTRYSIZE   Size of name table entries
   PCRE2_INFO_NAMETABLE       Pointer to name table
   PCRE2_CONFIG_NEWLINE       Code for the newline sequence:
                                PCRE2_NEWLINE_CR
index 26948bdea1fbdfbc50e7fc276b44c76bbe4de378..688398ff2dd6a48a902561db7cdab86b4c066bf3 100644 (file)
@@ -20,7 +20,7 @@ SYNOPSIS
 </P>
 <P>
 <b>int32_t pcre2_serialize_decode(pcre2_code **<i>codes</i>,</b>
-<b>  int32_t <i>number_of_codes</i>, const uint32_t *<i>bytes</i>,</b>
+<b>  int32_t <i>number_of_codes</i>, const uint8_t *<i>bytes</i>,</b>
 <b>  pcre2_general_context *<i>gcontext</i>);</b>
 </P>
 <br><b>
index a6efcd7d06a0f653085e0d5bf44a21fb36cb8e1c..08cc46d1101e03ef78dd0e9b4cd737781d3a9d75 100644 (file)
@@ -19,8 +19,8 @@ SYNOPSIS
 <b>#include &#60;pcre2.h&#62;</b>
 </P>
 <P>
-<b>int32_t pcre2_serialize_encode(pcre2_code **<i>codes</i>,</b>
-<b>  int32_t <i>number_of_codes</i>, uint32_t **<i>serialized_bytes</i>,</b>
+<b>int32_t pcre2_serialize_encode(const pcre2_code **<i>codes</i>,</b>
+<b>  int32_t <i>number_of_codes</i>, uint8_t **<i>serialized_bytes</i>,</b>
 <b>  PCRE2_SIZE *<i>serialized_size</i>, pcre2_general_context *<i>gcontext</i>);</b>
 </P>
 <br><b>
diff --git a/doc/html/pcre2_set_offset_limit.html b/doc/html/pcre2_set_offset_limit.html
new file mode 100644 (file)
index 0000000..6d9a85c
--- /dev/null
@@ -0,0 +1,40 @@
+<html>
+<head>
+<title>pcre2_set_offset_limit specification</title>
+</head>
+<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
+<h1>pcre2_set_offset_limit man page</h1>
+<p>
+Return to the <a href="index.html">PCRE2 index page</a>.
+</p>
+<p>
+This page is part of the PCRE2 HTML documentation. It was generated
+automatically from the original man page. If there is any nonsense in it,
+please consult the man page, in case the conversion went wrong.
+<br>
+<br><b>
+SYNOPSIS
+</b><br>
+<P>
+<b>#include &#60;pcre2.h&#62;</b>
+</P>
+<P>
+<b>int pcre2_set_offset_limit(pcre2_match_context *<i>mcontext</i>,</b>
+<b>  PCRE2_SIZE <i>value</i>);</b>
+</P>
+<br><b>
+DESCRIPTION
+</b><br>
+<P>
+This function sets the offset limit field in a match context. The result is
+always zero.
+</P>
+<P>
+There is a complete description of the PCRE2 native API in the
+<a href="pcre2api.html"><b>pcre2api</b></a>
+page and a description of the POSIX API in the
+<a href="pcre2posix.html"><b>pcre2posix</b></a>
+page.
+<p>
+Return to the <a href="index.html">PCRE2 index page</a>.
+</p>
index 0976947dd4c0abf7c7b7ee2fb1b94bbc668e0811..2dfd094753957c64ef2416223c5256d193a68ba0 100644 (file)
@@ -59,20 +59,25 @@ units, not characters, as is the contents of the variable pointed at by
 <i>outlengthptr</i>, which is updated to the actual length of the new string.
 The options are:
 <pre>
-  PCRE2_ANCHORED          Match only at the first position
-  PCRE2_NOTBOL            Subject string is not the beginning of a line
-  PCRE2_NOTEOL            Subject string is not the end of a line
-  PCRE2_NOTEMPTY          An empty string is not a valid match
-  PCRE2_NOTEMPTY_ATSTART  An empty string at the start of the subject
-                           is not a valid match
-  PCRE2_NO_UTF_CHECK      Do not check the subject or replacement for
-                           UTF validity (only relevant if PCRE2_UTF
-                           was set at compile time)
-  PCRE2_SUBSTITUTE_GLOBAL Replace all occurrences in the subject
+  PCRE2_ANCHORED             Match only at the first position
+  PCRE2_NOTBOL               Subject is not the beginning of a line
+  PCRE2_NOTEOL               Subject is not the end of a line
+  PCRE2_NOTEMPTY             An empty string is not a valid match
+  PCRE2_NOTEMPTY_ATSTART     An empty string at the start of the
+                              subject is not a valid match
+  PCRE2_NO_UTF_CHECK         Do not check the subject or replacement
+                              for UTF validity (only relevant if
+                              PCRE2_UTF was set at compile time)
+  PCRE2_SUBSTITUTE_EXTENDED  Do extended replacement processing
+  PCRE2_SUBSTITUTE_GLOBAL    Replace all occurrences in the subject
+  PCRE2_SUBSTITUTE_OVERFLOW_LENGTH  If overflow, compute needed length
+  PCRE2_SUBSTITUTE_UNKNOWN_UNSET  Treat unknown group as unset
+  PCRE2_SUBSTITUTE_UNSET_EMPTY  Simple unset insert = empty string
 </pre>
 The function returns the number of substitutions, which may be zero if there
 were no matches. The result can be greater than one only when
-PCRE2_SUBSTITUTE_GLOBAL is set.
+PCRE2_SUBSTITUTE_GLOBAL is set. In the event of an error, a negative error code
+is returned.
 </P>
 <P>
 There is a complete description of the PCRE2 native API in the
index 60d2bf569fbb0cad559272dbc811af5e2a5c1bca..bf1dd8eaa22e482bb05acdaf0b2b03979ea1c3a3 100644 (file)
@@ -70,15 +70,15 @@ document for an overview of all the PCRE2 documentation.
 <b>  pcre2_compile_context *<i>ccontext</i>);</b>
 <br>
 <br>
-<b>pcre2_code_free(pcre2_code *<i>code</i>);</b>
+<b>void pcre2_code_free(pcre2_code *<i>code</i>);</b>
 <br>
 <br>
-<b>pcre2_match_data_create(uint32_t <i>ovecsize</i>,</b>
+<b>pcre2_match_data *pcre2_match_data_create(uint32_t <i>ovecsize</i>,</b>
 <b>  pcre2_general_context *<i>gcontext</i>);</b>
 <br>
 <br>
-<b>pcre2_match_data_create_from_pattern(const pcre2_code *<i>code</i>,</b>
-<b>  pcre2_general_context *<i>gcontext</i>);</b>
+<b>pcre2_match_data *pcre2_match_data_create_from_pattern(</b>
+<b>  const pcre2_code *<i>code</i>, pcre2_general_context *<i>gcontext</i>);</b>
 <br>
 <br>
 <b>int pcre2_match(const pcre2_code *<i>code</i>, PCRE2_SPTR <i>subject</i>,</b>
@@ -143,6 +143,10 @@ document for an overview of all the PCRE2 documentation.
 <b>  const unsigned char *<i>tables</i>);</b>
 <br>
 <br>
+<b>int pcre2_set_max_pattern_length(pcre2_compile_context *<i>ccontext</i>,</b>
+<b>  PCRE2_SIZE <i>value</i>);</b>
+<br>
+<br>
 <b>int pcre2_set_newline(pcre2_compile_context *<i>ccontext</i>,</b>
 <b>  uint32_t <i>value</i>);</b>
 <br>
@@ -176,6 +180,10 @@ document for an overview of all the PCRE2 documentation.
 <b>  uint32_t <i>value</i>);</b>
 <br>
 <br>
+<b>int pcre2_set_offset_limit(pcre2_match_context *<i>mcontext</i>,</b>
+<b>  PCRE2_SIZE <i>value</i>);</b>
+<br>
+<br>
 <b>int pcre2_set_recursion_limit(pcre2_match_context *<i>mcontext</i>,</b>
 <b>  uint32_t <i>value</i>);</b>
 <br>
@@ -266,12 +274,12 @@ document for an overview of all the PCRE2 documentation.
 <br><a name="SEC9" href="#TOC1">PCRE2 NATIVE API SERIALIZATION FUNCTIONS</a><br>
 <P>
 <b>int32_t pcre2_serialize_decode(pcre2_code **<i>codes</i>,</b>
-<b>  int32_t <i>number_of_codes</i>, const uint32_t *<i>bytes</i>,</b>
+<b>  int32_t <i>number_of_codes</i>, const uint8_t *<i>bytes</i>,</b>
 <b>  pcre2_general_context *<i>gcontext</i>);</b>
 <br>
 <br>
-<b>int32_t pcre2_serialize_encode(pcre2_code **<i>codes</i>,</b>
-<b>  int32_t <i>number_of_codes</i>, uint32_t **<i>serialized_bytes</i>,</b>
+<b>int32_t pcre2_serialize_encode(const pcre2_code **<i>codes</i>,</b>
+<b>  int32_t <i>number_of_codes</i>, uint8_t **<i>serialized_bytes</i>,</b>
 <b>  PCRE2_SIZE *<i>serialized_size</i>, pcre2_general_context *<i>gcontext</i>);</b>
 <br>
 <br>
@@ -610,6 +618,7 @@ of the following compile-time parameters:
   PCRE2's character tables
   The newline character sequence
   The compile time nested parentheses limit
+  The maximum length of the pattern string
   An external function for stack checking
 </pre>
 A compile context is also required if you are using custom memory management.
@@ -648,6 +657,15 @@ interpreted matching functions, <i>pcre2_match()</i> and
 The value must be the result of a call to <i>pcre2_maketables()</i>, whose only
 argument is a general context. This function builds a set of character tables
 in the current locale.
+<b>int pcre2_set_max_pattern_length(pcre2_compile_context *<i>ccontext</i>,</b>
+<b>  PCRE2_SIZE <i>value</i>);</b>
+<br>
+<br>
+This sets a maximum length, in code units, for the pattern string that is to be
+compiled. If the pattern is longer, an error is generated. This facility is
+provided so that applications that accept patterns from external sources can
+limit their size. The default is the largest number that a PCRE2_SIZE variable
+can hold, which is effectively unlimited.
 <b>int pcre2_set_newline(pcre2_compile_context *<i>ccontext</i>,</b>
 <b>  uint32_t <i>value</i>);</b>
 <br>
@@ -697,8 +715,9 @@ A match context is required if you want to change the default values of any
 of the following match-time parameters:
 <pre>
   A callout function
-  The limit for calling <i>match()</i>
-  The limit for calling <i>match()</i> recursively
+  The offset limit for matching an unanchored pattern
+  The limit for calling <b>match()</b> (see below)
+  The limit for calling <b>match()</b> recursively
 </pre>
 A match context is also required if you are using custom memory management.
 If none of these apply, just pass NULL as the context argument of
@@ -729,6 +748,32 @@ This sets up a "callout" function, which PCRE2 will call at specified points
 during a matching operation. Details are given in the
 <a href="pcre2callout.html"><b>pcre2callout</b></a>
 documentation.
+<b>int pcre2_set_offset_limit(pcre2_match_context *<i>mcontext</i>,</b>
+<b>  PCRE2_SIZE <i>value</i>);</b>
+<br>
+<br>
+The <i>offset_limit</i> parameter limits how far an unanchored search can
+advance in the subject string. The default value is PCRE2_UNSET. The
+<b>pcre2_match()</b> and <b>pcre2_dfa_match()</b> functions return
+PCRE2_ERROR_NOMATCH if a match with a starting point before or at the given
+offset is not found. For example, if the pattern /abc/ is matched against
+"123abc" with an offset limit less than 3, the result is PCRE2_ERROR_NO_MATCH.
+A match can never be found if the <i>startoffset</i> argument of
+<b>pcre2_match()</b> or <b>pcre2_dfa_match()</b> is greater than the offset
+limit.
+</P>
+<P>
+When using this facility, you must set PCRE2_USE_OFFSET_LIMIT when calling
+<b>pcre2_compile()</b> so that when JIT is in use, different code can be
+compiled. If a match is started with a non-default match limit when
+PCRE2_USE_OFFSET_LIMIT is not set, an error is generated.
+</P>
+<P>
+The offset limit facility can be used to track progress when searching large
+subject strings. See also the PCRE2_FIRSTLINE option, which requires a match to
+start within the first line of the subject. If this is set with an offset
+limit, a match must occur in the first line and also within the offset limit.
+In other words, whichever limit comes first is used.
 <b>int pcre2_set_match_limit(pcre2_match_context *<i>mcontext</i>,</b>
 <b>  uint32_t <i>value</i>);</b>
 <br>
@@ -936,7 +981,7 @@ The <i>where</i> argument should point to a buffer that is at least 24 code
 units long. (The exact length required can be found by calling
 <b>pcre2_config()</b> with <b>where</b> set to NULL.) If PCRE2 has been compiled
 without Unicode support, the buffer is filled with the text "Unicode not
-supported". Otherwise, the Unicode version string (for example, "7.0.0") is
+supported". Otherwise, the Unicode version string (for example, "8.0.0") is
 inserted. The number of code units used is returned. This is the length of the
 string plus one unit for the terminating zero.
 <pre>
@@ -961,7 +1006,7 @@ zero.
 <b>  pcre2_compile_context *<i>ccontext</i>);</b>
 <br>
 <br>
-<b>pcre2_code_free(pcre2_code *<i>code</i>);</b>
+<b>void pcre2_code_free(pcre2_code *<i>code</i>);</b>
 </P>
 <P>
 The <b>pcre2_compile()</b> function compiles a pattern into an internal form.
@@ -1083,6 +1128,18 @@ after any internal newline. However, it does not match after a newline at the
 end of the subject, for compatibility with Perl. If you want a multiline
 circumflex also to match after a terminating newline, you must set
 PCRE2_ALT_CIRCUMFLEX.
+<pre>
+  PCRE2_ALT_VERBNAMES
+</pre>
+By default, for compatibility with Perl, the name in any verb sequence such as
+(*MARK:NAME) is any sequence of characters that does not include a closing
+parenthesis. The name is not processed in any way, and it is not possible to
+include a closing parenthesis in the name. However, if the PCRE2_ALT_VERBNAMES
+option is set, normal backslash processing is applied to verb names and only an
+unescaped closing parenthesis terminates the name. A closing parenthesis can be
+included in a name either as \) or between \Q and \E. If the PCRE2_EXTENDED
+option is set, unescaped whitespace in verb names is skipped and #-comments are
+recognized, exactly as in the rest of the pattern.
 <pre>
   PCRE2_AUTO_CALLOUT
 </pre>
@@ -1156,7 +1213,10 @@ built.
 </pre>
 If this option is set, an unanchored pattern is required to match before or at
 the first newline in the subject string, though the matched text may continue
-over the newline.
+over the newline. See also PCRE2_USE_OFFSET_LIMIT, which provides a more
+general limiting facility. If PCRE2_FIRSTLINE is set with an offset limit, a
+match must occur in the first line and also within the offset limit. In other
+words, whichever limit comes first is used.
 <pre>
   PCRE2_MATCH_UNSET_BACKREF
 </pre>
@@ -1195,7 +1255,8 @@ This option locks out the use of \C in the pattern that is being compiled.
 This escape can cause unpredictable behaviour in UTF-8 or UTF-16 modes, because
 it may leave the current matching point in the middle of a multi-code-unit
 character. This option may be useful in applications that process patterns from
-external sources.
+external sources. Note that there is also a build-time option that permanently
+locks out the use of \C.
 <pre>
   PCRE2_NEVER_UCP
 </pre>
@@ -1338,6 +1399,17 @@ support.
 This option inverts the "greediness" of the quantifiers so that they are not
 greedy by default, but become greedy if followed by "?". It is not compatible
 with Perl. It can also be set by a (?U) option setting within the pattern.
+<pre>
+  PCRE2_USE_OFFSET_LIMIT
+</pre>
+This option must be set for <b>pcre2_compile()</b> if
+<b>pcre2_set_offset_limit()</b> is going to be used to set a non-default offset
+limit in a match context for matches that use this pattern. An error is
+generated if an offset limit is set without this option. For more details, see
+the description of <b>pcre2_set_offset_limit()</b> in the
+<a href="#matchcontext">section</a>
+that describes match contexts. See also the PCRE2_FIRSTLINE
+option above.
 <pre>
   PCRE2_UTF
 </pre>
@@ -1495,11 +1567,10 @@ are as follows:
 Return a copy of the pattern's options. The third argument should point to a
 <b>uint32_t</b> variable. PCRE2_INFO_ARGOPTIONS returns exactly the options that
 were passed to <b>pcre2_compile()</b>, whereas PCRE2_INFO_ALLOPTIONS returns
-the compile options as modified by any top-level option settings at the start
-of the pattern itself. In other words, they are the options that will be in
-force when matching starts. For example, if the pattern /(?im)abc(?-i)d/ is
-compiled with the PCRE2_EXTENDED option, the result is PCRE2_CASELESS,
-PCRE2_MULTILINE, and PCRE2_EXTENDED.
+the compile options as modified by any top-level option settings such as (*UTF)
+at the start of the pattern itself. For example, if the pattern /(*UTF)abc/ is
+compiled with the PCRE2_EXTENDED option, the result is PCRE2_EXTENDED and
+PCRE2_UTF.
 </P>
 <P>
 A pattern compiled without PCRE2_ANCHORED is automatically anchored by PCRE2 if
@@ -1541,18 +1612,27 @@ matches only CR, LF, or CRLF.
 <pre>
   PCRE2_INFO_CAPTURECOUNT
 </pre>
-Return the number of capturing subpatterns in the pattern. The third argument
-should point to an <b>uint32_t</b> variable.
+Return the highest capturing subpattern number in the pattern. In patterns
+where (?| is not used, this is also the total number of capturing subpatterns.
+The third argument should point to an <b>uint32_t</b> variable.
+<pre>
+  PCRE2_INFO_FIRSTBITMAP
+</pre>
+In the absence of a single first code unit for a non-anchored pattern,
+<b>pcre2_compile()</b> may construct a 256-bit table that defines a fixed set of
+values for the first code unit in any match. For example, a pattern that starts
+with [abc] results in a table with three bits set. When code unit values
+greater than 255 are supported, the flag bit for 255 means "any code unit of
+value 255 or above". If such a table was constructed, a pointer to it is
+returned. Otherwise NULL is returned. The third argument should point to an
+<b>const uint8_t *</b> variable.
 <pre>
   PCRE2_INFO_FIRSTCODETYPE
 </pre>
 Return information about the first code unit of any matched string, for a
 non-anchored pattern. The third argument should point to an <b>uint32_t</b>
-variable.
-</P>
-<P>
-If there is a fixed first value, for example, the letter "c" from a pattern
-such as (cat|cow|coyote), 1 is returned, and the character value can be
+variable. If there is a fixed first value, for example, the letter "c" from a
+pattern such as (cat|cow|coyote), 1 is returned, and the character value can be
 retrieved using PCRE2_INFO_FIRSTCODEUNIT. If there is no fixed first value, but
 it is known that a match can occur only at the start of the subject or
 following a newline in the subject, 2 is returned. Otherwise, and for anchored
@@ -1567,16 +1647,10 @@ value is always less than 256. In the 16-bit library the value can be up to
 0xffff. In the 32-bit library in UTF-32 mode the value can be up to 0x10ffff,
 and up to 0xffffffff when not using UTF-32 mode.
 <pre>
-  PCRE2_INFO_FIRSTBITMAP
+  PCRE2_INFO_HASBACKSLASHC
 </pre>
-In the absence of a single first code unit for a non-anchored pattern,
-<b>pcre2_compile()</b> may construct a 256-bit table that defines a fixed set of
-values for the first code unit in any match. For example, a pattern that starts
-with [abc] results in a table with three bits set. When code unit values
-greater than 255 are supported, the flag bit for 255 means "any code unit of
-value 255 or above". If such a table was constructed, a pointer to it is
-returned. Otherwise NULL is returned. The third argument should point to an
-<b>const uint8_t *</b> variable.
+Return 1 if the pattern contains any instances of \C, otherwise 0. The third
+argument should point to an <b>uint32_t</b> variable.
 <pre>
   PCRE2_INFO_HASCRORLF
 </pre>
@@ -1602,13 +1676,10 @@ Returns 1 if there is a rightmost literal code unit that must exist in any
 matched string, other than at its start. The third argument should  point to an
 <b>uint32_t</b> variable. If there is no such value, 0 is returned. When 1 is
 returned, the code unit value itself can be retrieved using
-PCRE2_INFO_LASTCODEUNIT.
-</P>
-<P>
-For anchored patterns, a last literal value is recorded only if it follows
-something of variable length. For example, for the pattern /^a\d+z\d+/ the
-returned value is 1 (with "z" returned from PCRE2_INFO_LASTCODEUNIT), but for
-/^a\dz\d/ the returned value is 0.
+PCRE2_INFO_LASTCODEUNIT. For anchored patterns, a last literal value is
+recorded only if it follows something of variable length. For example, for the
+pattern /^a\d+z\d+/ the returned value is 1 (with "z" returned from
+PCRE2_INFO_LASTCODEUNIT), but for /^a\dz\d/ the returned value is 0.
 <pre>
   PCRE2_INFO_LASTCODEUNIT
 </pre>
@@ -1619,8 +1690,11 @@ value, 0 is returned.
 <pre>
   PCRE2_INFO_MATCHEMPTY
 </pre>
-Return 1 if the pattern can match an empty string, otherwise 0. The third
-argument should point to an <b>uint32_t</b> variable.
+Return 1 if the pattern might match an empty string, otherwise 0. The third
+argument should point to an <b>uint32_t</b> variable. When a pattern contains
+recursive subroutine calls it is not always possible to determine whether or
+not it can match an empty string. PCRE2 takes a cautious approach and returns 1
+in such cases.
 <pre>
   PCRE2_INFO_MATCHLIMIT
 </pre>
@@ -1778,12 +1852,12 @@ documentation.
 <a name="matchdatablock"></a></P>
 <br><a name="SEC25" href="#TOC1">THE MATCH DATA BLOCK</a><br>
 <P>
-<b>pcre2_match_data_create(uint32_t <i>ovecsize</i>,</b>
+<b>pcre2_match_data *pcre2_match_data_create(uint32_t <i>ovecsize</i>,</b>
 <b>  pcre2_general_context *<i>gcontext</i>);</b>
 <br>
 <br>
-<b>pcre2_match_data_create_from_pattern(const pcre2_code *<i>code</i>,</b>
-<b>  pcre2_general_context *<i>gcontext</i>);</b>
+<b>pcre2_match_data *pcre2_match_data_create_from_pattern(</b>
+<b>  const pcre2_code *<i>code</i>, pcre2_general_context *<i>gcontext</i>);</b>
 <br>
 <br>
 <b>void pcre2_match_data_free(pcre2_match_data *<i>match_data</i>);</b>
@@ -2010,12 +2084,20 @@ If the pattern is anchored, such a match can occur only if the pattern contains
 </pre>
 When PCRE2_UTF is set at compile time, the validity of the subject as a UTF
 string is checked by default when <b>pcre2_match()</b> is subsequently called.
-The entire string is checked before any other processing takes place, and a
+If a non-zero starting offset is given, the check is applied only to that part
+of the subject that could be inspected during matching, and there is a check
+that the starting offset points to the first code unit of a character or to the
+end of the subject. If there are no lookbehind assertions in the pattern, the
+check starts at the starting offset. Otherwise, it starts at the length of the
+longest lookbehind before the starting offset, or at the start of the subject
+if there are not that many characters before the starting offset. Note that the
+sequences \b and \B are one-character lookbehinds.
+</P>
+<P>
+The check is carried out before any other processing takes place, and a
 negative error code is returned if the check fails. There are several UTF error
 codes for each code unit width, corresponding to different problems with the
-code unit sequence. The value of <i>startoffset</i> is also checked, to ensure
-that it points to the start of a character or to the end of the subject. There
-are discussions about the validity of
+code unit sequence. There are discussions about the validity of
 <a href="pcre2unicode.html#utf8strings">UTF-8 strings,</a>
 <a href="pcre2unicode.html#utf16strings">UTF-16 strings,</a>
 and
@@ -2066,8 +2148,13 @@ documentation.
 When PCRE2 is built, a default newline convention is set; this is usually the
 standard convention for the operating system. The default can be overridden in
 a
-<a href="#compilecontext">compile context.</a>
-During matching, the newline choice affects the behaviour of the dot,
+<a href="#compilecontext">compile context</a>
+by calling <b>pcre2_set_newline()</b>. It can also be overridden by starting a
+pattern string with, for example, (*CRLF), as described in the
+<a href="pcre2pattern.html#newlines">section on newline conventions</a>
+in the
+<a href="pcre2pattern.html"><b>pcre2pattern</b></a>
+page. During matching, the newline choice affects the behaviour of the dot,
 circumflex, and dollar metacharacters. It may also alter the way the match
 starting position is advanced after a match failure for an unanchored pattern.
 </P>
@@ -2115,19 +2202,20 @@ function can be used to find out how many capturing subpatterns there are in a
 compiled pattern.
 </P>
 <P>
-A successful match returns the overall matched string and any captured
-substrings to the caller via a vector of PCRE2_SIZE values. This is called the
-<b>ovector</b>, and is contained within the
-<a href="#matchdatablock">match data block.</a>
-You can obtain direct access to the ovector by calling
-<b>pcre2_get_ovector_pointer()</b> to find its address, and
-<b>pcre2_get_ovector_count()</b> to find the number of pairs of values it
-contains. Alternatively, you can use the auxiliary functions for accessing
-captured substrings
+You can use auxiliary functions for accessing captured substrings
 <a href="#extractbynumber">by number</a>
 or
-<a href="#extractbyname">by name</a>
-(see below).
+<a href="#extractbyname">by name,</a>
+as described in sections below.
+</P>
+<P>
+Alternatively, you can make direct use of the vector of PCRE2_SIZE values,
+called the <b>ovector</b>, which contains the offsets of captured strings. It is
+part of the
+<a href="#matchdatablock">match data block.</a>
+The function <b>pcre2_get_ovector_pointer()</b> returns the address of the
+ovector, and <b>pcre2_get_ovector_count()</b> returns the number of pairs of
+values it contains.
 </P>
 <P>
 Within the ovector, the first in each pair of values is set to the offset of
@@ -2216,7 +2304,13 @@ After a successful match, a partial match (PCRE2_ERROR_PARTIAL), or a failure
 to match (PCRE2_ERROR_NOMATCH), a (*MARK) name may be available, and
 <b>pcre2_get_mark()</b> can be called. It returns a pointer to the
 zero-terminated name, which is within the compiled pattern. Otherwise NULL is
-returned. After a successful match, the (*MARK) name that is returned is the
+returned. The length of the (*MARK) name (excluding the terminating zero) is
+stored in the code unit that preceeds the name. You should use this instead of
+relying on the terminating zero if the (*MARK) name might contain a binary
+zero.
+</P>
+<P>
+After a successful match, the (*MARK) name that is returned is the
 last one encountered on the matching path through the pattern. After a "no
 match" or a partial match, the last encountered (*MARK) name is returned. For
 example, consider this pattern:
@@ -2237,7 +2331,7 @@ escape sequence. After a partial match, however, this value is always the same
 as <i>ovector[0]</i> because \K does not affect the result of a partial match.
 </P>
 <P>
-After a UTF check failure, \fBpcre2_get_startchar()\fB can be used to obtain
+After a UTF check failure, <b>pcre2_get_startchar()</b> can be used to obtain
 the code unit offset of the invalid UTF character. Details are given in the
 <a href="pcre2unicode.html"><b>pcre2unicode</b></a>
 page.
@@ -2552,61 +2646,205 @@ same number causes an error at compile time.
 <b>int pcre2_substitute(const pcre2_code *<i>code</i>, PCRE2_SPTR <i>subject</i>,</b>
 <b>  PCRE2_SIZE <i>length</i>, PCRE2_SIZE <i>startoffset</i>,</b>
 <b>  uint32_t <i>options</i>, pcre2_match_data *<i>match_data</i>,</b>
-<b>  pcre2_match_context *<i>mcontext</i>, PCRE2_SPTR \fIreplacementzfP,</b>
+<b>  pcre2_match_context *<i>mcontext</i>, PCRE2_SPTR <i>replacement</i>,</b>
 <b>  PCRE2_SIZE <i>rlength</i>, PCRE2_UCHAR *\fIoutputbuffer\zfP,</b>
 <b>  PCRE2_SIZE *<i>outlengthptr</i>);</b>
+</P>
+<P>
 This function calls <b>pcre2_match()</b> and then makes a copy of the subject
 string in <i>outputbuffer</i>, replacing the part that was matched with the
 <i>replacement</i> string, whose length is supplied in <b>rlength</b>. This can
-be given as PCRE2_ZERO_TERMINATED for a zero-terminated string.
+be given as PCRE2_ZERO_TERMINATED for a zero-terminated string. Matches in
+which a \K item in a lookahead in the pattern causes the match to end before
+it starts are not supported, and give rise to an error return.
+</P>
+<P>
+The first seven arguments of <b>pcre2_substitute()</b> are the same as for
+<b>pcre2_match()</b>, except that the partial matching options are not
+permitted, and <i>match_data</i> may be passed as NULL, in which case a match
+data block is obtained and freed within this function, using memory management
+functions from the match context, if provided, or else those that were used to
+allocate memory for the compiled code.
+</P>
+<P>
+The <i>outlengthptr</i> argument must point to a variable that contains the
+length, in code units, of the output buffer. If the function is successful, the
+value is updated to contain the length of the new string, excluding the
+trailing zero that is automatically added.
+</P>
+<P>
+If the function is not successful, the value set via <i>outlengthptr</i> depends
+on the type of error. For syntax errors in the replacement string, the value is
+the offset in the replacement string where the error was detected. For other
+errors, the value is PCRE2_UNSET by default. This includes the case of the
+output buffer being too small, unless PCRE2_SUBSTITUTE_OVERFLOW_LENGTH is set
+(see below), in which case the value is the minimum length needed, including
+space for the trailing zero. Note that in order to compute the required length,
+<b>pcre2_substitute()</b> has to simulate all the matching and copying, instead
+of giving an error return as soon as the buffer overflows. Note also that the
+length is in code units, not bytes.
 </P>
 <P>
 In the replacement string, which is interpreted as a UTF string in UTF mode,
 and is checked for UTF validity unless the PCRE2_NO_UTF_CHECK option is set, a
 dollar character is an escape character that can specify the insertion of
-characters from capturing groups in the pattern. The following forms are
-recognized:
+characters from capturing groups or (*MARK) items in the pattern. The following
+forms are always recognized:
 <pre>
-  $$      insert a dollar character
-  $&#60;n&#62;    insert the contents of group &#60;n&#62;
-  ${&#60;n&#62;}  insert the contents of group &#60;n&#62;
+  $$                  insert a dollar character
+  $&#60;n&#62; or ${&#60;n&#62;}      insert the contents of group &#60;n&#62;
+  $*MARK or ${*MARK}  insert the name of the last (*MARK) encountered
 </pre>
 Either a group number or a group name can be given for &#60;n&#62;. Curly brackets are
 required only if the following character would be interpreted as part of the
 number or name. The number may be zero to include the entire matched string.
 For example, if the pattern a(b)c is matched with "=abc=" and the replacement
-string "+$1$0$1+", the result is "=+babcb+=". Group insertion is done by
-calling <b>pcre2_copy_byname()</b> or <b>pcre2_copy_bynumber()</b> as
-appropriate.
+string "+$1$0$1+", the result is "=+babcb+=".
 </P>
 <P>
-The first seven arguments of <b>pcre2_substitute()</b> are the same as for
-<b>pcre2_match()</b>, except that the partial matching options are not
-permitted, and <i>match_data</i> may be passed as NULL, in which case a match
-data block is obtained and freed within this function, using memory management
-functions from the match context, if provided, or else those that were used to
-allocate memory for the compiled code.
+The facility for inserting a (*MARK) name can be used to perform simple
+simultaneous substitutions, as this <b>pcre2test</b> example shows:
+<pre>
+  /(*:pear)apple|(*:orange)lemon/g,replace=${*MARK}
+      apple lemon
+   2: pear orange
+</pre>
+As well as the usual options for <b>pcre2_match()</b>, a number of additional
+options can be set in the <i>options</i> argument.
 </P>
 <P>
-There is one additional option, PCRE2_SUBSTITUTE_GLOBAL, which causes the
-function to iterate over the subject string, replacing every matching
-substring. If this is not set, only the first matching substring is replaced.
+PCRE2_SUBSTITUTE_GLOBAL causes the function to iterate over the subject string,
+replacing every matching substring. If this is not set, only the first matching
+substring is replaced. If any matched substring has zero length, after the
+substitution has happened, an attempt to find a non-empty match at the same
+position is performed. If this is not successful, the current position is
+advanced by one character except when CRLF is a valid newline sequence and the
+next two characters are CR, LF. In this case, the current position is advanced
+by two characters.
 </P>
 <P>
-The <i>outlengthptr</i> argument must point to a variable that contains the
-length, in code units, of the output buffer. It is updated to contain the
-length of the new string, excluding the trailing zero that is automatically
-added.
+PCRE2_SUBSTITUTE_OVERFLOW_LENGTH changes what happens when the output buffer is
+too small. The default action is to return PCRE2_ERROR_NOMEMORY immediately. If
+this option is set, however, <b>pcre2_substitute()</b> continues to go through
+the motions of matching and substituting (without, of course, writing anything)
+in order to compute the size of buffer that is needed. This value is passed
+back via the <i>outlengthptr</i> variable, with the result of the function still
+being PCRE2_ERROR_NOMEMORY.
+</P>
+<P>
+Passing a buffer size of zero is a permitted way of finding out how much memory
+is needed for given substitution. However, this does mean that the entire
+operation is carried out twice. Depending on the application, it may be more
+efficient to allocate a large buffer and free the excess afterwards, instead of
+using PCRE2_SUBSTITUTE_OVERFLOW_LENGTH.
+</P>
+<P>
+PCRE2_SUBSTITUTE_UNKNOWN_UNSET causes references to capturing groups that do
+not appear in the pattern to be treated as unset groups. This option should be
+used with care, because it means that a typo in a group name or number no
+longer causes the PCRE2_ERROR_NOSUBSTRING error.
+</P>
+<P>
+PCRE2_SUBSTITUTE_UNSET_EMPTY causes unset capturing groups (including unknown
+groups when PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set) to be treated as empty
+strings when inserted as described above. If this option is not set, an attempt
+to insert an unset group causes the PCRE2_ERROR_UNSET error. This option does
+not influence the extended substitution syntax described below.
+</P>
+<P>
+PCRE2_SUBSTITUTE_EXTENDED causes extra processing to be applied to the
+replacement string. Without this option, only the dollar character is special,
+and only the group insertion forms listed above are valid. When
+PCRE2_SUBSTITUTE_EXTENDED is set, two things change:
+</P>
+<P>
+Firstly, backslash in a replacement string is interpreted as an escape
+character. The usual forms such as \n or \x{ddd} can be used to specify
+particular character codes, and backslash followed by any non-alphanumeric
+character quotes that character. Extended quoting can be coded using \Q...\E,
+exactly as in pattern strings.
+</P>
+<P>
+There are also four escape sequences for forcing the case of inserted letters.
+The insertion mechanism has three states: no case forcing, force upper case,
+and force lower case. The escape sequences change the current state: \U and
+\L change to upper or lower case forcing, respectively, and \E (when not
+terminating a \Q quoted sequence) reverts to no case forcing. The sequences
+\u and \l force the next character (if it is a letter) to upper or lower
+case, respectively, and then the state automatically reverts to no case
+forcing. Case forcing applies to all inserted  characters, including those from
+captured groups and letters within \Q...\E quoted sequences.
+</P>
+<P>
+Note that case forcing sequences such as \U...\E do not nest. For example,
+the result of processing "\Uaa\LBB\Ecc\E" is "AAbbcc"; the final \E has no
+effect.
+</P>
+<P>
+The second effect of setting PCRE2_SUBSTITUTE_EXTENDED is to add more
+flexibility to group substitution. The syntax is similar to that used by Bash:
+<pre>
+  ${&#60;n&#62;:-&#60;string&#62;}
+  ${&#60;n&#62;:+&#60;string1&#62;:&#60;string2&#62;}
+</pre>
+As before, &#60;n&#62; may be a group number or a name. The first form specifies a
+default value. If group &#60;n&#62; is set, its value is inserted; if not, &#60;string&#62; is
+expanded and the result inserted. The second form specifies strings that are
+expanded and inserted when group &#60;n&#62; is set or unset, respectively. The first
+form is just a convenient shorthand for
+<pre>
+  ${&#60;n&#62;:+${&#60;n&#62;}:&#60;string&#62;}
+</pre>
+Backslash can be used to escape colons and closing curly brackets in the
+replacement strings. A change of the case forcing state within a replacement
+string remains in force afterwards, as shown in this <b>pcre2test</b> example:
+<pre>
+  /(some)?(body)/substitute_extended,replace=${1:+\U:\L}HeLLo
+      body
+   1: hello
+      somebody
+   1: HELLO
+</pre>
+The PCRE2_SUBSTITUTE_UNSET_EMPTY option does not affect these extended
+substitutions. However, PCRE2_SUBSTITUTE_UNKNOWN_UNSET does cause unknown
+groups in the extended syntax forms to be treated as unset.
+</P>
+<P>
+If successful, <b>pcre2_substitute()</b> returns the number of replacements that
+were made. This may be zero if no matches were found, and is never greater than
+1 unless PCRE2_SUBSTITUTE_GLOBAL is set.
+</P>
+<P>
+In the event of an error, a negative error code is returned. Except for
+PCRE2_ERROR_NOMATCH (which is never returned), errors from <b>pcre2_match()</b>
+are passed straight back.
+</P>
+<P>
+PCRE2_ERROR_NOSUBSTRING is returned for a non-existent substring insertion,
+unless PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set.
+</P>
+<P>
+PCRE2_ERROR_UNSET is returned for an unset substring insertion (including an
+unknown substring when PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set) when the simple
+(non-extended) syntax is used and PCRE2_SUBSTITUTE_UNSET_EMPTY is not set.
+</P>
+<P>
+PCRE2_ERROR_NOMEMORY is returned if the output buffer is not big enough. If the
+PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option is set, the size of buffer that is
+needed is returned via <i>outlengthptr</i>. Note that this does not happen by
+default.
+</P>
+<P>
+PCRE2_ERROR_BADREPLACEMENT is used for miscellaneous syntax errors in the
+replacement string, with more particular errors being PCRE2_ERROR_BADREPESCAPE
+(invalid escape sequence), PCRE2_ERROR_REPMISSING_BRACE (closing curly bracket
+not found), PCRE2_BADSUBSTITUTION (syntax error in extended group
+substitution), and PCRE2_BADSUBPATTERN (the pattern match ended before it
+started, which can happen if \K is used in an assertion).
 </P>
 <P>
-The function returns the number of replacements that were made. This may be
-zero if no matches were found, and is never greater than 1 unless
-PCRE2_SUBSTITUTE_GLOBAL is set. In the event of an error, a negative error code
-is returned. Except for PCRE2_ERROR_NOMATCH (which is never returned), any
-errors from <b>pcre2_match()</b> or the substring copying functions are passed
-straight back. PCRE2_ERROR_BADREPLACEMENT is returned for an invalid
-replacement string (unrecognized sequence following a dollar sign), and
-PCRE2_ERROR_NOMEMORY is returned if the output buffer is not big enough.
+As for all PCRE2 errors, a text message that describes the error can be
+obtained by calling <b>pcre2_get_error_message()</b>.
 </P>
 <br><a name="SEC35" href="#TOC1">DUPLICATE SUBPATTERN NAMES</a><br>
 <P>
@@ -2647,11 +2885,11 @@ function returns the length of each entry in code units. In both cases,
 PCRE2_ERROR_NOSUBSTRING is returned if there are no entries for the given name.
 </P>
 <P>
-The format of the name table is described above in the section entitled
-<i>Information about a pattern</i>
-<a href="#infoaboutpattern">above.</a>
-Given all the relevant entries for the name, you can extract each of their
-numbers, and hence the captured data.
+The format of the name table is described
+<a href="#infoaboutpattern">above</a>
+in the section entitled <i>Information about a pattern</i>. Given all the
+relevant entries for the name, you can extract each of their numbers, and hence
+the captured data.
 </P>
 <br><a name="SEC36" href="#TOC1">FINDING ALL POSSIBLE MATCHES AT ONE POSITION</a><br>
 <P>
@@ -2838,8 +3076,8 @@ There are in addition the following errors that are specific to
   PCRE2_ERROR_DFA_UITEM
 </pre>
 This return is given if <b>pcre2_dfa_match()</b> encounters an item in the
-pattern that it does not support, for instance, the use of \C or a back
-reference.
+pattern that it does not support, for instance, the use of \C in a UTF mode or
+a back reference.
 <pre>
   PCRE2_ERROR_DFA_UCOND
 </pre>
@@ -2883,7 +3121,7 @@ Cambridge, England.
 </P>
 <br><a name="SEC40" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 22 April 2015
+Last updated: 16 December 2015
 <br>
 Copyright &copy; 1997-2015 University of Cambridge.
 <br>
index 8d9f9ce9e1f06141a5a87d85139b10e70940e179..1e5f7373d7c1dc38745f26f6c54ee6a1a1fd8510 100644 (file)
@@ -18,23 +18,24 @@ please consult the man page, in case the conversion went wrong.
 <li><a name="TOC3" href="#SEC3">BUILDING 8-BIT, 16-BIT AND 32-BIT LIBRARIES</a>
 <li><a name="TOC4" href="#SEC4">BUILDING SHARED AND STATIC LIBRARIES</a>
 <li><a name="TOC5" href="#SEC5">UNICODE AND UTF SUPPORT</a>
-<li><a name="TOC6" href="#SEC6">JUST-IN-TIME COMPILER SUPPORT</a>
-<li><a name="TOC7" href="#SEC7">NEWLINE RECOGNITION</a>
-<li><a name="TOC8" href="#SEC8">WHAT \R MATCHES</a>
-<li><a name="TOC9" href="#SEC9">HANDLING VERY LARGE PATTERNS</a>
-<li><a name="TOC10" href="#SEC10">AVOIDING EXCESSIVE STACK USAGE</a>
-<li><a name="TOC11" href="#SEC11">LIMITING PCRE2 RESOURCE USAGE</a>
-<li><a name="TOC12" href="#SEC12">CREATING CHARACTER TABLES AT BUILD TIME</a>
-<li><a name="TOC13" href="#SEC13">USING EBCDIC CODE</a>
-<li><a name="TOC14" href="#SEC14">PCRE2GREP OPTIONS FOR COMPRESSED FILE SUPPORT</a>
-<li><a name="TOC15" href="#SEC15">PCRE2GREP BUFFER SIZE</a>
-<li><a name="TOC16" href="#SEC16">PCRE2TEST OPTION FOR LIBREADLINE SUPPORT</a>
-<li><a name="TOC17" href="#SEC17">INCLUDING DEBUGGING CODE</a>
-<li><a name="TOC18" href="#SEC18">DEBUGGING WITH VALGRIND SUPPORT</a>
-<li><a name="TOC19" href="#SEC19">CODE COVERAGE REPORTING</a>
-<li><a name="TOC20" href="#SEC20">SEE ALSO</a>
-<li><a name="TOC21" href="#SEC21">AUTHOR</a>
-<li><a name="TOC22" href="#SEC22">REVISION</a>
+<li><a name="TOC6" href="#SEC6">DISABLING THE USE OF \C</a>
+<li><a name="TOC7" href="#SEC7">JUST-IN-TIME COMPILER SUPPORT</a>
+<li><a name="TOC8" href="#SEC8">NEWLINE RECOGNITION</a>
+<li><a name="TOC9" href="#SEC9">WHAT \R MATCHES</a>
+<li><a name="TOC10" href="#SEC10">HANDLING VERY LARGE PATTERNS</a>
+<li><a name="TOC11" href="#SEC11">AVOIDING EXCESSIVE STACK USAGE</a>
+<li><a name="TOC12" href="#SEC12">LIMITING PCRE2 RESOURCE USAGE</a>
+<li><a name="TOC13" href="#SEC13">CREATING CHARACTER TABLES AT BUILD TIME</a>
+<li><a name="TOC14" href="#SEC14">USING EBCDIC CODE</a>
+<li><a name="TOC15" href="#SEC15">PCRE2GREP OPTIONS FOR COMPRESSED FILE SUPPORT</a>
+<li><a name="TOC16" href="#SEC16">PCRE2GREP BUFFER SIZE</a>
+<li><a name="TOC17" href="#SEC17">PCRE2TEST OPTION FOR LIBREADLINE SUPPORT</a>
+<li><a name="TOC18" href="#SEC18">INCLUDING DEBUGGING CODE</a>
+<li><a name="TOC19" href="#SEC19">DEBUGGING WITH VALGRIND SUPPORT</a>
+<li><a name="TOC20" href="#SEC20">CODE COVERAGE REPORTING</a>
+<li><a name="TOC21" href="#SEC21">SEE ALSO</a>
+<li><a name="TOC22" href="#SEC22">AUTHOR</a>
+<li><a name="TOC23" href="#SEC23">REVISION</a>
 </ul>
 <br><a name="SEC1" href="#TOC1">BUILDING PCRE2</a><br>
 <P>
@@ -148,13 +149,19 @@ properties. The application can request that they do by setting the PCRE2_UCP
 option. Unless the application has set PCRE2_NEVER_UCP, a pattern may also
 request this by starting with (*UCP).
 </P>
+<br><a name="SEC6" href="#TOC1">DISABLING THE USE OF \C</a><br>
 <P>
 The \C escape sequence, which matches a single code unit, even in a UTF mode,
 can cause unpredictable behaviour because it may leave the current matching
-point in the middle of a multi-code-unit character. It can be locked out by
-setting the PCRE2_NEVER_BACKSLASH_C option.
+point in the middle of a multi-code-unit character. The application can lock it
+out by setting the PCRE2_NEVER_BACKSLASH_C option when calling
+<b>pcre2_compile()</b>. There is also a build-time option
+<pre>
+  --enable-never-backslash-C
+</pre>
+(note the upper case C) which locks out the use of \C entirely.
 </P>
-<br><a name="SEC6" href="#TOC1">JUST-IN-TIME COMPILER SUPPORT</a><br>
+<br><a name="SEC7" href="#TOC1">JUST-IN-TIME COMPILER SUPPORT</a><br>
 <P>
 Just-in-time compiler support is included in the build by specifying
 <pre>
@@ -171,7 +178,7 @@ pcre2grep automatically makes use of it, unless you add
 </pre>
 to the "configure" command.
 </P>
-<br><a name="SEC7" href="#TOC1">NEWLINE RECOGNITION</a><br>
+<br><a name="SEC8" href="#TOC1">NEWLINE RECOGNITION</a><br>
 <P>
 By default, PCRE2 interprets the linefeed (LF) character as indicating the end
 of a line. This is the normal newline character on Unix-like systems. You can
@@ -208,7 +215,7 @@ Whatever default line ending convention is selected when PCRE2 is built can be
 overridden by applications that use the library. At build time it is
 conventional to use the standard for your operating system.
 </P>
-<br><a name="SEC8" href="#TOC1">WHAT \R MATCHES</a><br>
+<br><a name="SEC9" href="#TOC1">WHAT \R MATCHES</a><br>
 <P>
 By default, the sequence \R in a pattern matches any Unicode newline sequence,
 independently of what has been selected as the line ending sequence. If you
@@ -220,7 +227,7 @@ the default is changed so that \R matches only CR, LF, or CRLF. Whatever is
 selected when PCRE2 is built can be overridden by applications that use the
 called.
 </P>
-<br><a name="SEC9" href="#TOC1">HANDLING VERY LARGE PATTERNS</a><br>
+<br><a name="SEC10" href="#TOC1">HANDLING VERY LARGE PATTERNS</a><br>
 <P>
 Within a compiled pattern, offset values are used to point from one part to
 another (for example, from an opening parenthesis to an alternation
@@ -239,7 +246,7 @@ longer offsets slows down the operation of PCRE2 because it has to load
 additional data when handling them. For the 32-bit library the value is always
 4 and cannot be overridden; the value of --with-link-size is ignored.
 </P>
-<br><a name="SEC10" href="#TOC1">AVOIDING EXCESSIVE STACK USAGE</a><br>
+<br><a name="SEC11" href="#TOC1">AVOIDING EXCESSIVE STACK USAGE</a><br>
 <P>
 When matching with the <b>pcre2_match()</b> function, PCRE2 implements
 backtracking by making recursive calls to an internal function called
@@ -261,7 +268,7 @@ custom memory management functions can be called instead. PCRE2 runs noticeably
 more slowly when built in this way. This option affects only the
 <b>pcre2_match()</b> function; it is not relevant for <b>pcre2_dfa_match()</b>.
 </P>
-<br><a name="SEC11" href="#TOC1">LIMITING PCRE2 RESOURCE USAGE</a><br>
+<br><a name="SEC12" href="#TOC1">LIMITING PCRE2 RESOURCE USAGE</a><br>
 <P>
 Internally, PCRE2 has a function called <b>match()</b>, which it calls
 repeatedly (sometimes recursively) when matching a pattern with the
@@ -290,7 +297,7 @@ constraints. However, you can set a lower limit by adding, for example,
 </pre>
 to the <b>configure</b> command. This value can also be overridden at run time.
 </P>
-<br><a name="SEC12" href="#TOC1">CREATING CHARACTER TABLES AT BUILD TIME</a><br>
+<br><a name="SEC13" href="#TOC1">CREATING CHARACTER TABLES AT BUILD TIME</a><br>
 <P>
 PCRE2 uses fixed tables for processing characters whose code points are less
 than 256. By default, PCRE2 is built with a set of tables that are distributed
@@ -307,7 +314,7 @@ compiling, because <b>dftables</b> is run on the local host. If you need to
 create alternative tables when cross compiling, you will have to do so "by
 hand".)
 </P>
-<br><a name="SEC13" href="#TOC1">USING EBCDIC CODE</a><br>
+<br><a name="SEC14" href="#TOC1">USING EBCDIC CODE</a><br>
 <P>
 PCRE2 assumes by default that it will run in an environment where the character
 code is ASCII or Unicode, which is a superset of ASCII. This is the case for
@@ -342,7 +349,7 @@ The options that select newline behaviour, such as --enable-newline-is-cr,
 and equivalent run-time options, refer to these character values in an EBCDIC
 environment.
 </P>
-<br><a name="SEC14" href="#TOC1">PCRE2GREP OPTIONS FOR COMPRESSED FILE SUPPORT</a><br>
+<br><a name="SEC15" href="#TOC1">PCRE2GREP OPTIONS FOR COMPRESSED FILE SUPPORT</a><br>
 <P>
 By default, <b>pcre2grep</b> reads all files as plain text. You can build it so
 that it recognizes files whose names end in <b>.gz</b> or <b>.bz2</b>, and reads
@@ -355,7 +362,7 @@ to the <b>configure</b> command. These options naturally require that the
 relevant libraries are installed on your system. Configuration will fail if
 they are not.
 </P>
-<br><a name="SEC15" href="#TOC1">PCRE2GREP BUFFER SIZE</a><br>
+<br><a name="SEC16" href="#TOC1">PCRE2GREP BUFFER SIZE</a><br>
 <P>
 <b>pcre2grep</b> uses an internal buffer to hold a "window" on the file it is
 scanning, in order to be able to output "before" and "after" lines when it
@@ -370,7 +377,7 @@ parameter value by adding, for example,
 to the <b>configure</b> command. The caller of \fPpcre2grep\fP can override this
 value by using --buffer-size on the command line..
 </P>
-<br><a name="SEC16" href="#TOC1">PCRE2TEST OPTION FOR LIBREADLINE SUPPORT</a><br>
+<br><a name="SEC17" href="#TOC1">PCRE2TEST OPTION FOR LIBREADLINE SUPPORT</a><br>
 <P>
 If you add one of
 <pre>
@@ -404,7 +411,7 @@ automatically included, you may need to add something like
 </pre>
 immediately before the <b>configure</b> command.
 </P>
-<br><a name="SEC17" href="#TOC1">INCLUDING DEBUGGING CODE</a><br>
+<br><a name="SEC18" href="#TOC1">INCLUDING DEBUGGING CODE</a><br>
 <P>
 If you add
 <pre>
@@ -413,7 +420,7 @@ If you add
 to the <b>configure</b> command, additional debugging code is included in the
 build. This feature is intended for use by the PCRE2 maintainers.
 </P>
-<br><a name="SEC18" href="#TOC1">DEBUGGING WITH VALGRIND SUPPORT</a><br>
+<br><a name="SEC19" href="#TOC1">DEBUGGING WITH VALGRIND SUPPORT</a><br>
 <P>
 If you add
 <pre>
@@ -423,7 +430,7 @@ to the <b>configure</b> command, PCRE2 will use valgrind annotations to mark
 certain memory regions as unaddressable. This allows it to detect invalid
 memory accesses, and is mostly useful for debugging PCRE2 itself.
 </P>
-<br><a name="SEC19" href="#TOC1">CODE COVERAGE REPORTING</a><br>
+<br><a name="SEC20" href="#TOC1">CODE COVERAGE REPORTING</a><br>
 <P>
 If your C compiler is gcc, you can build a version of PCRE2 that can generate a
 code coverage report for its test suite. To enable this, you must install
@@ -480,11 +487,11 @@ This cleans all coverage data including the generated coverage report. For more
 information about code coverage, see the <b>gcov</b> and <b>lcov</b>
 documentation.
 </P>
-<br><a name="SEC20" href="#TOC1">SEE ALSO</a><br>
+<br><a name="SEC21" href="#TOC1">SEE ALSO</a><br>
 <P>
 <b>pcre2api</b>(3), <b>pcre2-config</b>(3).
 </P>
-<br><a name="SEC21" href="#TOC1">AUTHOR</a><br>
+<br><a name="SEC22" href="#TOC1">AUTHOR</a><br>
 <P>
 Philip Hazel
 <br>
@@ -493,9 +500,9 @@ University Computing Service
 Cambridge, England.
 <br>
 </P>
-<br><a name="SEC22" href="#TOC1">REVISION</a><br>
+<br><a name="SEC23" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 24 April 2015
+Last updated: 16 October 2015
 <br>
 Copyright &copy; 1997-2015 University of Cambridge.
 <br>
index 9e320734025b28b7f4db75ce72231ef4796762bb..48ee122d227bbdc1709c54a4663660b451e03dc3 100644 (file)
@@ -86,6 +86,13 @@ results. The returned value from <b>pcre2_jit_compile()</b> is zero on success,
 or a negative error code.
 </P>
 <P>
+There is a limit to the size of pattern that JIT supports, imposed by the size
+of machine stack that it uses. The exact rules are not documented because they
+may change at any time, in particular, when new optimizations are introduced.
+If a pattern is too big, a call to \fBpcre2_jit_compile()\fB returns
+PCRE2_ERROR_NOMEMORY.
+</P>
+<P>
 PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for complete
 matches. If you want to run partial matches using the PCRE2_PARTIAL_HARD or
 PCRE2_PARTIAL_SOFT options of <b>pcre2_match()</b>, you should set one or both
@@ -224,8 +231,14 @@ whether a match operation was executed by JIT or by the interpreter.
 </P>
 <P>
 You may safely use the same JIT stack for more than one pattern (either by
-assigning directly or by callback), as long as the patterns are all matched
-sequentially in the same thread. In a multithread application, if you do not
+assigning directly or by callback), as long as the patterns are matched
+sequentially in the same thread. Currently, the only way to set up
+non-sequential matches in one thread is to use callouts: if a callout function
+starts another match, that match must use a different JIT stack to the one used
+for currently suspended match(es).
+</P>
+<P>
+In a multithread application, if you do not
 specify a JIT stack, or if you assign or pass back NULL from a callback, that
 is thread-safe, because each thread has its own machine stack. However, if you
 assign or pass back a non-NULL JIT stack, this must be a different stack for
@@ -419,9 +432,9 @@ Cambridge, England.
 </P>
 <br><a name="SEC13" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 27 November 2014
+Last updated: 14 November 2015
 <br>
-Copyright &copy; 1997-2014 University of Cambridge.
+Copyright &copy; 1997-2015 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index b1c06f55ff01d27cd23a372d48461f7efbc70f6d..e227a300349a7ff0483b0c7c35ab04961fddce5c 100644 (file)
@@ -32,6 +32,11 @@ However, the speed of execution is slower. In the 32-bit library, the internal
 linkage size is always 4.
 </P>
 <P>
+The maximum length of a source pattern string is essentially unlimited; it is
+the largest number a PCRE2_SIZE variable can hold. However, the program that
+calls <b>pcre2_compile()</b> can specify a smaller limit.
+</P>
+<P>
 The maximum length (in code units) of a subject string is one less than the
 largest number a PCRE2_SIZE variable can hold. PCRE2_SIZE is an unsigned
 integer type, usually defined as size_t. Its maximum value (that is
@@ -50,6 +55,9 @@ documentation.
 All values in repeating quantifiers must be less than 65536.
 </P>
 <P>
+The maximum length of a lookbehind assertion is 65535 characters.
+</P>
+<P>
 There is no limit to the number of parenthesized subpatterns, but there can be
 no more than 65535 capturing subpatterns. There is, however, a limit to the
 depth of nesting of parenthesized subpatterns of all kinds. This is imposed in
@@ -85,9 +93,9 @@ Cambridge, England.
 REVISION
 </b><br>
 <P>
-Last updated: 25 November 2014
+Last updated: 05 November 2015
 <br>
-Copyright &copy; 1997-2014 University of Cambridge.
+Copyright &copy; 1997-2015 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index a9ca60e62cbf5ebc8acb3b45cb005c4f96561435..c88e931368d8d4b13ebf469ae07a6f4d25409919 100644 (file)
@@ -669,8 +669,8 @@ This is an example of an "atomic group", details of which are given
 This particular group matches either the two-character sequence CR followed by
 LF, or one of the single characters LF (linefeed, U+000A), VT (vertical tab,
 U+000B), FF (form feed, U+000C), CR (carriage return, U+000D), or NEL (next
-line, U+0085). The two-character sequence is treated as a single unit that
-cannot be split.
+line, U+0085). Because this is an atomic group, the two-character sequence is
+treated as a single unit that cannot be split.
 </P>
 <P>
 In other modes, two additional characters whose codepoints are greater than 255
@@ -736,6 +736,8 @@ Those that are not part of an identified script are lumped together as
 "Common". The current list of scripts is:
 </P>
 <P>
+Ahom,
+Anatolian_Hieroglyphs,
 Arabic,
 Armenian,
 Avestan,
@@ -776,6 +778,7 @@ Gurmukhi,
 Han,
 Hangul,
 Hanunoo,
+Hatran,
 Hebrew,
 Hiragana,
 Imperial_Aramaic,
@@ -812,12 +815,14 @@ Miao,
 Modi,
 Mongolian,
 Mro,
+Multani,
 Myanmar,
 Nabataean,
 New_Tai_Lue,
 Nko,
 Ogham,
 Ol_Chiki,
+Old_Hungarian,
 Old_Italic,
 Old_North_Arabian,
 Old_Permic,
@@ -839,6 +844,7 @@ Saurashtra,
 Sharada,
 Shavian,
 Siddham,
+SignWriting,
 Sinhala,
 Sora_Sompeng,
 Sundanese,
@@ -1180,6 +1186,16 @@ when the <i>startoffset</i> argument of <b>pcre2_match()</b> is non-zero. The
 PCRE2_DOLLAR_ENDONLY option is ignored if PCRE2_MULTILINE is set.
 </P>
 <P>
+When the newline convention (see
+<a href="#newlines">"Newline conventions"</a>
+below) recognizes the two-character sequence CRLF as a newline, this is
+preferred, even if the single characters CR and LF are also recognized as
+newlines. For example, if the newline convention is "any", a multiline mode
+circumflex matches before "xyz" in the string "abc\r\nxyz" rather than after
+CR, even though CR on its own is a valid newline. (It also matches at the very
+start of the string, of course.)
+</P>
+<P>
 Note that the sequences \A, \Z, and \z can be used to match the start and
 end of the subject in both modes, and if all branches of a pattern start with
 \A it is always anchored, whether or not PCRE2_MULTILINE is set.
@@ -1230,14 +1246,21 @@ with \C in UTF-8 or UTF-16 mode means that the rest of the string may start
 with a malformed UTF character. This has undefined results, because PCRE2
 assumes that it is matching character by character in a valid UTF string (by
 default it checks the subject string's validity at the start of processing
-unless the PCRE2_NO_UTF_CHECK option is used). An application can lock out the
-use of \C by setting the PCRE2_NEVER_BACKSLASH_C option.
+unless the PCRE2_NO_UTF_CHECK option is used).
+</P>
+<P>
+An application can lock out the use of \C by setting the
+PCRE2_NEVER_BACKSLASH_C option when compiling a pattern. It is also possible to
+build PCRE2 with the use of \C permanently disabled.
 </P>
 <P>
 PCRE2 does not allow \C to appear in lookbehind assertions
 <a href="#lookbehind">(described below)</a>
 in a UTF mode, because this would make it impossible to calculate the length of
-the lookbehind.
+the lookbehind. Neither the alternative matching function
+<b>pcre2_dfa_match()</b> not the JIT optimizer support \C in a UTF mode. The
+former gives a match-time error; the latter fails to optimize and so the match
+is always run using the interpreter.
 </P>
 <P>
 In general, the \C escape sequence is best avoided. However, one way of using
@@ -1322,9 +1345,19 @@ where a range ending character is expected. For example, [z-\xff] is valid,
 but [A-\d] and [A-[:digit:]] are not.
 </P>
 <P>
-Ranges operate in the collating sequence of character values. They can also be
-used for characters specified numerically, for example [\000-\037]. Ranges
-can include any characters that are valid for the current mode.
+Ranges normally include all code points between the start and end characters,
+inclusive. They can also be used for code points specified numerically, for
+example [\000-\037]. Ranges can include any characters that are valid for the
+current mode.
+</P>
+<P>
+There is a special case in EBCDIC environments for ranges whose end points are
+both specified as literal letters in the same case. For compatibility with
+Perl, EBCDIC code points within the range that are not letters are omitted. For
+example, [h-k] matches only four characters, even though the codes for h and k
+are 0x88 and 0x92, a range of 11 code points. However, if the range is
+specified numerically, for example, [\x88-\x92] or [h-\x92], all code points
+are included.
 </P>
 <P>
 If a range that includes letters is used when caseless matching is set, it
@@ -1649,6 +1682,10 @@ first one in the pattern with the given number. The following pattern matches
 <pre>
   /(?|(abc)|(def))(?1)/
 </pre>
+A relative reference such as (?-1) is no different: it is just a convenient way
+of computing an absolute group number.
+</P>
+<P>
 If a
 <a href="#conditions">condition test</a>
 for a subpattern's having matched refers to a non-unique number, the test is
@@ -2489,7 +2526,8 @@ For example:
   (?(VERSION&#62;=10.4)yes|no)
 </pre>
 This pattern matches "yes" if the PCRE2 version is greater or equal to 10.4, or
-"no" otherwise.
+"no" otherwise. The fractional part of the version number may not contain more
+than two digits.
 </P>
 <br><b>
 Assertion conditions
@@ -2602,6 +2640,21 @@ parentheses preceding the recursion. In other words, a negative number counts
 capturing parentheses leftwards from the point at which it is encountered.
 </P>
 <P>
+Be aware however, that if
+<a href="#dupsubpatternnumber">duplicate subpattern numbers</a>
+are in use, relative references refer to the earliest subpattern with the
+appropriate number. Consider, for example:
+<pre>
+  (?|(a)|(b)) (c) (?-2)
+</pre>
+The first two capturing groups (a) and (b) are both numbered 1, and group (c)
+is number 2. When the reference (?-2) is encountered, the second most recently
+opened parentheses has the number 1, but it is the first such group (the (a)
+group) to which the recursion refers. This would be the same if an absolute
+reference (?1) was used. In other words, relative references are just a
+shorthand for computing a group number.
+</P>
+<P>
 It is also possible to refer to subsequently opened parentheses, by writing
 references such as (?+2). However, these cannot be recursive because the
 reference is not inside the parentheses that are referenced. They are always
@@ -2899,14 +2952,26 @@ remarks apply to the PCRE2 features described in this section.
 </P>
 <P>
 The new verbs make use of what was previously invalid syntax: an opening
-parenthesis followed by an asterisk. They are generally of the form
-(*VERB) or (*VERB:NAME). Some may take either form, possibly behaving
-differently depending on whether or not a name is present. A name is any
-sequence of characters that does not include a closing parenthesis. The maximum
-length of name is 255 in the 8-bit library and 65535 in the 16-bit and 32-bit
-libraries. If the name is empty, that is, if the closing parenthesis
-immediately follows the colon, the effect is as if the colon were not there.
-Any number of these verbs may occur in a pattern.
+parenthesis followed by an asterisk. They are generally of the form (*VERB) or
+(*VERB:NAME). Some verbs take either form, possibly behaving differently
+depending on whether or not a name is present.
+</P>
+<P>
+By default, for compatibility with Perl, a name is any sequence of characters
+that does not include a closing parenthesis. The name is not processed in
+any way, and it is not possible to include a closing parenthesis in the name.
+However, if the PCRE2_ALT_VERBNAMES option is set, normal backslash processing
+is applied to verb names and only an unescaped closing parenthesis terminates
+the name. A closing parenthesis can be included in a name either as \) or
+between \Q and \E. If the PCRE2_EXTENDED option is set, unescaped whitespace
+in verb names is skipped and #-comments are recognized, exactly as in the rest
+of the pattern.
+</P>
+<P>
+The maximum length of a name is 255 in the 8-bit library and 65535 in the
+16-bit and 32-bit libraries. If the name is empty, that is, if the closing
+parenthesis immediately follows the colon, the effect is as if the colon were
+not there. Any number of these verbs may occur in a pattern.
 </P>
 <P>
 Since these verbs are specifically related to backtracking, most of them can be
@@ -3323,7 +3388,7 @@ Cambridge, England.
 </P>
 <br><a name="SEC30" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 13 June 2015
+Last updated: 13 November 2015
 <br>
 Copyright &copy; 1997-2015 University of Cambridge.
 <br>
index 3b6a4a6c83c534e2a5fdc4594172b7e65205b8da..ac9d23cd85345fcd4519028bcebc009df07ab8b9 100644 (file)
@@ -12,17 +12,21 @@ This page is part of the PCRE2 HTML documentation. It was generated
 automatically from the original man page. If there is any nonsense in it,
 please consult the man page, in case the conversion went wrong.
 <br>
-<br><b>
-PCRE2 PERFORMANCE
-</b><br>
+<ul>
+<li><a name="TOC1" href="#SEC1">PCRE2 PERFORMANCE</a>
+<li><a name="TOC2" href="#SEC2">COMPILED PATTERN MEMORY USAGE</a>
+<li><a name="TOC3" href="#SEC3">STACK USAGE AT RUN TIME</a>
+<li><a name="TOC4" href="#SEC4">PROCESSING TIME</a>
+<li><a name="TOC5" href="#SEC5">AUTHOR</a>
+<li><a name="TOC6" href="#SEC6">REVISION</a>
+</ul>
+<br><a name="SEC1" href="#TOC1">PCRE2 PERFORMANCE</a><br>
 <P>
 Two aspects of performance are discussed below: memory usage and processing
 time. The way you express your pattern as a regular expression can affect both
 of them.
 </P>
-<br><b>
-COMPILED PATTERN MEMORY USAGE
-</b><br>
+<br><a name="SEC2" href="#TOC1">COMPILED PATTERN MEMORY USAGE</a><br>
 <P>
 Patterns are compiled by PCRE2 into a reasonably efficient interpretive code,
 so that most simple patterns do not use much memory. However, there is one case
@@ -75,9 +79,7 @@ pattern. Nevertheless, if the atomic grouping is not a problem and the loss of
 speed is acceptable, this kind of rewriting will allow you to process patterns
 that PCRE2 cannot otherwise handle.
 </P>
-<br><b>
-STACK USAGE AT RUN TIME
-</b><br>
+<br><a name="SEC3" href="#TOC1">STACK USAGE AT RUN TIME</a><br>
 <P>
 When <b>pcre2_match()</b> is used for matching, certain kinds of pattern can
 cause it to use large amounts of the process stack. In some environments the
@@ -86,9 +88,7 @@ SIGSEGV. Rewriting your pattern can often help. The
 <a href="pcre2stack.html"><b>pcre2stack</b></a>
 documentation discusses this issue in detail.
 </P>
-<br><b>
-PROCESSING TIME
-</b><br>
+<br><a name="SEC4" href="#TOC1">PROCESSING TIME</a><br>
 <P>
 Certain items in regular expression patterns are processed more efficiently
 than others. It is more efficient to use a character class like [aeiou] than a
@@ -177,9 +177,7 @@ appreciable time with strings longer than about 20 characters.
 In many cases, the solution to this kind of performance issue is to use an
 atomic group or a possessive quantifier.
 </P>
-<br><b>
-AUTHOR
-</b><br>
+<br><a name="SEC5" href="#TOC1">AUTHOR</a><br>
 <P>
 Philip Hazel
 <br>
@@ -188,9 +186,7 @@ University Computing Service
 Cambridge, England.
 <br>
 </P>
-<br><b>
-REVISION
-</b><br>
+<br><a name="SEC6" href="#TOC1">REVISION</a><br>
 <P>
 Last updated: 02 January 2015
 <br>
index 5e4b5a3b46f111d3ba59868c2fe647ee4342805e..e16a4c37461d7e88c7cc15db55b9cce77815ea20 100644 (file)
@@ -170,7 +170,7 @@ use the contents of the <i>preg</i> structure. If, for example, you pass it to
 This area is not simple, because POSIX and Perl take different views of things.
 It is not possible to get PCRE2 to obey POSIX semantics, but then PCRE2 was
 never intended to be a POSIX engine. The following table lists the different
-possibilities for matching newline characters in PCRE2:
+possibilities for matching newline characters in Perl and PCRE2:
 <pre>
                           Default   Change with
 
@@ -180,7 +180,7 @@ possibilities for matching newline characters in PCRE2:
   $ matches \n in middle     no     PCRE2_MULTILINE
   ^ matches \n in middle     no     PCRE2_MULTILINE
 </pre>
-This is the equivalent table for POSIX:
+This is the equivalent table for a POSIX-compatible pattern matcher:
 <pre>
                           Default   Change with
 
@@ -190,14 +190,18 @@ This is the equivalent table for POSIX:
   $ matches \n in middle     no     REG_NEWLINE
   ^ matches \n in middle     no     REG_NEWLINE
 </pre>
-PCRE2's behaviour is the same as Perl's, except that there is no equivalent for
-PCRE2_DOLLAR_ENDONLY in Perl. In both PCRE2 and Perl, there is no way to stop
-newline from matching [^a].
+This behaviour is not what happens when PCRE2 is called via its POSIX
+API. By default, PCRE2's behaviour is the same as Perl's, except that there is
+no equivalent for PCRE2_DOLLAR_ENDONLY in Perl. In both PCRE2 and Perl, there
+is no way to stop newline from matching [^a].
 </P>
 <P>
-The default POSIX newline handling can be obtained by setting PCRE2_DOTALL and
-PCRE2_DOLLAR_ENDONLY, but there is no way to make PCRE2 behave exactly as for
-the REG_NEWLINE action.
+Default POSIX newline handling can be obtained by setting PCRE2_DOTALL and
+PCRE2_DOLLAR_ENDONLY when calling <b>pcre2_compile()</b> directly, but there is
+no way to make PCRE2 behave exactly as for the REG_NEWLINE action. When using
+the POSIX API, passing REG_NEWLINE to PCRE2's <b>regcomp()</b> function
+causes PCRE2_MULTILINE to be passed to <b>pcre2_compile()</b>, and REG_DOTALL
+passes PCRE2_DOTALL. There is no way to pass PCRE2_DOLLAR_ENDONLY.
 </P>
 <br><a name="SEC5" href="#TOC1">MATCHING A PATTERN</a><br>
 <P>
@@ -231,7 +235,8 @@ to have a terminating NUL located at <i>string</i> + <i>pmatch[0].rm_eo</i>
 IEEE Standard 1003.2 (POSIX.2), and should be used with caution in software
 intended to be portable to other systems. Note that a non-zero <i>rm_so</i> does
 not imply REG_NOTBOL; REG_STARTEND affects only the location of the string, not
-how it is matched.
+how it is matched. Setting REG_STARTEND and passing <i>pmatch</i> as NULL are
+mutually exclusive; the error REG_INVARG is returned.
 </P>
 <P>
 If the pattern was compiled with the REG_NOSUB flag, no data about any matched
@@ -262,9 +267,11 @@ header file, of which REG_NOMATCH is the "expected" failure code.
 The <b>regerror()</b> function maps a non-zero errorcode from either
 <b>regcomp()</b> or <b>regexec()</b> to a printable message. If <i>preg</i> is not
 NULL, the error should have arisen from the use of that structure. A message
-terminated by a binary zero is placed in <i>errbuf</i>. The length of the
-message, including the zero, is limited to <i>errbuf_size</i>. The yield of the
-function is the size of buffer needed to hold the whole message.
+terminated by a binary zero is placed in <i>errbuf</i>. If the buffer is too
+short, only the first <i>errbuf_size</i> - 1 characters of the error message are
+used. The yield of the function is the size of buffer needed to hold the whole
+message, including the terminating zero. This value is greater than
+<i>errbuf_size</i> if the message was truncated.
 </P>
 <br><a name="SEC7" href="#TOC1">MEMORY USAGE</a><br>
 <P>
@@ -283,9 +290,9 @@ Cambridge, England.
 </P>
 <br><a name="SEC9" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 20 October 2014
+Last updated: 29 November 2015
 <br>
-Copyright &copy; 1997-2014 University of Cambridge.
+Copyright &copy; 1997-2015 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index c32ebe034a063983d351e8437fe3a51b124c163e..3747c0a90bd1ba069c5efd3f1997aabb2ec166cf 100644 (file)
@@ -41,12 +41,12 @@ If you are running an application that uses a large number of regular
 expression patterns, it may be useful to store them in a precompiled form
 instead of having to compile them every time the application is run. However,
 if you are using the just-in-time optimization feature, it is not possible to
-save and reload the JIT data, because it is position-dependent. In addition,
-the host on which the patterns are reloaded must be running the same version of
-PCRE2, with the same code unit width, and must also have the same endianness,
-pointer width and PCRE2_SIZE type. For example, patterns compiled on a 32-bit
-system using PCRE2's 16-bit library cannot be reloaded on a 64-bit system, nor
-can they be reloaded using the 8-bit library.
+save and reload the JIT data, because it is position-dependent. The host on
+which the patterns are reloaded must be running the same version of PCRE2, with
+the same code unit width, and must also have the same endianness, pointer width
+and PCRE2_SIZE type. For example, patterns compiled on a 32-bit system using
+PCRE2's 16-bit library cannot be reloaded on a 64-bit system, nor can they be
+reloaded using the 8-bit library.
 </P>
 <br><a name="SEC2" href="#TOC1">SAVING COMPILED PATTERNS</a><br>
 <P>
@@ -153,10 +153,15 @@ on a system with different endianness.
 </P>
 <P>
 Decoded patterns can be used for matching in the usual way, and must be freed
-by calling <b>pcre2_code_free()</b> as normal. A single copy of the character
-tables is used by all the decoded patterns. A reference count is used to
+by calling <b>pcre2_code_free()</b>. However, be aware that there is a potential
+race issue if you are using multiple patterns that were decoded from a single
+byte stream in a multithreaded application. A single copy of the character
+tables is used by all the decoded patterns and a reference count is used to
 arrange for its memory to be automatically freed when the last pattern is
-freed.
+freed, but there is no locking on this reference count. Therefore, if you want
+to call <b>pcre2_code_free()</b> for these patterns in different threads, you
+must arrange your own locking, and ensure that <b>pcre2_code_free()</b> cannot
+be called by two threads at the same time.
 </P>
 <P>
 If a pattern was processed by <b>pcre2_jit_compile()</b> before being
@@ -175,7 +180,7 @@ Cambridge, England.
 </P>
 <br><a name="SEC5" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 20 January 2015
+Last updated: 03 November 2015
 <br>
 Copyright &copy; 1997-2015 University of Cambridge.
 <br>
index 28ba0236201b768b68e606f75d315f5998c46d70..7fdc0dc4bbda2065fa51eea519c6971f77483d5b 100644 (file)
@@ -111,9 +111,10 @@ it matches a literal "u".
   \W         a "non-word" character
   \X         a Unicode extended grapheme cluster
 </pre>
-The application can lock out the use of \C by setting the
-PCRE2_NEVER_BACKSLASH_C option. It is dangerous because it may leave the
-current matching point in the middle of a UTF-8 or UTF-16 character.
+\C is dangerous because it may leave the current matching point in the middle
+of a UTF-8 or UTF-16 character. The application can lock out the use of \C by
+setting the PCRE2_NEVER_BACKSLASH_C option. It is also possible to build PCRE2
+with the use of \C permanently disabled.
 </P>
 <P>
 By default, \d, \s, and \w match only ASCII characters, even in UTF-8 mode
@@ -187,6 +188,8 @@ at release 5.18.
 </P>
 <br><a name="SEC7" href="#TOC1">SCRIPT NAMES FOR \p AND \P</a><br>
 <P>
+Ahom,
+Anatolian_Hieroglyphs,
 Arabic,
 Armenian,
 Avestan,
@@ -227,6 +230,7 @@ Gurmukhi,
 Han,
 Hangul,
 Hanunoo,
+Hatran,
 Hebrew,
 Hiragana,
 Imperial_Aramaic,
@@ -263,12 +267,14 @@ Miao,
 Modi,
 Mongolian,
 Mro,
+Multani,
 Myanmar,
 Nabataean,
 New_Tai_Lue,
 Nko,
 Ogham,
 Ol_Chiki,
+Old_Hungarian,
 Old_Italic,
 Old_North_Arabian,
 Old_Permic,
@@ -290,6 +296,7 @@ Saurashtra,
 Sharada,
 Shavian,
 Siddham,
+SignWriting,
 Sinhala,
 Sora_Sompeng,
 Sundanese,
@@ -582,7 +589,7 @@ Cambridge, England.
 </P>
 <br><a name="SEC27" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 13 June 2015
+Last updated: 16 October 2015
 <br>
 Copyright &copy; 1997-2015 University of Cambridge.
 <br>
index 5165c1e54f315dc1c209ba2652832d9f3c4f49bf..537985deb13995a84cedcbd2aaa3b8bc67d61da2 100644 (file)
@@ -155,12 +155,13 @@ following options output the value and set the exit code as indicated:
 The following options output 1 for true or 0 for false, and set the exit code
 to the same value:
 <pre>
-  ebcdic     compiled for an EBCDIC environment
-  jit        just-in-time support is available
-  pcre2-16   the 16-bit library was built
-  pcre2-32   the 32-bit library was built
-  pcre2-8    the 8-bit library was built
-  unicode    Unicode support is available
+  backslash-C  \C is supported (not locked out)
+  ebcdic       compiled for an EBCDIC environment
+  jit          just-in-time support is available
+  pcre2-16     the 16-bit library was built
+  pcre2-32     the 32-bit library was built
+  pcre2-8      the 8-bit library was built
+  unicode      Unicode support is available
 </pre>
 If an unknown option is given, an error message is output; the exit code is 0.
 </P>
@@ -265,9 +266,9 @@ Each subject line is matched separately and independently. If you want to do
 multi-line matches, you have to use the \n escape sequence (or \r or \r\n,
 etc., depending on the newline setting) in a single line of input to encode the
 newline sequences. There is no limit on the length of subject lines; the input
-buffer is automatically extended if it is too small. There is a replication
-feature that makes it possible to generate long subject lines without having to
-supply them explicitly.
+buffer is automatically extended if it is too small. There are replication
+features that makes it possible to generate long repetitive pattern or subject
+lines without having to supply them explicitly.
 </P>
 <P>
 An empty line or the end of the file signals the end of the subject lines for a
@@ -304,6 +305,36 @@ output.
 This command is used to load a set of precompiled patterns from a file, as
 described in the section entitled "Saving and restoring compiled patterns"
 <a href="#saverestore">below.</a>
+<pre>
+  #newline_default [&#60;newline-list&#62;]
+</pre>
+When PCRE2 is built, a default newline convention can be specified. This
+determines which characters and/or character pairs are recognized as indicating
+a newline in a pattern or subject string. The default can be overridden when a
+pattern is compiled. The standard test files contain tests of various newline
+conventions, but the majority of the tests expect a single linefeed to be
+recognized as a newline by default. Without special action the tests would fail
+when PCRE2 is compiled with either CR or CRLF as the default newline.
+</P>
+<P>
+The #newline_default command specifies a list of newline types that are
+acceptable as the default. The types must be one of CR, LF, CRLF, ANYCRLF, or
+ANY (in upper or lower case), for example:
+<pre>
+  #newline_default LF Any anyCRLF
+</pre>
+If the default newline is in the list, this command has no effect. Otherwise,
+except when testing the POSIX API, a <b>newline</b> modifier that specifies the
+first newline convention in the list (LF in the above example) is added to any
+pattern that does not already have a <b>newline</b> modifier. If the newline
+list is empty, the feature is turned off. This command is present in a number
+of the standard test input files.
+</P>
+<P>
+When the POSIX API is being tested there is no way to override the default
+newline convention, though it is possible to set the newline convention from
+within the pattern. A warning is given if the <b>posix</b> modifier is used when
+<b>#newline_default</b> would set a default for the non-POSIX API.
 <pre>
   #pattern &#60;modifier-list&#62;
 </pre>
@@ -340,12 +371,13 @@ subject lines. Modifiers on a subject line can change these settings.
 <br><a name="SEC7" href="#TOC1">MODIFIER SYNTAX</a><br>
 <P>
 Modifier lists are used with both pattern and subject lines. Items in a list
-are separated by commas and optional white space. Some modifiers may be given
-for both patterns and subject lines, whereas others are valid for one or the
-other only. Each modifier has a long name, for example "anchored", and some of
-them must be followed by an equals sign and a value, for example, "offset=12".
-Modifiers that do not take values may be preceded by a minus sign to turn off a
-previous setting.
+are separated by commas followed by optional white space. Trailing whitespace
+in a modifier list is ignored. Some modifiers may be given for both patterns
+and subject lines, whereas others are valid only for one or the other. Each
+modifier has a long name, for example "anchored", and some of them must be
+followed by an equals sign and a value, for example, "offset=12". Values cannot
+contain comma characters, but may contain spaces. Modifiers that do not take
+values may be preceded by a minus sign to turn off a previous setting.
 </P>
 <P>
 A few of the more common modifiers can also be specified as single letters, for
@@ -454,6 +486,12 @@ the start of a modifier list. For example:
 <pre>
   abc\=notbol,notempty
 </pre>
+If the subject string is empty and \= is followed by whitespace, the line is
+treated as a comment line, and is not used for matching. For example:
+<pre>
+  \= This is a comment.
+  abc\= This is an invalid modifier list.
+</pre>
 A backslash followed by any other non-alphanumeric character just escapes that
 character. A backslash followed by anything else causes an error. However, if
 the very last character in the line is a backslash (and there is no modifier
@@ -462,10 +500,10 @@ a real empty line terminates the data input.
 </P>
 <br><a name="SEC10" href="#TOC1">PATTERN MODIFIERS</a><br>
 <P>
-There are three types of modifier that can appear in pattern lines, two of
-which may also be used in a <b>#pattern</b> command. A pattern's modifier list
-can add to or override default modifiers that were set by a previous
-<b>#pattern</b> command.
+There are several types of modifier that can appear in pattern lines. Except
+where noted below, they may also be used in <b>#pattern</b> commands. A
+pattern's modifier list can add to or override default modifiers that were set
+by a previous <b>#pattern</b> command.
 <a name="optionmodifiers"></a></P>
 <br><b>
 Setting compilation options
@@ -473,12 +511,13 @@ Setting compilation options
 <P>
 The following modifiers set options for <b>pcre2_compile()</b>. The most common
 ones have single-letter abbreviations. See
-<a href="pcreapi.html"><b>pcreapi</b></a>
+<a href="pcre2api.html"><b>pcre2api</b></a>
 for a description of their effects.
 <pre>
       allow_empty_class         set PCRE2_ALLOW_EMPTY_CLASS
       alt_bsux                  set PCRE2_ALT_BSUX
       alt_circumflex            set PCRE2_ALT_CIRCUMFLEX
+      alt_verbnames             set PCRE2_ALT_VERBNAMES
       anchored                  set PCRE2_ANCHORED
       auto_callout              set PCRE2_AUTO_CALLOUT
   /i  caseless                  set PCRE2_CASELESS
@@ -499,6 +538,7 @@ for a description of their effects.
       no_utf_check              set PCRE2_NO_UTF_CHECK
       ucp                       set PCRE2_UCP
       ungreedy                  set PCRE2_UNGREEDY
+      use_offset_limit          set PCRE2_USE_OFFSET_LIMIT
       utf                       set PCRE2_UTF
 </pre>
 As well as turning on the PCRE2_UTF option, the <b>utf</b> modifier causes all
@@ -524,8 +564,10 @@ about the pattern:
       jitfast                   use JIT fast path
       jitverify                 verify JIT use
       locale=&#60;name&#62;             use this locale
+      max_pattern_length=&#60;n&#62;    set the maximum pattern length
       memory                    show memory used
       newline=&#60;type&#62;            set newline type
+      null_context              compile with a NULL context
       parens_nest_limit=&#60;n&#62;     set maximum parentheses depth
       posix                     use the POSIX API
       push                      push compiled pattern onto the stack
@@ -604,6 +646,15 @@ is requested. For each callout, either its number or string is given, followed
 by the item that follows it in the pattern.
 </P>
 <br><b>
+Passing a NULL context
+</b><br>
+<P>
+Normally, <b>pcre2test</b> passes a context block to <b>pcre2_compile()</b>. If
+the <b>null_context</b> modifier is set, however, NULL is passed. This is for
+testing that <b>pcre2_compile()</b> behaves correctly in this case (it uses
+default values).
+</P>
+<br><b>
 Specifying a pattern in hex
 </b><br>
 <P>
@@ -620,24 +671,82 @@ PCRE2_ZERO_TERMINATED. However, for patterns specified in hexadecimal, the
 actual length of the pattern is passed.
 </P>
 <br><b>
+Generating long repetitive patterns
+</b><br>
+<P>
+Some tests use long patterns that are very repetitive. Instead of creating a
+very long input line for such a pattern, you can use a special repetition
+feature, similar to the one described for subject lines above. If the
+<b>expand</b> modifier is present on a pattern, parts of the pattern that have
+the form
+<pre>
+  \[&#60;characters&#62;]{&#60;count&#62;}
+</pre>
+are expanded before the pattern is passed to <b>pcre2_compile()</b>. For
+example, \[AB]{6000} is expanded to "ABAB..." 6000 times. This construction
+cannot be nested. An initial "\[" sequence is recognized only if "]{" followed
+by decimal digits and "}" is found later in the pattern. If not, the characters
+remain in the pattern unaltered.
+</P>
+<P>
+If part of an expanded pattern looks like an expansion, but is really part of
+the actual pattern, unwanted expansion can be avoided by giving two values in
+the quantifier. For example, \[AB]{6000,6000} is not recognized as an
+expansion item.
+</P>
+<P>
+If the <b>info</b> modifier is set on an expanded pattern, the result of the
+expansion is included in the information that is output.
+</P>
+<br><b>
 JIT compilation
 </b><br>
 <P>
-The <b>/jit</b> modifier may optionally be followed by an equals sign and a
-number in the range 0 to 7:
+Just-in-time (JIT) compiling is a heavyweight optimization that can greatly
+speed up pattern matching. See the
+<a href="pcre2jit.html"><b>pcre2jit</b></a>
+documentation for details. JIT compiling happens, optionally, after a pattern
+has been successfully compiled into an internal form. The JIT compiler converts
+this to optimized machine code. It needs to know whether the match-time options
+PCRE2_PARTIAL_HARD and PCRE2_PARTIAL_SOFT are going to be used, because
+different code is generated for the different cases. See the <b>partial</b>
+modifier in "Subject Modifiers"
+<a href="#subjectmodifiers">below</a>
+for details of how these options are specified for each match attempt.
+</P>
+<P>
+JIT compilation is requested by the <b>/jit</b> pattern modifier, which may
+optionally be followed by an equals sign and a number in the range 0 to 7.
+The three bits that make up the number specify which of the three JIT operating
+modes are to be compiled:
+<pre>
+  1  compile JIT code for non-partial matching
+  2  compile JIT code for soft partial matching
+  4  compile JIT code for hard partial matching
+</pre>
+The possible values for the <b>/jit</b> modifier are therefore:
 <pre>
   0  disable JIT
-  1  use JIT for normal match only
-  2  use JIT for soft partial match only
-  3  use JIT for normal match and soft partial match
-  4  use JIT for hard partial match only
-  6  use JIT for soft and hard partial match
+  1  normal matching only
+  2  soft partial matching only
+  3  normal and soft partial matching
+  4  hard partial matching only
+  6  soft and hard partial matching only
   7  all three modes
 </pre>
-If no number is given, 7 is assumed. If JIT compilation is successful, the
-compiled JIT code will automatically be used when <b>pcre2_match()</b> is run
-for the appropriate type of match, except when incompatible run-time options
-are specified. For more details, see the
+If no number is given, 7 is assumed. The phrase "partial matching" means a call
+to <b>pcre2_match()</b> with either the PCRE2_PARTIAL_SOFT or the
+PCRE2_PARTIAL_HARD option set. Note that such a call may return a complete
+match; the options enable the possibility of a partial match, but do not
+require it. Note also that if you request JIT compilation only for partial
+matching (for example, /jit=2) but do not set the <b>partial</b> modifier on a
+subject line, that match will not use JIT code because none was compiled for
+non-partial matching.
+</P>
+<P>
+If JIT compilation is successful, the compiled JIT code will automatically be
+used when an appropriate type of match is run, except when incompatible
+run-time options are specified. For more details, see the
 <a href="pcre2jit.html"><b>pcre2jit</b></a>
 documentation. See also the <b>jitstack</b> modifier below for a way of
 setting the size of the JIT stack.
@@ -700,13 +809,24 @@ sets its own default of 220, which is required for running the standard test
 suite.
 </P>
 <br><b>
+Limiting the pattern length
+</b><br>
+<P>
+The <b>max_pattern_length</b> modifier sets a limit, in code units, to the
+length of pattern that <b>pcre2_compile()</b> will accept. Breaching the limit
+causes a compilation error. The default is the largest number a PCRE2_SIZE
+variable can hold (essentially unlimited).
+</P>
+<br><b>
 Using the POSIX wrapper API
 </b><br>
 <P>
 The <b>/posix</b> modifier causes <b>pcre2test</b> to call PCRE2 via the POSIX
 wrapper API rather than its native API. This supports only the 8-bit library.
-When the POSIX API is being used, the following pattern modifiers set options
-for the <b>regcomp()</b> function:
+Note that it does not imply POSIX matching semantics; for more detail see the
+<a href="pcre2posix.html"><b>pcre2posix</b></a>
+documentation. When the POSIX API is being used, the following pattern
+modifiers set options for the <b>regcomp()</b> function:
 <pre>
   caseless           REG_ICASE
   multiline          REG_NEWLINE
@@ -716,6 +836,16 @@ for the <b>regcomp()</b> function:
   ucp                REG_UCP        )   the POSIX standard
   utf                REG_UTF8       )
 </pre>
+The <b>regerror_buffsize</b> modifier specifies a size for the error buffer that
+is passed to <b>regerror()</b> in the event of a compilation error. For example:
+<pre>
+  /abc/posix,regerror_buffsize=20
+</pre>
+This provides a means of testing the behaviour of <b>regerror()</b> when the
+buffer is too small for the error message. If this modifier has not been set, a
+large buffer is used.
+</P>
+<P>
 The <b>aftertext</b> and <b>allaftertext</b> subject modifiers work as described
 below. All other modifiers cause an error.
 </P>
@@ -758,17 +888,22 @@ Setting certain match controls
 <P>
 The following modifiers are really subject modifiers, and are described below.
 However, they may be included in a pattern's modifier list, in which case they
-are applied to every subject line that is processed with that pattern. They do
-not affect the compilation process.
+are applied to every subject line that is processed with that pattern. They may
+not appear in <b>#pattern</b> commands. These modifiers do not affect the
+compilation process.
 <pre>
-      aftertext           show text after match
-      allaftertext        show text after captures
-      allcaptures         show all captures
-      allusedtext         show all consulted text
-  /g  global              global matching
-      mark                show mark values
-      replace=&#60;string&#62;    specify a replacement string
-      startchar           show starting character when relevant
+      aftertext                  show text after match
+      allaftertext               show text after captures
+      allcaptures                show all captures
+      allusedtext                show all consulted text
+  /g  global                     global matching
+      mark                       show mark values
+      replace=&#60;string&#62;           specify a replacement string
+      startchar                  show starting character when relevant
+      substitute_extended        use PCRE2_SUBSTITUTE_EXTENDED
+      substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+      substitute_unknown_unset   use PCRE2_SUBSTITUTE_UNKNOWN_UNSET
+      substitute_unset_empty     use PCRE2_SUBSTITUTE_UNSET_EMPTY
 </pre>
 These modifiers may not appear in a <b>#pattern</b> command. If you want them as
 defaults, set them in a <b>#subject</b> command.
@@ -788,7 +923,7 @@ The <b>push</b> modifier is incompatible with compilation modifiers such as
 warning message, except for <b>replace</b>, which causes an error. Note that,
 <b>jitverify</b>, which is allowed, does not carry through to any subsequent
 matching that uses this pattern.
-</P>
+<a name="subjectmodifiers"></a></P>
 <br><a name="SEC11" href="#TOC1">SUBJECT MODIFIERS</a><br>
 <P>
 The modifiers that can appear in subject lines and the <b>#subject</b>
@@ -833,31 +968,38 @@ information. Some of them may also be specified on a pattern line (see above),
 in which case they apply to every subject line that is matched against that
 pattern.
 <pre>
-      aftertext                 show text after match
-      allaftertext              show text after captures
-      allcaptures               show all captures
-      allusedtext               show all consulted text (non-JIT only)
-      altglobal                 alternative global matching
-      callout_capture           show captures at callout time
-      callout_data=&#60;n&#62;          set a value to pass via callouts
-      callout_fail=&#60;n&#62;[:&#60;m&#62;]    control callout failure
-      callout_none              do not supply a callout function
-      copy=&#60;number or name&#62;     copy captured substring
-      dfa                       use <b>pcre2_dfa_match()</b>
-      find_limits               find match and recursion limits
-      get=&#60;number or name&#62;      extract captured substring
-      getall                    extract all captured substrings
-  /g  global                    global matching
-      jitstack=&#60;n&#62;              set size of JIT stack
-      mark                      show mark values
-      match_limit=&#62;n&#62;           set a match limit
-      memory                    show memory usage
-      offset=&#60;n&#62;                set starting offset
-      ovector=&#60;n&#62;               set size of output vector
-      recursion_limit=&#60;n&#62;       set a recursion limit
-      replace=&#60;string&#62;          specify a replacement string
-      startchar                 show startchar when relevant
-      zero_terminate            pass the subject as zero-terminated
+      aftertext                  show text after match
+      allaftertext               show text after captures
+      allcaptures                show all captures
+      allusedtext                show all consulted text (non-JIT only)
+      altglobal                  alternative global matching
+      callout_capture            show captures at callout time
+      callout_data=&#60;n&#62;           set a value to pass via callouts
+      callout_fail=&#60;n&#62;[:&#60;m&#62;]     control callout failure
+      callout_none               do not supply a callout function
+      copy=&#60;number or name&#62;      copy captured substring
+      dfa                        use <b>pcre2_dfa_match()</b>
+      find_limits                find match and recursion limits
+      get=&#60;number or name&#62;       extract captured substring
+      getall                     extract all captured substrings
+  /g  global                     global matching
+      jitstack=&#60;n&#62;               set size of JIT stack
+      mark                       show mark values
+      match_limit=&#60;n&#62;            set a match limit
+      memory                     show memory usage
+      null_context               match with a NULL context
+      offset=&#60;n&#62;                 set starting offset
+      offset_limit=&#60;n&#62;           set offset limit
+      ovector=&#60;n&#62;                set size of output vector
+      recursion_limit=&#60;n&#62;        set a recursion limit
+      replace=&#60;string&#62;           specify a replacement string
+      startchar                  show startchar when relevant
+      startoffset=&#60;n&#62;            same as offset=&#60;n&#62;
+      substitute_extedded        use PCRE2_SUBSTITUTE_EXTENDED
+      substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+      substitute_unknown_unset   use PCRE2_SUBSTITUTE_UNKNOWN_UNSET
+      substitute_unset_empty     use PCRE2_SUBSTITUTE_UNSET_EMPTY
+      zero_terminate             pass the subject as zero-terminated
 </pre>
 The effects of these modifiers are described in the following sections.
 </P>
@@ -996,19 +1138,34 @@ Testing the substitution function
 </b><br>
 <P>
 If the <b>replace</b> modifier is set, the <b>pcre2_substitute()</b> function is
-called instead of one of the matching functions. Unlike subject strings,
-<b>pcre2test</b> does not process replacement strings for escape sequences. In
-UTF mode, a replacement string is checked to see if it is a valid UTF-8 string.
-If so, it is correctly converted to a UTF string of the appropriate code unit
-width. If it is not a valid UTF-8 string, the individual code units are copied
-directly. This provides a means of passing an invalid UTF-8 string for testing
-purposes.
-</P>
-<P>
-If the <b>global</b> modifier is set, PCRE2_SUBSTITUTE_GLOBAL is passed to
-<b>pcre2_substitute()</b>. After a successful substitution, the modified string
-is output, preceded by the number of replacements. This may be zero if there
-were no matches. Here is a simple example of a substitution test:
+called instead of one of the matching functions. Note that replacement strings
+cannot contain commas, because a comma signifies the end of a modifier. This is
+not thought to be an issue in a test program.
+</P>
+<P>
+Unlike subject strings, <b>pcre2test</b> does not process replacement strings
+for escape sequences. In UTF mode, a replacement string is checked to see if it
+is a valid UTF-8 string. If so, it is correctly converted to a UTF string of
+the appropriate code unit width. If it is not a valid UTF-8 string, the
+individual code units are copied directly. This provides a means of passing an
+invalid UTF-8 string for testing purposes.
+</P>
+<P>
+The following modifiers set options (in additional to the normal match options)
+for <b>pcre2_substitute()</b>:
+<pre>
+  global                      PCRE2_SUBSTITUTE_GLOBAL
+  substitute_extended         PCRE2_SUBSTITUTE_EXTENDED
+  substitute_overflow_length  PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+  substitute_unknown_unset    PCRE2_SUBSTITUTE_UNKNOWN_UNSET
+  substitute_unset_empty      PCRE2_SUBSTITUTE_UNSET_EMPTY
+
+</PRE>
+</P>
+<P>
+After a successful substitution, the modified string is output, preceded by the
+number of replacements. This may be zero if there were no matches. Here is a
+simple example of a substitution test:
 <pre>
   /abc/replace=xxx
       =abc=abc=
@@ -1016,12 +1173,12 @@ were no matches. Here is a simple example of a substitution test:
       =abc=abc=\=global
    2: =xxx=xxx=
 </pre>
-Subject and replacement strings should be kept relatively short for
-substitution tests, as fixed-size buffers are used. To make it easy to test for
-buffer overflow, if the replacement string starts with a number in square
-brackets, that number is passed to <b>pcre2_substitute()</b> as the size of the
-output buffer, with the replacement string starting at the next character. Here
-is an example that tests the edge case:
+Subject and replacement strings should be kept relatively short (fewer than 256
+characters) for substitution tests, as fixed-size buffers are used. To make it
+easy to test for buffer overflow, if the replacement string starts with a
+number in square brackets, that number is passed to <b>pcre2_substitute()</b> as
+the size of the output buffer, with the replacement string starting at the next
+character. Here is an example that tests the edge case:
 <pre>
   /abc/
       123abc123\=replace=[10]XYZ
@@ -1029,6 +1186,19 @@ is an example that tests the edge case:
       123abc123\=replace=[9]XYZ
   Failed: error -47: no more memory
 </pre>
+The default action of <b>pcre2_substitute()</b> is to return
+PCRE2_ERROR_NOMEMORY when the output buffer is too small. However, if the
+PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option is set (by using the
+<b>substitute_overflow_length</b> modifier), <b>pcre2_substitute()</b> continues
+to go through the motions of matching and substituting, in order to compute the
+size of buffer that is required. When this happens, <b>pcre2test</b> shows the
+required buffer length (which includes space for the trailing zero) as part of
+the error message. For example:
+<pre>
+  /abc/substitute_overflow_length
+      123abc123\=replace=[9]XYZ
+  Failed: error -47: no more memory: 10 code units are needed
+</pre>
 A replacement string is ignored with POSIX and DFA matching. Specifying partial
 matching provokes an error return ("bad option value") from
 <b>pcre2_substitute()</b>.
@@ -1100,6 +1270,16 @@ The <b>offset</b> modifier sets an offset in the subject string at which
 matching starts. Its value is a number of code units, not characters.
 </P>
 <br><b>
+Setting an offset limit
+</b><br>
+<P>
+The <b>offset_limit</b> modifier sets a limit for unanchored matches. If a match
+cannot be found starting at or before this offset in the subject, a "no match"
+return is given. The data value is a number of code units, not characters. When
+this modifier is used, the <b>use_offset_limit</b> modifier must have been set
+for the pattern; if not, an error is generated.
+</P>
+<br><b>
 Setting the size of the output vector
 </b><br>
 <P>
@@ -1131,6 +1311,17 @@ this modifier has no effect, as there is no facility for passing a length.)
 When testing <b>pcre2_substitute()</b>, this modifier also has the effect of
 passing the replacement string as zero-terminated.
 </P>
+<br><b>
+Passing a NULL context
+</b><br>
+<P>
+Normally, <b>pcre2test</b> passes a context block to <b>pcre2_match()</b>,
+<b>pcre2_dfa_match()</b> or <b>pcre2_jit_match()</b>. If the <b>null_context</b>
+modifier is set, however, NULL is passed. This is for testing that the matching
+functions behave correctly in this case (they use default values). This
+modifier cannot be used with the <b>find_limits</b> modifier or when testing the
+substitution function.
+</P>
 <br><a name="SEC12" href="#TOC1">THE ALTERNATIVE MATCHING FUNCTION</a><br>
 <P>
 By default, <b>pcre2test</b> uses the standard PCRE2 matching function,
@@ -1469,7 +1660,7 @@ Cambridge, England.
 </P>
 <br><a name="SEC21" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 20 May 2015
+Last updated: 12 December 2015
 <br>
 Copyright &copy; 1997-2015 University of Cambridge.
 <br>
index 22c1792d99fff311b1322b5e04a4b87f8ee8ae94..7af55c3eba07ac831a8740d68801a4c7656927c9 100644 (file)
@@ -71,11 +71,12 @@ The escape sequence \C can be used to match a single code unit, in a UTF mode,
 but its use can lead to some strange effects because it breaks up multi-unit
 characters (see the description of \C in the
 <a href="pcre2pattern.html"><b>pcre2pattern</b></a>
-documentation). The use of \C is not supported in the alternative matching
-function <b>pcre2_dfa_match()</b>, nor is it supported in UTF mode by the JIT
-optimization. If JIT optimization is requested for a UTF pattern that contains
-\C, it will not succeed, and so the matching will be carried out by the normal
-interpretive function.
+documentation). The use of \C is not supported by the alternative matching
+function <b>pcre2_dfa_match()</b> when in UTF mode. Its use provokes a
+match-time error. The JIT optimization also does not support \C in UTF mode.
+If JIT optimization is requested for a UTF pattern that contains \C, it will
+not succeed, and so the matching will be carried out by the normal interpretive
+function.
 </P>
 <P>
 The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly test
@@ -126,11 +127,22 @@ as a byte-order mark (BOM). The PCRE2 functions do not handle this, expecting
 strings to be in host byte order.
 </P>
 <P>
-The entire string is checked before any other processing takes place. In
-addition to checking the format of the string, there is a check to ensure that
-all code points lie in the range U+0 to U+10FFFF, excluding the surrogate area.
-The so-called "non-character" code points are not excluded because Unicode
-corrigendum #9 makes it clear that they should not be.
+A UTF string is checked before any other processing takes place. In the case of
+<b>pcre2_match()</b> and <b>pcre2_dfa_match()</b> calls with a non-zero starting
+offset, the check is applied only to that part of the subject that could be
+inspected during matching, and there is a check that the starting offset points
+to the first code unit of a character or to the end of the subject. If there
+are no lookbehind assertions in the pattern, the check starts at the starting
+offset. Otherwise, it starts at the length of the longest lookbehind before the
+starting offset, or at the start of the subject if there are not that many
+characters before the starting offset. Note that the sequences \b and \B are
+one-character lookbehinds.
+</P>
+<P>
+In addition to checking the format of the string, there is a check to ensure
+that all code points lie in the range U+0 to U+10FFFF, excluding the surrogate
+area. The so-called "non-character" code points are not excluded because
+Unicode corrigendum #9 makes it clear that they should not be.
 </P>
 <P>
 Characters in the "Surrogate Area" of Unicode are reserved for use by UTF-16,
@@ -264,9 +276,9 @@ Cambridge, England.
 REVISION
 </b><br>
 <P>
-Last updated: 23 November 2014
+Last updated: 16 October 2015
 <br>
-Copyright &copy; 1997-2014 University of Cambridge.
+Copyright &copy; 1997-2015 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index ae938fd3c6d17c924e3a54f2d3e5ed8e566d4fc7..f459657143000ae6ef7a8c444972dd722b580f58 100644 (file)
@@ -210,9 +210,15 @@ in the library.
 <tr><td><a href="pcre2_set_match_limit.html">pcre2_set_match_limit</a></td>
     <td>&nbsp;&nbsp;Set the match limit</td></tr>
 
+<tr><td><a href="pcre2_set_max_pattern_length.html">pcre2_set_max_pattern_length</a></td>
+    <td>&nbsp;&nbsp;Set the maximum length of pattern</td></tr>
+
 <tr><td><a href="pcre2_set_newline.html">pcre2_set_newline</a></td>
     <td>&nbsp;&nbsp;Set the newline convention</td></tr>
 
+<tr><td><a href="pcre2_set_offset_limit.html">pcre2_set_offset_limit</a></td>
+    <td>&nbsp;&nbsp;Set the offset limit</td></tr>
+
 <tr><td><a href="pcre2_set_parens_nest_limit.html">pcre2_set_parens_nest_limit</a></td>
     <td>&nbsp;&nbsp;Set the parentheses nesting limit</td></tr>
 
index e315bbb6047400aace3307b3a762d5217929a666..9a84ce31e7b33e77549c84199a29e9c879a71af6 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2 3 "13 April 2015" "PCRE2 10.20"
+.TH PCRE2 3 "16 October 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH INTRODUCTION
@@ -118,8 +118,10 @@ running redundant checks.
 .P
 The use of the \eC escape sequence in a UTF-8 or UTF-16 pattern can lead to
 problems, because it may leave the current matching point in the middle of a
-multi-code-unit character. The PCRE2_NEVER_BACKSLASH_C option can be used to
-lock out the use of \eC, causing a compile-time error if it is encountered.
+multi-code-unit character. The PCRE2_NEVER_BACKSLASH_C option can be used by an
+application to lock out the use of \eC, causing a compile-time error if it is
+encountered. It is also possible to build PCRE2 with the use of \eC permanently
+disabled.
 .P
 Another way that performance can be hit is by running a pattern that has a very
 large search tree against a string that will never match. Nested unlimited
@@ -187,6 +189,6 @@ use my two initials, followed by the two digits 10, at the domain cam.ac.uk.
 .rs
 .sp
 .nf
-Last updated: 13 April 2015
+Last updated: 16 October 2015
 Copyright (c) 1997-2015 University of Cambridge.
 .fi
index 3193d30541e31978e253271a4b662e5adb3caba8..9df2d47ebc3e60554b37c1cf8a6ab9394b14b714 100644 (file)
@@ -104,26 +104,27 @@ SECURITY CONSIDERATIONS
        The use of the \C escape sequence in a UTF-8 or UTF-16 pattern can lead
        to  problems,  because  it  may leave the current matching point in the
        middle of  a  multi-code-unit  character.  The  PCRE2_NEVER_BACKSLASH_C
-       option  can  be  used to lock out the use of \C, causing a compile-time
-       error if it is encountered.
-
-       Another way that performance can be hit is by running  a  pattern  that
-       has  a  very  large search tree against a string that will never match.
-       Nested unlimited repeats in a pattern are a common example. PCRE2  pro-
-       vides  some  protection  against  this: see the pcre2_set_match_limit()
+       option can be used by an application to lock out the use of \C, causing
+       a compile-time error if it is encountered. It is also possible to build
+       PCRE2 with the use of \C permanently disabled.
+
+       Another  way  that  performance can be hit is by running a pattern that
+       has a very large search tree against a string that  will  never  match.
+       Nested  unlimited repeats in a pattern are a common example. PCRE2 pro-
+       vides some protection against  this:  see  the  pcre2_set_match_limit()
        function in the pcre2api page.
 
 
 USER DOCUMENTATION
 
-       The user documentation for PCRE2 comprises a number of  different  sec-
-       tions.  In the "man" format, each of these is a separate "man page". In
-       the HTML format, each is a separate page, linked from the  index  page.
-       In  the  plain  text  format,  the  descriptions  of  the pcre2grep and
+       The  user  documentation for PCRE2 comprises a number of different sec-
+       tions. In the "man" format, each of these is a separate "man page".  In
+       the  HTML  format, each is a separate page, linked from the index page.
+       In the plain  text  format,  the  descriptions  of  the  pcre2grep  and
        pcre2test programs are in files called pcre2grep.txt and pcre2test.txt,
-       respectively.  The remaining sections, except for the pcre2demo section
-       (which is a program listing), and the short pages for individual  func-
-       tions,  are  concatenated in pcre2.txt, for ease of searching. The sec-
+       respectively. The remaining sections, except for the pcre2demo  section
+       (which  is a program listing), and the short pages for individual func-
+       tions, are concatenated in pcre2.txt, for ease of searching.  The  sec-
        tions are as follows:
 
          pcre2              this document
@@ -148,7 +149,7 @@ USER DOCUMENTATION
          pcre2test          description of the pcre2test command
          pcre2unicode       discussion of Unicode and UTF support
 
-       In the "man" and HTML formats, there is also a short page  for  each  C
+       In  the  "man"  and HTML formats, there is also a short page for each C
        library function, listing its arguments and results.
 
 
@@ -158,14 +159,14 @@ AUTHOR
        University Computing Service
        Cambridge, England.
 
-       Putting  an  actual email address here is a spam magnet. If you want to
-       email me, use my two initials, followed by the two digits  10,  at  the
+       Putting an actual email address here is a spam magnet. If you  want  to
+       email  me,  use  my two initials, followed by the two digits 10, at the
        domain cam.ac.uk.
 
 
 REVISION
 
-       Last updated: 13 April 2015
+       Last updated: 16 October 2015
        Copyright (c) 1997-2015 University of Cambridge.
 ------------------------------------------------------------------------------
 
@@ -190,13 +191,13 @@ PCRE2 NATIVE API BASIC FUNCTIONS
          uint32_t options, int *errorcode, PCRE2_SIZE *erroroffset,
          pcre2_compile_context *ccontext);
 
-       pcre2_code_free(pcre2_code *code);
+       void pcre2_code_free(pcre2_code *code);
 
-       pcre2_match_data_create(uint32_t ovecsize,
+       pcre2_match_data *pcre2_match_data_create(uint32_t ovecsize,
          pcre2_general_context *gcontext);
 
-       pcre2_match_data_create_from_pattern(const pcre2_code *code,
-         pcre2_general_context *gcontext);
+       pcre2_match_data *pcre2_match_data_create_from_pattern(
+         const pcre2_code *code, pcre2_general_context *gcontext);
 
        int pcre2_match(const pcre2_code *code, PCRE2_SPTR subject,
          PCRE2_SIZE length, PCRE2_SIZE startoffset,
@@ -251,6 +252,9 @@ PCRE2 NATIVE API COMPILE CONTEXT FUNCTIONS
        int pcre2_set_character_tables(pcre2_compile_context *ccontext,
          const unsigned char *tables);
 
+       int pcre2_set_max_pattern_length(pcre2_compile_context *ccontext,
+         PCRE2_SIZE value);
+
        int pcre2_set_newline(pcre2_compile_context *ccontext,
          uint32_t value);
 
@@ -278,6 +282,9 @@ PCRE2 NATIVE API MATCH CONTEXT FUNCTIONS
        int pcre2_set_match_limit(pcre2_match_context *mcontext,
          uint32_t value);
 
+       int pcre2_set_offset_limit(pcre2_match_context *mcontext,
+         PCRE2_SIZE value);
+
        int pcre2_set_recursion_limit(pcre2_match_context *mcontext,
          uint32_t value);
 
@@ -356,11 +363,11 @@ PCRE2 NATIVE API JIT FUNCTIONS
 PCRE2 NATIVE API SERIALIZATION FUNCTIONS
 
        int32_t pcre2_serialize_decode(pcre2_code **codes,
-         int32_t number_of_codes, const uint32_t *bytes,
+         int32_t number_of_codes, const uint8_t *bytes,
          pcre2_general_context *gcontext);
 
-       int32_t pcre2_serialize_encode(pcre2_code **codes,
-         int32_t number_of_codes, uint32_t **serialized_bytes,
+       int32_t pcre2_serialize_encode(const pcre2_code **codes,
+         int32_t number_of_codes, uint8_t **serialized_bytes,
          PCRE2_SIZE *serialized_size, pcre2_general_context *gcontext);
 
        void pcre2_serialize_free(uint8_t *bytes);
@@ -674,6 +681,7 @@ PCRE2 CONTEXTS
          PCRE2's character tables
          The newline character sequence
          The compile time nested parentheses limit
+         The maximum length of the pattern string
          An external function for stack checking
 
        A compile context is also required if you are using custom memory  man-
@@ -711,42 +719,52 @@ PCRE2 CONTEXTS
        only argument is a general context. This function builds a set of char-
        acter tables in the current locale.
 
+       int pcre2_set_max_pattern_length(pcre2_compile_context *ccontext,
+         PCRE2_SIZE value);
+
+       This  sets a maximum length, in code units, for the pattern string that
+       is to be compiled. If the pattern is longer,  an  error  is  generated.
+       This  facility  is  provided  so that applications that accept patterns
+       from external sources can limit their size. The default is the  largest
+       number that a PCRE2_SIZE variable can hold, which is effectively unlim-
+       ited.
+
        int pcre2_set_newline(pcre2_compile_context *ccontext,
          uint32_t value);
 
        This specifies which characters or character sequences are to be recog-
-       nized as newlines. The value must be one of PCRE2_NEWLINE_CR  (carriage
+       nized  as newlines. The value must be one of PCRE2_NEWLINE_CR (carriage
        return only), PCRE2_NEWLINE_LF (linefeed only), PCRE2_NEWLINE_CRLF (the
-       two-character sequence CR followed by LF),  PCRE2_NEWLINE_ANYCRLF  (any
+       two-character  sequence  CR followed by LF), PCRE2_NEWLINE_ANYCRLF (any
        of the above), or PCRE2_NEWLINE_ANY (any Unicode newline sequence).
 
        When a pattern is compiled with the PCRE2_EXTENDED option, the value of
-       this parameter affects the recognition of white space and  the  end  of
+       this  parameter  affects  the recognition of white space and the end of
        internal comments starting with #. The value is saved with the compiled
-       pattern for subsequent use by the JIT compiler and by  the  two  inter-
+       pattern  for  subsequent  use by the JIT compiler and by the two inter-
        preted matching functions, pcre2_match() and pcre2_dfa_match().
 
        int pcre2_set_parens_nest_limit(pcre2_compile_context *ccontext,
          uint32_t value);
 
        This parameter ajusts the limit, set when PCRE2 is built (default 250),
-       on the depth of parenthesis nesting in  a  pattern.  This  limit  stops
+       on  the  depth  of  parenthesis  nesting in a pattern. This limit stops
        rogue patterns using up too much system stack when being compiled.
 
        int pcre2_set_compile_recursion_guard(pcre2_compile_context *ccontext,
          int (*guard_function)(uint32_t, void *), void *user_data);
 
-       There  is at least one application that runs PCRE2 in threads with very
-       limited system stack, where running out of stack is to  be  avoided  at
-       all  costs. The parenthesis limit above cannot take account of how much
-       stack is actually available. For a finer  control,  you  can  supply  a
-       function  that  is  called whenever pcre2_compile() starts to compile a
-       parenthesized part of a pattern. This function  can  check  the  actual
+       There is at least one application that runs PCRE2 in threads with  very
+       limited  system  stack,  where running out of stack is to be avoided at
+       all costs. The parenthesis limit above cannot take account of how  much
+       stack  is  actually  available.  For  a finer control, you can supply a
+       function that is called whenever pcre2_compile() starts  to  compile  a
+       parenthesized  part  of  a  pattern. This function can check the actual
        stack size (or anything else that it wants to, of course).
 
-       The  first  argument to the callout function gives the current depth of
-       nesting, and the second is user data that is set up by the  last  argu-
-       ment   of  pcre2_set_compile_recursion_guard().  The  callout  function
+       The first argument to the callout function gives the current  depth  of
+       nesting,  and  the second is user data that is set up by the last argu-
+       ment  of  pcre2_set_compile_recursion_guard().  The  callout   function
        should return zero if all is well, or non-zero to force an error.
 
    The match context
@@ -755,14 +773,15 @@ PCRE2 CONTEXTS
        any of the following match-time parameters:
 
          A callout function
-         The limit for calling match()
+         The offset limit for matching an unanchored pattern
+         The limit for calling match() (see below)
          The limit for calling match() recursively
 
        A match context is also required if you are using custom memory manage-
-       ment.  If none of these apply, just pass NULL as the  context  argument
+       ment.   If  none of these apply, just pass NULL as the context argument
        of pcre2_match(), pcre2_dfa_match(), or pcre2_jit_match().
 
-       A  match  context  is created, copied, and freed by the following func-
+       A match context is created, copied, and freed by  the  following  func-
        tions:
 
        pcre2_match_context *pcre2_match_context_create(
@@ -773,7 +792,7 @@ PCRE2 CONTEXTS
 
        void pcre2_match_context_free(pcre2_match_context *mcontext);
 
-       A match context is created with  default  values  for  its  parameters.
+       A  match  context  is  created  with default values for its parameters.
        These can be changed by calling the following functions, which return 0
        on success, or PCRE2_ERROR_BADDATA if invalid data is detected.
 
@@ -781,71 +800,96 @@ PCRE2 CONTEXTS
          int (*callout_function)(pcre2_callout_block *, void *),
          void *callout_data);
 
-       This sets up a "callout" function, which PCRE2 will call  at  specified
+       This  sets  up a "callout" function, which PCRE2 will call at specified
        points during a matching operation. Details are given in the pcre2call-
        out documentation.
 
+       int pcre2_set_offset_limit(pcre2_match_context *mcontext,
+         PCRE2_SIZE value);
+
+       The  offset_limit  parameter  limits  how  far an unanchored search can
+       advance in the subject string. The default value  is  PCRE2_UNSET.  The
+       pcre2_match()      and      pcre2_dfa_match()      functions     return
+       PCRE2_ERROR_NOMATCH if a match with a starting point before or  at  the
+       given offset is not found. For example, if the pattern /abc/ is matched
+       against "123abc" with an offset  limit  less  than  3,  the  result  is
+       PCRE2_ERROR_NO_MATCH.   A  match  can never be found if the startoffset
+       argument of pcre2_match() or pcre2_dfa_match() is greater than the off-
+       set limit.
+
+       When  using  this  facility,  you  must set PCRE2_USE_OFFSET_LIMIT when
+       calling pcre2_compile() so that when JIT is in use, different code  can
+       be  compiled. If a match is started with a non-default match limit when
+       PCRE2_USE_OFFSET_LIMIT is not set, an error is generated.
+
+       The offset limit facility can be used to track progress when  searching
+       large  subject  strings.  See  also  the  PCRE2_FIRSTLINE option, which
+       requires a match to start within the first line of the subject. If this
+       is  set  with an offset limit, a match must occur in the first line and
+       also within the offset limit.  In other words,  whichever  limit  comes
+       first is used.
+
        int pcre2_set_match_limit(pcre2_match_context *mcontext,
          uint32_t value);
 
-       The match_limit parameter provides a means  of  preventing  PCRE2  from
+       The  match_limit  parameter  provides  a means of preventing PCRE2 from
        using up too many resources when processing patterns that are not going
-       to match, but which have a very large number of possibilities in  their
-       search  trees. The classic example is a pattern that uses nested unlim-
+       to  match, but which have a very large number of possibilities in their
+       search trees. The classic example is a pattern that uses nested  unlim-
        ited repeats.
 
-       Internally, pcre2_match() uses a  function  called  match(),  which  it
-       calls  repeatedly (sometimes recursively). The limit set by match_limit
-       is imposed on the number of times this  function  is  called  during  a
+       Internally,  pcre2_match()  uses  a  function  called match(), which it
+       calls repeatedly (sometimes recursively). The limit set by  match_limit
+       is  imposed  on  the  number  of times this function is called during a
        match, which has the effect of limiting the amount of backtracking that
-       can take place. For patterns that are not anchored, the count  restarts
-       from  zero  for  each position in the subject string. This limit is not
+       can  take place. For patterns that are not anchored, the count restarts
+       from zero for each position in the subject string. This  limit  is  not
        relevant to pcre2_dfa_match(), which ignores it.
 
-       When pcre2_match() is called with a pattern that was successfully  pro-
+       When  pcre2_match() is called with a pattern that was successfully pro-
        cessed by pcre2_jit_compile(), the way in which matching is executed is
-       entirely different. However, there is still the possibility of  runaway
-       matching  that  goes  on  for  a very long time, and so the match_limit
-       value is also used in this case (but in a different way) to  limit  how
+       entirely  different. However, there is still the possibility of runaway
+       matching that goes on for a very long  time,  and  so  the  match_limit
+       value  is  also used in this case (but in a different way) to limit how
        long the matching can continue.
 
-       The  default  value  for  the limit can be set when PCRE2 is built; the
-       default default is 10 million, which handles all but the  most  extreme
-       cases.    If    the    limit   is   exceeded,   pcre2_match()   returns
-       PCRE2_ERROR_MATCHLIMIT. A value for the match limit may  also  be  sup-
+       The default value for the limit can be set when  PCRE2  is  built;  the
+       default  default  is 10 million, which handles all but the most extreme
+       cases.   If   the   limit   is    exceeded,    pcre2_match()    returns
+       PCRE2_ERROR_MATCHLIMIT.  A  value  for the match limit may also be sup-
        plied by an item at the start of a pattern of the form
 
          (*LIMIT_MATCH=ddd)
 
-       where  ddd  is  a  decimal  number.  However, such a setting is ignored
-       unless ddd is less than the limit set by the  caller  of  pcre2_match()
+       where ddd is a decimal number.  However,  such  a  setting  is  ignored
+       unless  ddd  is  less than the limit set by the caller of pcre2_match()
        or, if no such limit is set, less than the default.
 
        int pcre2_set_recursion_limit(pcre2_match_context *mcontext,
          uint32_t value);
 
        The recursion_limit parameter is similar to match_limit, but instead of
-       limiting the total number of times that match() is  called,  it  limits
-       the  depth  of  recursion. The recursion depth is a smaller number than
-       the total number of calls, because not all calls to match() are  recur-
+       limiting  the  total  number of times that match() is called, it limits
+       the depth of recursion. The recursion depth is a  smaller  number  than
+       the  total number of calls, because not all calls to match() are recur-
        sive.  This limit is of use only if it is set smaller than match_limit.
 
        Limiting the recursion depth limits the amount of system stack that can
-       be used, or, when PCRE2 has been compiled to use  memory  on  the  heap
-       instead  of the stack, the amount of heap memory that can be used. This
-       limit is not relevant, and is ignored, when matching is done using  JIT
+       be  used,  or,  when  PCRE2 has been compiled to use memory on the heap
+       instead of the stack, the amount of heap memory that can be used.  This
+       limit  is not relevant, and is ignored, when matching is done using JIT
        compiled code or by the pcre2_dfa_match() function.
 
-       The  default  value for recursion_limit can be set when PCRE2 is built;
-       the default default is the same value as the default  for  match_limit.
-       If  the limit is exceeded, pcre2_match() returns PCRE2_ERROR_RECURSION-
-       LIMIT. A value for the recursion limit may also be supplied by an  item
+       The default value for recursion_limit can be set when PCRE2  is  built;
+       the  default  default is the same value as the default for match_limit.
+       If the limit is exceeded, pcre2_match() returns  PCRE2_ERROR_RECURSION-
+       LIMIT.  A value for the recursion limit may also be supplied by an item
        at the start of a pattern of the form
 
          (*LIMIT_RECURSION=ddd)
 
-       where  ddd  is  a  decimal  number.  However, such a setting is ignored
-       unless ddd is less than the limit set by the  caller  of  pcre2_match()
+       where ddd is a decimal number.  However,  such  a  setting  is  ignored
+       unless  ddd  is  less than the limit set by the caller of pcre2_match()
        or, if no such limit is set, less than the default.
 
        int pcre2_set_recursion_memory_management(
@@ -854,21 +898,21 @@ PCRE2 CONTEXTS
          void (*private_free)(void *, void *), void *memory_data);
 
        This function sets up two additional custom memory management functions
-       for use by pcre2_match() when PCRE2 is compiled to  use  the  heap  for
+       for  use  by  pcre2_match()  when PCRE2 is compiled to use the heap for
        remembering backtracking data, instead of recursive function calls that
-       use the system stack. There is a discussion about PCRE2's  stack  usage
-       in  the  pcre2stack documentation. See the pcre2build documentation for
+       use  the  system stack. There is a discussion about PCRE2's stack usage
+       in the pcre2stack documentation. See the pcre2build  documentation  for
        details of how to build PCRE2.
 
-       Using the heap for recursion is a non-standard way of  building  PCRE2,
-       for  use  in  environments  that  have  limited  stacks. Because of the
+       Using  the  heap for recursion is a non-standard way of building PCRE2,
+       for use in environments  that  have  limited  stacks.  Because  of  the
        greater use of memory management, pcre2_match() runs more slowly. Func-
-       tions  that  are  different  to the general custom memory functions are
-       provided so that special-purpose external code can  be  used  for  this
-       case,  because  the memory blocks are all the same size. The blocks are
+       tions that are different to the general  custom  memory  functions  are
+       provided  so  that  special-purpose  external code can be used for this
+       case, because the memory blocks are all the same size. The  blocks  are
        retained by pcre2_match() until it is about to exit so that they can be
-       re-used  when  possible during the match. In the absence of these func-
-       tions, the normal custom memory management functions are used, if  sup-
+       re-used when possible during the match. In the absence of  these  func-
+       tions,  the normal custom memory management functions are used, if sup-
        plied, otherwise the system functions.
 
 
@@ -876,75 +920,75 @@ CHECKING BUILD-TIME OPTIONS
 
        int pcre2_config(uint32_t what, void *where);
 
-       The  function  pcre2_config()  makes  it possible for a PCRE2 client to
-       discover which optional features have  been  compiled  into  the  PCRE2
-       library.  The  pcre2build  documentation  has  more details about these
+       The function pcre2_config() makes it possible for  a  PCRE2  client  to
+       discover  which  optional  features  have  been compiled into the PCRE2
+       library. The pcre2build documentation  has  more  details  about  these
        optional features.
 
-       The first argument for pcre2_config() specifies  which  information  is
-       required.  The  second  argument  is a pointer to memory into which the
-       information is placed. If NULL is  passed,  the  function  returns  the
-       amount  of  memory  that  is  needed for the requested information. For
-       calls that return  numerical  values,  the  value  is  in  bytes;  when
-       requesting  these  values,  where should point to appropriately aligned
-       memory. For calls that return strings, the required length is given  in
+       The  first  argument  for pcre2_config() specifies which information is
+       required. The second argument is a pointer to  memory  into  which  the
+       information  is  placed.  If  NULL  is passed, the function returns the
+       amount of memory that is needed  for  the  requested  information.  For
+       calls  that  return  numerical  values,  the  value  is  in bytes; when
+       requesting these values, where should point  to  appropriately  aligned
+       memory.  For calls that return strings, the required length is given in
        code units, not counting the terminating zero.
 
-       When  requesting information, the returned value from pcre2_config() is
-       non-negative on success, or the negative error code  PCRE2_ERROR_BADOP-
-       TION  if the value in the first argument is not recognized. The follow-
+       When requesting information, the returned value from pcre2_config()  is
+       non-negative  on success, or the negative error code PCRE2_ERROR_BADOP-
+       TION if the value in the first argument is not recognized. The  follow-
        ing information is available:
 
          PCRE2_CONFIG_BSR
 
-       The output is a uint32_t integer whose value indicates  what  character
-       sequences  the  \R  escape  sequence  matches  by  default.  A value of
+       The  output  is a uint32_t integer whose value indicates what character
+       sequences the \R  escape  sequence  matches  by  default.  A  value  of
        PCRE2_BSR_UNICODE  means  that  \R  matches  any  Unicode  line  ending
-       sequence;  a  value of PCRE2_BSR_ANYCRLF means that \R matches only CR,
+       sequence; a value of PCRE2_BSR_ANYCRLF means that \R matches  only  CR,
        LF, or CRLF. The default can be overridden when a pattern is compiled.
 
          PCRE2_CONFIG_JIT
 
-       The output is a uint32_t integer that is set  to  one  if  support  for
+       The  output  is  a  uint32_t  integer that is set to one if support for
        just-in-time compiling is available; otherwise it is set to zero.
 
          PCRE2_CONFIG_JITTARGET
 
-       The  where  argument  should point to a buffer that is at least 48 code
-       units long.  (The  exact  length  required  can  be  found  by  calling
-       pcre2_config()  with  where  set  to NULL.) The buffer is filled with a
-       string that contains the name of the architecture  for  which  the  JIT
-       compiler  is  configured,  for  example  "x86  32bit  (little  endian +
-       unaligned)". If JIT support is not available, PCRE2_ERROR_BADOPTION  is
-       returned,  otherwise the number of code units used is returned. This is
+       The where argument should point to a buffer that is at  least  48  code
+       units  long.  (The  exact  length  required  can  be  found  by calling
+       pcre2_config() with where set to NULL.) The buffer  is  filled  with  a
+       string  that  contains  the  name of the architecture for which the JIT
+       compiler is  configured,  for  example  "x86  32bit  (little  endian  +
+       unaligned)".  If JIT support is not available, PCRE2_ERROR_BADOPTION is
+       returned, otherwise the number of code units used is returned. This  is
        the length of the string, plus one unit for the terminating zero.
 
          PCRE2_CONFIG_LINKSIZE
 
        The output is a uint32_t integer that contains the number of bytes used
-       for  internal  linkage  in  compiled regular expressions. When PCRE2 is
-       configured, the value can be set to 2, 3, or 4, with the default  being
-       2.  This is the value that is returned by pcre2_config(). However, when
-       the 16-bit library is compiled, a value of 3 is rounded up  to  4,  and
-       when  the  32-bit  library  is compiled, internal linkages always use 4
+       for internal linkage in compiled regular  expressions.  When  PCRE2  is
+       configured,  the value can be set to 2, 3, or 4, with the default being
+       2. This is the value that is returned by pcre2_config(). However,  when
+       the  16-bit  library  is compiled, a value of 3 is rounded up to 4, and
+       when the 32-bit library is compiled, internal  linkages  always  use  4
        bytes, so the configured value is not relevant.
 
        The default value of 2 for the 8-bit and 16-bit libraries is sufficient
-       for  all but the most massive patterns, since it allows the size of the
+       for all but the most massive patterns, since it allows the size of  the
        compiled pattern to be up to 64K code units. Larger values allow larger
-       regular  expressions  to be compiled by those two libraries, but at the
+       regular expressions to be compiled by those two libraries, but  at  the
        expense of slower matching.
 
          PCRE2_CONFIG_MATCHLIMIT
 
-       The output is a uint32_t integer that gives the default limit  for  the
-       number  of  internal  matching function calls in a pcre2_match() execu-
+       The  output  is a uint32_t integer that gives the default limit for the
+       number of internal matching function calls in  a  pcre2_match()  execu-
        tion. Further details are given with pcre2_match() below.
 
          PCRE2_CONFIG_NEWLINE
 
-       The output is a uint32_t integer  whose  value  specifies  the  default
-       character  sequence that is recognized as meaning "newline". The values
+       The  output  is  a  uint32_t  integer whose value specifies the default
+       character sequence that is recognized as meaning "newline". The  values
        are:
 
          PCRE2_NEWLINE_CR       Carriage return (CR)
@@ -953,56 +997,56 @@ CHECKING BUILD-TIME OPTIONS
          PCRE2_NEWLINE_ANY      Any Unicode line ending
          PCRE2_NEWLINE_ANYCRLF  Any of CR, LF, or CRLF
 
-       The default should normally correspond to  the  standard  sequence  for
+       The  default  should  normally  correspond to the standard sequence for
        your operating system.
 
          PCRE2_CONFIG_PARENSLIMIT
 
-       The  output is a uint32_t integer that gives the maximum depth of nest-
+       The output is a uint32_t integer that gives the maximum depth of  nest-
        ing of parentheses (of any kind) in a pattern. This limit is imposed to
-       cap  the  amount of system stack used when a pattern is compiled. It is
-       specified when PCRE2 is built; the default is 250. This limit does  not
-       take  into  account  the  stack that may already be used by the calling
-       application. For  finer  control  over  compilation  stack  usage,  see
+       cap the amount of system stack used when a pattern is compiled.  It  is
+       specified  when PCRE2 is built; the default is 250. This limit does not
+       take into account the stack that may already be  used  by  the  calling
+       application.  For  finer  control  over  compilation  stack  usage, see
        pcre2_set_compile_recursion_guard().
 
          PCRE2_CONFIG_RECURSIONLIMIT
 
-       The  output  is a uint32_t integer that gives the default limit for the
-       depth of recursion when calling the internal  matching  function  in  a
-       pcre2_match()  execution.  Further details are given with pcre2_match()
+       The output is a uint32_t integer that gives the default limit  for  the
+       depth  of  recursion  when  calling the internal matching function in a
+       pcre2_match() execution. Further details are given  with  pcre2_match()
        below.
 
          PCRE2_CONFIG_STACKRECURSE
 
-       The output is a uint32_t integer that is set to one if internal  recur-
-       sion  when  running  pcre2_match() is implemented by recursive function
-       calls that use the system stack to remember their state.  This  is  the
-       usual  way that PCRE2 is compiled. The output is zero if PCRE2 was com-
-       piled to use blocks of data on the heap instead of  recursive  function
+       The  output is a uint32_t integer that is set to one if internal recur-
+       sion when running pcre2_match() is implemented  by  recursive  function
+       calls  that  use  the system stack to remember their state. This is the
+       usual way that PCRE2 is compiled. The output is zero if PCRE2 was  com-
+       piled  to  use blocks of data on the heap instead of recursive function
        calls.
 
          PCRE2_CONFIG_UNICODE_VERSION
 
-       The  where  argument  should point to a buffer that is at least 24 code
-       units long.  (The  exact  length  required  can  be  found  by  calling
-       pcre2_config()  with  where  set  to  NULL.) If PCRE2 has been compiled
-       without Unicode support, the buffer is filled with  the  text  "Unicode
-       not  supported".  Otherwise,  the  Unicode version string (for example,
-       "7.0.0") is inserted. The number of code units used is  returned.  This
+       The where argument should point to a buffer that is at  least  24  code
+       units  long.  (The  exact  length  required  can  be  found  by calling
+       pcre2_config() with where set to NULL.)  If  PCRE2  has  been  compiled
+       without  Unicode  support,  the buffer is filled with the text "Unicode
+       not supported". Otherwise, the Unicode  version  string  (for  example,
+       "8.0.0")  is  inserted. The number of code units used is returned. This
        is the length of the string plus one unit for the terminating zero.
 
          PCRE2_CONFIG_UNICODE
 
-       The  output is a uint32_t integer that is set to one if Unicode support
-       is available; otherwise it is set to zero. Unicode support implies  UTF
+       The output is a uint32_t integer that is set to one if Unicode  support
+       is  available; otherwise it is set to zero. Unicode support implies UTF
        support.
 
          PCRE2_CONFIG_VERSION
 
-       The  where  argument  should point to a buffer that is at least 12 code
-       units long.  (The  exact  length  required  can  be  found  by  calling
-       pcre2_config()  with  where set to NULL.) The buffer is filled with the
+       The where argument should point to a buffer that is at  least  12  code
+       units  long.  (The  exact  length  required  can  be  found  by calling
+       pcre2_config() with where set to NULL.) The buffer is filled  with  the
        PCRE2 version string, zero-terminated. The number of code units used is
        returned. This is the length of the string plus one unit for the termi-
        nating zero.
@@ -1014,60 +1058,60 @@ COMPILING A PATTERN
          uint32_t options, int *errorcode, PCRE2_SIZE *erroroffset,
          pcre2_compile_context *ccontext);
 
-       pcre2_code_free(pcre2_code *code);
+       void pcre2_code_free(pcre2_code *code);
 
-       The pcre2_compile() function compiles a pattern into an internal  form.
-       The  pattern  is  defined  by a pointer to a string of code units and a
-       length, If the pattern is zero-terminated, the length can be  specified
-       as  PCRE2_ZERO_TERMINATED. The function returns a pointer to a block of
-       memory that contains the compiled pattern and related data. The  caller
-       must  free the memory by calling pcre2_code_free() when it is no longer
+       The  pcre2_compile() function compiles a pattern into an internal form.
+       The pattern is defined by a pointer to a string of  code  units  and  a
+       length,  If the pattern is zero-terminated, the length can be specified
+       as PCRE2_ZERO_TERMINATED. The function returns a pointer to a block  of
+       memory  that contains the compiled pattern and related data. The caller
+       must free the memory by calling pcre2_code_free() when it is no  longer
        needed.
 
-       NOTE: When one of the matching functions is  called,  pointers  to  the
+       NOTE:  When  one  of  the matching functions is called, pointers to the
        compiled pattern and the subject string are set in the match data block
-       so that they can be referenced by the extraction functions. After  run-
-       ning  a  match,  you  must  not  free  a compiled pattern (or a subject
-       string) until after all operations on the match data block  have  taken
+       so  that they can be referenced by the extraction functions. After run-
+       ning a match, you must not  free  a  compiled  pattern  (or  a  subject
+       string)  until  after all operations on the match data block have taken
        place.
 
-       If  the  compile context argument ccontext is NULL, memory for the com-
-       piled pattern  is  obtained  by  calling  malloc().  Otherwise,  it  is
-       obtained  from  the  same memory function that was used for the compile
+       If the compile context argument ccontext is NULL, memory for  the  com-
+       piled  pattern  is  obtained  by  calling  malloc().  Otherwise,  it is
+       obtained from the same memory function that was used  for  the  compile
        context.
 
        The options argument contains various bit settings that affect the com-
-       pilation.  It  should be zero if no options are required. The available
-       options are described below. Some of them (in  particular,  those  that
-       are  compatible with Perl, but some others as well) can also be set and
-       unset from within the pattern (see  the  detailed  description  in  the
+       pilation. It should be zero if no options are required.  The  available
+       options  are  described  below. Some of them (in particular, those that
+       are compatible with Perl, but some others as well) can also be set  and
+       unset  from  within  the  pattern  (see the detailed description in the
        pcre2pattern documentation).
 
-       For  those options that can be different in different parts of the pat-
-       tern, the contents of the options argument specifies their settings  at
-       the  start  of  compilation.  The PCRE2_ANCHORED and PCRE2_NO_UTF_CHECK
+       For those options that can be different in different parts of the  pat-
+       tern,  the contents of the options argument specifies their settings at
+       the start of compilation.  The  PCRE2_ANCHORED  and  PCRE2_NO_UTF_CHECK
        options can be set at the time of matching as well as at compile time.
 
-       Other, less frequently required compile-time parameters  (for  example,
+       Other,  less  frequently required compile-time parameters (for example,
        the newline setting) can be provided in a compile context (as described
        above).
 
        If errorcode or erroroffset is NULL, pcre2_compile() returns NULL imme-
-       diately.  Otherwise, if compilation of a pattern fails, pcre2_compile()
+       diately. Otherwise, if compilation of a pattern fails,  pcre2_compile()
        returns NULL, having set these variables to an error code and an offset
-       (number   of   code   units)  within  the  pattern,  respectively.  The
-       pcre2_get_error_message() function provides a textual message for  each
+       (number  of  code  units)  within  the   pattern,   respectively.   The
+       pcre2_get_error_message()  function provides a textual message for each
        error code. Compilation errors are positive numbers, but UTF formatting
        errors are negative numbers. For an invalid UTF-8 or UTF-16 string, the
        offset is that of the first code unit of the failing character.
 
-       Some  errors are not detected until the whole pattern has been scanned;
-       in these cases, the offset passed back is the length  of  the  pattern.
-       Note  that  the  offset is in code units, not characters, even in a UTF
+       Some errors are not detected until the whole pattern has been  scanned;
+       in  these  cases,  the offset passed back is the length of the pattern.
+       Note that the offset is in code units, not characters, even  in  a  UTF
        mode. It may sometimes point into the middle of a UTF-8 or UTF-16 char-
        acter.
 
-       This  code  fragment shows a typical straightforward call to pcre2_com-
+       This code fragment shows a typical straightforward call  to  pcre2_com-
        pile():
 
          pcre2_code *re;
@@ -1081,53 +1125,66 @@ COMPILING A PATTERN
            &erroffset,             /* for error offset */
            NULL);                  /* no compile context */
 
-       The following names for option bits are defined in the  pcre2.h  header
+       The  following  names for option bits are defined in the pcre2.h header
        file:
 
          PCRE2_ANCHORED
 
        If this bit is set, the pattern is forced to be "anchored", that is, it
-       is constrained to match only at the first matching point in the  string
-       that  is being searched (the "subject string"). This effect can also be
-       achieved by appropriate constructs in the pattern itself, which is  the
+       is  constrained to match only at the first matching point in the string
+       that is being searched (the "subject string"). This effect can also  be
+       achieved  by appropriate constructs in the pattern itself, which is the
        only way to do it in Perl.
 
          PCRE2_ALLOW_EMPTY_CLASS
 
-       By  default, for compatibility with Perl, a closing square bracket that
-       immediately follows an opening one is treated as a data  character  for
-       the  class.  When  PCRE2_ALLOW_EMPTY_CLASS  is  set,  it terminates the
+       By default, for compatibility with Perl, a closing square bracket  that
+       immediately  follows  an opening one is treated as a data character for
+       the class. When  PCRE2_ALLOW_EMPTY_CLASS  is  set,  it  terminates  the
        class, which therefore contains no characters and so can never match.
 
          PCRE2_ALT_BSUX
 
-       This option request alternative handling  of  three  escape  sequences,
-       which  makes  PCRE2's  behaviour more like ECMAscript (aka JavaScript).
+       This  option  request  alternative  handling of three escape sequences,
+       which makes PCRE2's behaviour more like  ECMAscript  (aka  JavaScript).
        When it is set:
 
        (1) \U matches an upper case "U" character; by default \U causes a com-
        pile time error (Perl uses \U to upper case subsequent characters).
 
        (2) \u matches a lower case "u" character unless it is followed by four
-       hexadecimal digits, in which case the hexadecimal  number  defines  the
-       code  point  to match. By default, \u causes a compile time error (Perl
+       hexadecimal  digits,  in  which case the hexadecimal number defines the
+       code point to match. By default, \u causes a compile time  error  (Perl
        uses it to upper case the following character).
 
-       (3) \x matches a lower case "x" character unless it is followed by  two
-       hexadecimal  digits,  in  which case the hexadecimal number defines the
-       code point to match. By default, as in Perl, a  hexadecimal  number  is
+       (3)  \x matches a lower case "x" character unless it is followed by two
+       hexadecimal digits, in which case the hexadecimal  number  defines  the
+       code  point  to  match. By default, as in Perl, a hexadecimal number is
        always expected after \x, but it may have zero, one, or two digits (so,
        for example, \xz matches a binary zero character followed by z).
 
          PCRE2_ALT_CIRCUMFLEX
 
        In  multiline  mode  (when  PCRE2_MULTILINE  is  set),  the  circumflex
-       metacharacter  matches at the start of the subject (unless PCRE2_NOTBOL
-       is set), and also after any internal  newline.  However,  it  does  not
+       metacharacter matches at the start of the subject (unless  PCRE2_NOTBOL
+       is  set),  and  also  after  any internal newline. However, it does not
        match after a newline at the end of the subject, for compatibility with
-       Perl. If you want a multiline circumflex also to match after  a  termi-
+       Perl.  If  you want a multiline circumflex also to match after a termi-
        nating newline, you must set PCRE2_ALT_CIRCUMFLEX.
 
+         PCRE2_ALT_VERBNAMES
+
+       By default, for compatibility with Perl, the name in any verb  sequence
+       such  as  (*MARK:NAME)  is  any  sequence  of  characters that does not
+       include a closing parenthesis. The name is not processed  in  any  way,
+       and  it  is  not possible to include a closing parenthesis in the name.
+       However, if the PCRE2_ALT_VERBNAMES option  is  set,  normal  backslash
+       processing  is  applied  to  verb  names  and only an unescaped closing
+       parenthesis terminates the name. A closing parenthesis can be  included
+       in  a  name  either  as  \) or between \Q and \E. If the PCRE2_EXTENDED
+       option is set, unescaped whitespace in verb names is skipped and #-com-
+       ments are recognized, exactly as in the rest of the pattern.
+
          PCRE2_AUTO_CALLOUT
 
        If  this  bit  is  set,  pcre2_compile()  automatically inserts callout
@@ -1196,7 +1253,11 @@ COMPILING A PATTERN
 
        If  this  option  is  set,  an  unanchored pattern is required to match
        before or at the first  newline  in  the  subject  string,  though  the
-       matched text may continue over the newline.
+       matched  text  may  continue  over the newline. See also PCRE2_USE_OFF-
+       SET_LIMIT,  which  provides  a  more  general  limiting  facility.   If
+       PCRE2_FIRSTLINE  is set with an offset limit, a match must occur in the
+       first line and also within the offset limit. In other words,  whichever
+       limit comes first is used.
 
          PCRE2_MATCH_UNSET_BACKREF
 
@@ -1236,7 +1297,9 @@ COMPILING A PATTERN
        piled.  This escape can  cause  unpredictable  behaviour  in  UTF-8  or
        UTF-16  modes,  because  it may leave the current matching point in the
        middle of a multi-code-unit character. This option  may  be  useful  in
-       applications that process patterns from external sources.
+       applications  that  process  patterns  from external sources. Note that
+       there is also a build-time option that permanently locks out the use of
+       \C.
 
          PCRE2_NEVER_UCP
 
@@ -1375,23 +1438,32 @@ COMPILING A PATTERN
        not  compatible  with Perl. It can also be set by a (?U) option setting
        within the pattern.
 
+         PCRE2_USE_OFFSET_LIMIT
+
+       This option must be set for pcre2_compile() if pcre2_set_offset_limit()
+       is  going  to be used to set a non-default offset limit in a match con-
+       text for matches that use this pattern. An error  is  generated  if  an
+       offset  limit  is  set  without  this option. For more details, see the
+       description of pcre2_set_offset_limit() in the section  that  describes
+       match contexts. See also the PCRE2_FIRSTLINE option above.
+
          PCRE2_UTF
 
-       This option causes PCRE2 to regard both the  pattern  and  the  subject
-       strings  that  are  subsequently processed as strings of UTF characters
-       instead of single-code-unit strings. It  is  available  when  PCRE2  is
-       built  to  include  Unicode  support (which is the default). If Unicode
-       support is not available, the use of this  option  provokes  an  error.
-       Details  of how this option changes the behaviour of PCRE2 are given in
+       This  option  causes  PCRE2  to regard both the pattern and the subject
+       strings that are subsequently processed as strings  of  UTF  characters
+       instead  of  single-code-unit  strings.  It  is available when PCRE2 is
+       built to include Unicode support (which is  the  default).  If  Unicode
+       support  is  not  available,  the use of this option provokes an error.
+       Details of how this option changes the behaviour of PCRE2 are given  in
        the pcre2unicode page.
 
 
 COMPILATION ERROR CODES
 
-       There are over 80 positive error codes that pcre2_compile() may  return
+       There  are over 80 positive error codes that pcre2_compile() may return
        if it finds an error in the pattern. There are also some negative error
-       codes that are used for invalid UTF strings.  These  are  the  same  as
-       given  by pcre2_match() and pcre2_dfa_match(), and are described in the
+       codes  that  are  used  for  invalid UTF strings. These are the same as
+       given by pcre2_match() and pcre2_dfa_match(), and are described in  the
        pcre2unicode page. The pcre2_get_error_message() function can be called
        to obtain a textual error message from any error code.
 
@@ -1415,53 +1487,53 @@ JUST-IN-TIME (JIT) COMPILATION
 
        void pcre2_jit_stack_free(pcre2_jit_stack *jit_stack);
 
-       These  functions  provide  support  for  JIT compilation, which, if the
-       just-in-time compiler is available, further processes a  compiled  pat-
+       These functions provide support for  JIT  compilation,  which,  if  the
+       just-in-time  compiler  is available, further processes a compiled pat-
        tern into machine code that executes much faster than the pcre2_match()
-       interpretive matching function. Full details are given in the  pcre2jit
+       interpretive  matching function. Full details are given in the pcre2jit
        documentation.
 
-       JIT  compilation  is  a heavyweight optimization. It can take some time
-       for patterns to be analyzed, and for one-off matches  and  simple  pat-
-       terns  the benefit of faster execution might be offset by a much slower
-       compilation time.  Most, but not all patterns can be optimized  by  the
+       JIT compilation is a heavyweight optimization. It can  take  some  time
+       for  patterns  to  be analyzed, and for one-off matches and simple pat-
+       terns the benefit of faster execution might be offset by a much  slower
+       compilation  time.   Most, but not all patterns can be optimized by the
        JIT compiler.
 
 
 LOCALE SUPPORT
 
-       PCRE2  handles caseless matching, and determines whether characters are
-       letters, digits, or whatever, by reference to a set of tables,  indexed
-       by  character  code  point.  This applies only to characters whose code
-       points are less than 256. By default, higher-valued code  points  never
-       match  escapes  such  as \w or \d.  However, if PCRE2 is built with UTF
-       support, all characters can be tested with  \p  and  \P,  or,  alterna-
-       tively,  the  PCRE2_UCP  option  can be set when a pattern is compiled;
-       this causes \w and friends to use Unicode property support  instead  of
+       PCRE2 handles caseless matching, and determines whether characters  are
+       letters,  digits, or whatever, by reference to a set of tables, indexed
+       by character code point. This applies only  to  characters  whose  code
+       points  are  less than 256. By default, higher-valued code points never
+       match escapes such as \w or \d.  However, if PCRE2 is  built  with  UTF
+       support,  all  characters  can  be  tested with \p and \P, or, alterna-
+       tively, the PCRE2_UCP option can be set when  a  pattern  is  compiled;
+       this  causes  \w and friends to use Unicode property support instead of
        the built-in tables.
 
-       The  use  of  locales  with Unicode is discouraged. If you are handling
-       characters with code points greater than 128,  you  should  either  use
+       The use of locales with Unicode is discouraged.  If  you  are  handling
+       characters  with  code  points  greater than 128, you should either use
        Unicode support, or use locales, but not try to mix the two.
 
-       PCRE2  contains  an  internal  set of character tables that are used by
-       default.  These are sufficient for  many  applications.  Normally,  the
+       PCRE2 contains an internal set of character tables  that  are  used  by
+       default.   These  are  sufficient  for many applications. Normally, the
        internal tables recognize only ASCII characters. However, when PCRE2 is
        built, it is possible to cause the internal tables to be rebuilt in the
        default "C" locale of the local system, which may cause them to be dif-
        ferent.
 
-       The internal tables can be overridden by tables supplied by the  appli-
-       cation  that  calls  PCRE2.  These may be created in a different locale
-       from the default.  As more and more applications change to  using  Uni-
+       The  internal tables can be overridden by tables supplied by the appli-
+       cation that calls PCRE2. These may be created  in  a  different  locale
+       from  the  default.  As more and more applications change to using Uni-
        code, the need for this locale support is expected to die away.
 
-       External  tables  are built by calling the pcre2_maketables() function,
-       in the relevant locale. The result can be passed to pcre2_compile()  as
-       often   as  necessary,  by  creating  a  compile  context  and  calling
-       pcre2_set_character_tables() to set the  tables  pointer  therein.  For
-       example,  to  build  and use tables that are appropriate for the French
-       locale (where accented characters with  values  greater  than  128  are
+       External tables are built by calling the  pcre2_maketables()  function,
+       in  the relevant locale. The result can be passed to pcre2_compile() as
+       often  as  necessary,  by  creating  a  compile  context  and   calling
+       pcre2_set_character_tables()  to  set  the  tables pointer therein. For
+       example, to build and use tables that are appropriate  for  the  French
+       locale  (where  accented  characters  with  values greater than 128 are
        treated as letters), the following code could be used:
 
          setlocale(LC_CTYPE, "fr_FR");
@@ -1470,15 +1542,15 @@ LOCALE SUPPORT
          pcre2_set_character_tables(ccontext, tables);
          re = pcre2_compile(..., ccontext);
 
-       The  locale  name "fr_FR" is used on Linux and other Unix-like systems;
-       if you are using Windows, the name for the French locale  is  "french".
-       It  is the caller's responsibility to ensure that the memory containing
+       The locale name "fr_FR" is used on Linux and other  Unix-like  systems;
+       if  you  are using Windows, the name for the French locale is "french".
+       It is the caller's responsibility to ensure that the memory  containing
        the tables remains available for as long as it is needed.
 
        The pointer that is passed (via the compile context) to pcre2_compile()
-       is  saved  with  the  compiled pattern, and the same tables are used by
-       pcre2_match() and pcre_dfa_match(). Thus, for any single pattern,  com-
-       pilation,  and  matching  all  happen in the same locale, but different
+       is saved with the compiled pattern, and the same  tables  are  used  by
+       pcre2_match()  and pcre_dfa_match(). Thus, for any single pattern, com-
+       pilation, and matching all happen in the  same  locale,  but  different
        patterns can be processed in different locales.
 
 
@@ -1486,13 +1558,13 @@ INFORMATION ABOUT A COMPILED PATTERN
 
        int pcre2_pattern_info(const pcre2 *code, uint32_t what, void *where);
 
-       The pcre2_pattern_info() function returns general information  about  a
+       The  pcre2_pattern_info()  function returns general information about a
        compiled pattern. For information about callouts, see the next section.
-       The first argument for pcre2_pattern_info() is a pointer  to  the  com-
+       The  first  argument  for pcre2_pattern_info() is a pointer to the com-
        piled pattern. The second argument specifies which piece of information
-       is required, and the third argument is  a  pointer  to  a  variable  to
-       receive  the data. If the third argument is NULL, the first argument is
-       ignored, and the function returns the size in  bytes  of  the  variable
+       is  required,  and  the  third  argument  is a pointer to a variable to
+       receive the data. If the third argument is NULL, the first argument  is
+       ignored,  and  the  function  returns the size in bytes of the variable
        that is required for the information requested. Otherwise, The yield of
        the function is zero for success, or one of the following negative num-
        bers:
@@ -1502,9 +1574,9 @@ INFORMATION ABOUT A COMPILED PATTERN
          PCRE2_ERROR_BADOPTION      the value of what was invalid
          PCRE2_ERROR_UNSET          the requested field is not set
 
-       The  "magic  number" is placed at the start of each compiled pattern as
-       an simple check against passing an arbitrary memory pointer. Here is  a
-       typical  call of pcre2_pattern_info(), to obtain the length of the com-
+       The "magic number" is placed at the start of each compiled  pattern  as
+       an  simple check against passing an arbitrary memory pointer. Here is a
+       typical call of pcre2_pattern_info(), to obtain the length of the  com-
        piled pattern:
 
          int rc;
@@ -1521,16 +1593,14 @@ INFORMATION ABOUT A COMPILED PATTERN
          PCRE2_INFO_ARGOPTIONS
 
        Return a copy of the pattern's options. The third argument should point
-       to a  uint32_t  variable.  PCRE2_INFO_ARGOPTIONS  returns  exactly  the
-       options  that were passed to pcre2_compile(), whereas PCRE2_INFO_ALLOP-
-       TIONS returns the compile options as modified by any  top-level  option
-       settings  at  the start of the pattern itself. In other words, they are
-       the options that will be in force when matching starts. For example, if
-       the  pattern  /(?im)abc(?-i)d/  is  compiled  with  the  PCRE2_EXTENDED
-       option,   the   result   is   PCRE2_CASELESS,   PCRE2_MULTILINE,    and
-       PCRE2_EXTENDED.
-
-       A  pattern compiled without PCRE2_ANCHORED is automatically anchored by
+       to  a  uint32_t  variable.  PCRE2_INFO_ARGOPTIONS  returns  exactly the
+       options that were passed to pcre2_compile(), whereas  PCRE2_INFO_ALLOP-
+       TIONS  returns  the compile options as modified by any top-level option
+       settings such as (*UTF) at the start of the pattern itself.  For  exam-
+       ple,  if  the  pattern  /(*UTF)abc/ is compiled with the PCRE2_EXTENDED
+       option, the result is PCRE2_EXTENDED and PCRE2_UTF.
+
+       A pattern compiled without PCRE2_ANCHORED is automatically anchored  by
        PCRE2 if the first significant item in every top-level branch is one of
        the following:
 
@@ -1539,7 +1609,7 @@ INFORMATION ABOUT A COMPILED PATTERN
          \G    always
          .*    sometimes - see below
 
-       When  .* is the first significant item, anchoring is possible only when
+       When .* is the first significant item, anchoring is possible only  when
        all the following are true:
 
          .* is not in an atomic group
@@ -1549,98 +1619,101 @@ INFORMATION ABOUT A COMPILED PATTERN
          Neither (*PRUNE) nor (*SKIP) appears in the pattern.
          PCRE2_NO_DOTSTAR_ANCHOR is not set.
 
-       For patterns that are auto-anchored, the PCRE2_ANCHORED bit is  set  in
+       For  patterns  that are auto-anchored, the PCRE2_ANCHORED bit is set in
        the options returned for PCRE2_INFO_ALLOPTIONS.
 
          PCRE2_INFO_BACKREFMAX
 
-       Return  the  number  of  the highest back reference in the pattern. The
-       third argument should point to an uint32_t variable. Named  subpatterns
-       acquire  numbers  as well as names, and these count towards the highest
-       back reference.  Back references such as \4 or \g{12}  match  the  cap-
-       tured  characters of the given group, but in addition, the check that a
+       Return the number of the highest back reference  in  the  pattern.  The
+       third  argument should point to an uint32_t variable. Named subpatterns
+       acquire numbers as well as names, and these count towards  the  highest
+       back  reference.   Back  references such as \4 or \g{12} match the cap-
+       tured characters of the given group, but in addition, the check that  a
        capturing group is set in a conditional subpattern such as (?(3)a|b) is
-       also  a  back  reference.  Zero is returned if there are no back refer-
+       also a back reference. Zero is returned if there  are  no  back  refer-
        ences.
 
          PCRE2_INFO_BSR
 
        The output is a uint32_t whose value indicates what character sequences
        the \R escape sequence matches. A value of PCRE2_BSR_UNICODE means that
-       \R matches any Unicode line ending sequence; a value of  PCRE2_BSR_ANY-
+       \R  matches any Unicode line ending sequence; a value of PCRE2_BSR_ANY-
        CRLF means that \R matches only CR, LF, or CRLF.
 
          PCRE2_INFO_CAPTURECOUNT
 
-       Return  the  number  of capturing subpatterns in the pattern. The third
-       argument should point to an uint32_t variable.
+       Return the highest capturing subpattern number in the pattern. In  pat-
+       terns where (?| is not used, this is also the total number of capturing
+       subpatterns.  The third argument should point to an uint32_t variable.
+
+         PCRE2_INFO_FIRSTBITMAP
+
+       In the absence of a single first code unit for a non-anchored  pattern,
+       pcre2_compile()  may construct a 256-bit table that defines a fixed set
+       of values for the first code unit in any match. For example, a  pattern
+       that  starts  with  [abc]  results in a table with three bits set. When
+       code unit values greater than 255 are supported, the flag bit  for  255
+       means  "any  code unit of value 255 or above". If such a table was con-
+       structed, a pointer to it is returned. Otherwise NULL is returned.  The
+       third argument should point to an const uint8_t * variable.
 
          PCRE2_INFO_FIRSTCODETYPE
 
        Return information about the first code unit of any matched string, for
-       a  non-anchored pattern. The third argument should point to an uint32_t
-       variable.
-
-       If there is a fixed first value, for example, the  letter  "c"  from  a
-       pattern  such  as  (cat|cow|coyote),  1  is returned, and the character
-       value can be retrieved using PCRE2_INFO_FIRSTCODEUNIT. If there  is  no
-       fixed  first  value, but it is known that a match can occur only at the
-       start of the subject or following  a  newline  in  the  subject,  2  is
+       a non-anchored pattern. The third argument should point to an  uint32_t
+       variable.  If there is a fixed first value, for example, the letter "c"
+       from a pattern such as (cat|cow|coyote), 1 is returned, and the charac-
+       ter  value can be retrieved using PCRE2_INFO_FIRSTCODEUNIT. If there is
+       no fixed first value, but it is known that a match can  occur  only  at
+       the  start  of  the subject or following a newline in the subject, 2 is
        returned. Otherwise, and for anchored patterns, 0 is returned.
 
          PCRE2_INFO_FIRSTCODEUNIT
 
-       Return  the  value  of the first code unit of any matched string in the
+       Return the value of the first code unit of any matched  string  in  the
        situation where PCRE2_INFO_FIRSTCODETYPE returns 1; otherwise return 0.
-       The  third  argument should point to an uint32_t variable. In the 8-bit
-       library, the value is always less than 256. In the 16-bit  library  the
-       value  can  be  up  to 0xffff. In the 32-bit library in UTF-32 mode the
+       The third argument should point to an uint32_t variable. In  the  8-bit
+       library,  the  value is always less than 256. In the 16-bit library the
+       value can be up to 0xffff. In the 32-bit library  in  UTF-32  mode  the
        value can be up to 0x10ffff, and up to 0xffffffff when not using UTF-32
        mode.
 
-         PCRE2_INFO_FIRSTBITMAP
+         PCRE2_INFO_HASBACKSLASHC
 
-       In  the absence of a single first code unit for a non-anchored pattern,
-       pcre2_compile() may construct a 256-bit table that defines a fixed  set
-       of  values for the first code unit in any match. For example, a pattern
-       that starts with [abc] results in a table with  three  bits  set.  When
-       code  unit  values greater than 255 are supported, the flag bit for 255
-       means "any code unit of value 255 or above". If such a table  was  con-
-       structed,  a pointer to it is returned. Otherwise NULL is returned. The
-       third argument should point to an const uint8_t * variable.
+       Return 1 if the pattern contains any instances of \C, otherwise 0.  The
+       third argument should point to an uint32_t variable.
 
          PCRE2_INFO_HASCRORLF
 
-       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 third argument should point to an uint32_t
-       variable. An explicit match is either a literal CR or LF character,  or
+       variable.  An explicit match is either a literal CR or LF character, or
        \r or \n.
 
          PCRE2_INFO_JCHANGED
 
-       Return  1  if  the (?J) or (?-J) option setting is used in the pattern,
-       otherwise 0. The third argument should point to an  uint32_t  variable.
-       (?J)  and  (?-J) set and unset the local PCRE2_DUPNAMES option, respec-
+       Return 1 if the (?J) or (?-J) option setting is used  in  the  pattern,
+       otherwise  0.  The third argument should point to an uint32_t variable.
+       (?J) and (?-J) set and unset the local PCRE2_DUPNAMES  option,  respec-
        tively.
 
          PCRE2_INFO_JITSIZE
 
-       If the compiled pattern was successfully  processed  by  pcre2_jit_com-
-       pile(),  return  the  size  of  the JIT compiled code, otherwise return
+       If  the  compiled  pattern was successfully processed by pcre2_jit_com-
+       pile(), return the size of the  JIT  compiled  code,  otherwise  return
        zero. The third argument should point to a size_t variable.
 
          PCRE2_INFO_LASTCODETYPE
 
-       Returns 1 if there is a rightmost literal code unit that must exist  in
-       any  matched string, other than at its start. The third argument should
-       point to an uint32_t  variable.  If  there  is  no  such  value,  0  is
-       returned.  When  1  is  returned,  the  code  unit  value itself can be
-       retrieved using PCRE2_INFO_LASTCODEUNIT.
-
-       For anchored patterns, a last literal value is recorded only if it fol-
-       lows  something  of  variable  length.  For  example,  for  the pattern
-       /^a\d+z\d+/  the  returned  value  is  1  (with   "z"   returned   from
-       PCRE2_INFO_LASTCODEUNIT), but for /^a\dz\d/ the returned value is 0.
+       Returns  1 if there is a rightmost literal code unit that must exist in
+       any matched string, other than at its start. The third argument  should
+       point  to  an  uint32_t  variable.  If  there  is  no  such value, 0 is
+       returned. When 1 is  returned,  the  code  unit  value  itself  can  be
+       retrieved  using PCRE2_INFO_LASTCODEUNIT. For anchored patterns, a last
+       literal value is recorded only if  it  follows  something  of  variable
+       length.  For example, for the pattern /^a\d+z\d+/ the returned value is
+       1 (with "z" returned from PCRE2_INFO_LASTCODEUNIT), but  for  /^a\dz\d/
+       the returned value is 0.
 
          PCRE2_INFO_LASTCODEUNIT
 
@@ -1651,38 +1724,41 @@ INFORMATION ABOUT A COMPILED PATTERN
 
          PCRE2_INFO_MATCHEMPTY
 
-       Return 1 if the pattern can match an empty  string,  otherwise  0.  The
-       third argument should point to an uint32_t variable.
+       Return 1 if the pattern might match an empty string, otherwise  0.  The
+       third  argument  should  point  to an uint32_t variable. When a pattern
+       contains recursive subroutine calls it is not always possible to deter-
+       mine  whether  or  not it can match an empty string. PCRE2 takes a cau-
+       tious approach and returns 1 in such cases.
 
          PCRE2_INFO_MATCHLIMIT
 
-       If  the  pattern  set  a  match  limit by including an item of the form
-       (*LIMIT_MATCH=nnnn) at the start, the  value  is  returned.  The  third
-       argument  should  point to an unsigned 32-bit integer. If no such value
-       has been set,  the  call  to  pcre2_pattern_info()  returns  the  error
+       If the pattern set a match limit by  including  an  item  of  the  form
+       (*LIMIT_MATCH=nnnn)  at  the  start,  the  value is returned. The third
+       argument should point to an unsigned 32-bit integer. If no  such  value
+       has  been  set,  the  call  to  pcre2_pattern_info()  returns the error
        PCRE2_ERROR_UNSET.
 
          PCRE2_INFO_MAXLOOKBEHIND
 
        Return the number of characters (not code units) in the longest lookbe-
-       hind assertion in the pattern. The third argument should  point  to  an
-       unsigned  32-bit  integer. This information is useful when doing multi-
-       segment matching using the partial matching facilities. Note  that  the
+       hind  assertion  in  the pattern. The third argument should point to an
+       unsigned 32-bit integer. This information is useful when  doing  multi-
+       segment  matching  using the partial matching facilities. Note that the
        simple assertions \b and \B require a one-character lookbehind. \A also
-       registers a one-character  lookbehind,  though  it  does  not  actually
-       inspect  the  previous  character.  This is to ensure that at least one
-       character from the old segment is retained when a new segment  is  pro-
+       registers  a  one-character  lookbehind,  though  it  does not actually
+       inspect the previous character. This is to ensure  that  at  least  one
+       character  from  the old segment is retained when a new segment is pro-
        cessed. Otherwise, if there are no lookbehinds in the pattern, \A might
        match incorrectly at the start of a new segment.
 
          PCRE2_INFO_MINLENGTH
 
-       If a minimum length for matching  subject  strings  was  computed,  its
-       value  is  returned.  Otherwise the returned value is 0. The value is a
-       number of characters, which in UTF mode may be different from the  num-
-       ber  of  code  units.   The  third argument should point to an uint32_t
-       variable. The value is a lower bound to  the  length  of  any  matching
-       string.  There  may  not be any strings of that length that do actually
+       If  a  minimum  length  for  matching subject strings was computed, its
+       value is returned. Otherwise the returned value is 0. The  value  is  a
+       number  of characters, which in UTF mode may be different from the num-
+       ber of code units.  The third argument  should  point  to  an  uint32_t
+       variable.  The  value  is  a  lower bound to the length of any matching
+       string. There may not be any strings of that length  that  do  actually
        match, but every string that does match is at least that long.
 
          PCRE2_INFO_NAMECOUNT
@@ -1690,50 +1766,50 @@ INFORMATION ABOUT A COMPILED PATTERN
          PCRE2_INFO_NAMETABLE
 
        PCRE2 supports the use of named as well as numbered capturing parenthe-
-       ses.  The names are just an additional way of identifying the parenthe-
+       ses. The names are just an additional way of identifying the  parenthe-
        ses, which still acquire numbers. Several convenience functions such as
-       pcre2_substring_get_byname()  are provided for extracting captured sub-
-       strings by name. It is also possible to extract the data  directly,  by
-       first  converting  the  name to a number in order to access the correct
-       pointers in the output vector (described with pcre2_match() below).  To
-       do  the  conversion,  you  need to use the name-to-number map, which is
+       pcre2_substring_get_byname() are provided for extracting captured  sub-
+       strings  by  name. It is also possible to extract the data directly, by
+       first converting the name to a number in order to  access  the  correct
+       pointers  in the output vector (described with pcre2_match() below). To
+       do the conversion, you need to use the  name-to-number  map,  which  is
        described by these three values.
 
-       The map consists of a number of  fixed-size  entries.  PCRE2_INFO_NAME-
-       COUNT  gives  the number of entries, and PCRE2_INFO_NAMEENTRYSIZE gives
-       the size of each entry in code units; both of these return  a  uint32_t
+       The  map  consists  of a number of fixed-size entries. PCRE2_INFO_NAME-
+       COUNT gives the number of entries, and  PCRE2_INFO_NAMEENTRYSIZE  gives
+       the  size  of each entry in code units; both of these return a uint32_t
        value. The entry size depends on the length of the longest name.
 
        PCRE2_INFO_NAMETABLE returns a pointer to the first entry of the table.
-       This is a PCRE2_SPTR pointer to a block of code  units.  In  the  8-bit
-       library,  the  first two bytes of each entry are the number of the cap-
+       This  is  a  PCRE2_SPTR  pointer to a block of code units. In the 8-bit
+       library, the first two bytes of each entry are the number of  the  cap-
        turing parenthesis, most significant byte first. In the 16-bit library,
-       the  pointer  points  to 16-bit code units, the first of which contains
-       the parenthesis number. In the 32-bit library, the  pointer  points  to
-       32-bit  code units, the first of which contains the parenthesis number.
+       the pointer points to 16-bit code units, the first  of  which  contains
+       the  parenthesis  number.  In the 32-bit library, the pointer points to
+       32-bit code units, the first of which contains the parenthesis  number.
        The rest of the entry is the corresponding name, zero terminated.
 
-       The names are in alphabetical order. If (?| is used to create  multiple
-       groups  with  the same number, as described in the section on duplicate
-       subpattern numbers in the pcre2pattern page, the groups  may  be  given
-       the  same  name,  but  there  is only one entry in the table. Different
+       The  names are in alphabetical order. If (?| is used to create multiple
+       groups with the same number, as described in the section  on  duplicate
+       subpattern  numbers  in  the pcre2pattern page, the groups may be given
+       the same name, but there is only one  entry  in  the  table.  Different
        names for groups of the same number are not permitted.
 
-       Duplicate names for subpatterns with different numbers  are  permitted,
-       but  only  if  PCRE2_DUPNAMES  is  set. They appear in the table in the
-       order in which they were found in the pattern. In the  absence  of  (?|
-       this  is  the  order of increasing number; when (?| is used this is not
+       Duplicate  names  for subpatterns with different numbers are permitted,
+       but only if PCRE2_DUPNAMES is set. They appear  in  the  table  in  the
+       order  in  which  they were found in the pattern. In the absence of (?|
+       this is the order of increasing number; when (?| is used  this  is  not
        necessarily the case because later subpatterns may have lower numbers.
 
-       As a simple example of the name/number table,  consider  the  following
-       pattern  after  compilation by the 8-bit library (assume PCRE2_EXTENDED
+       As  a  simple  example of the name/number table, consider the following
+       pattern after compilation by the 8-bit library  (assume  PCRE2_EXTENDED
        is set, so white space - including newlines - is ignored):
 
          (?<date> (?<year>(\d\d)?\d\d) -
          (?<month>\d\d) - (?<day>\d\d) )
 
-       There are four named subpatterns, so the table has  four  entries,  and
-       each  entry  in the table is eight bytes long. The table is as follows,
+       There  are  four  named subpatterns, so the table has four entries, and
+       each entry in the table is eight bytes long. The table is  as  follows,
        with non-printing bytes shows in hexadecimal, and undefined bytes shown
        as ??:
 
@@ -1742,8 +1818,8 @@ INFORMATION ABOUT A COMPILED PATTERN
          00 04 m  o  n  t  h  00
          00 02 y  e  a  r  00 ??
 
-       When  writing  code  to  extract  data from named subpatterns using the
-       name-to-number map, remember that the length of the entries  is  likely
+       When writing code to extract data  from  named  subpatterns  using  the
+       name-to-number  map,  remember that the length of the entries is likely
        to be different for each compiled pattern.
 
          PCRE2_INFO_NEWLINE
@@ -1756,27 +1832,27 @@ INFORMATION ABOUT A COMPILED PATTERN
          PCRE2_NEWLINE_ANY      Any Unicode line ending
          PCRE2_NEWLINE_ANYCRLF  Any of CR, LF, or CRLF
 
-       This  specifies  the default character sequence that will be recognized
+       This specifies the default character sequence that will  be  recognized
        as meaning "newline" while matching.
 
          PCRE2_INFO_RECURSIONLIMIT
 
-       If the pattern set a recursion limit by including an item of  the  form
-       (*LIMIT_RECURSION=nnnn)  at the start, the value is returned. The third
-       argument should point to an unsigned 32-bit integer. If no  such  value
-       has  been  set,  the  call  to  pcre2_pattern_info()  returns the error
+       If  the  pattern set a recursion limit by including an item of the form
+       (*LIMIT_RECURSION=nnnn) at the start, the value is returned. The  third
+       argument  should  point to an unsigned 32-bit integer. If no such value
+       has been set,  the  call  to  pcre2_pattern_info()  returns  the  error
        PCRE2_ERROR_UNSET.
 
          PCRE2_INFO_SIZE
 
-       Return the size of  the  compiled  pattern  in  bytes  (for  all  three
-       libraries).  The third argument should point to a size_t variable. This
-       value includes the size of the general data  block  that  precedes  the
-       code  units of the compiled pattern itself. The value that is used when
-       pcre2_compile() is getting memory in which to place the  compiled  pat-
-       tern  may  be  slightly  larger than the value returned by this option,
-       because there are cases where the code that calculates the size has  to
-       over-estimate.  Processing  a  pattern  with  the JIT compiler does not
+       Return  the  size  of  the  compiled  pattern  in  bytes (for all three
+       libraries). The third argument should point to a size_t variable.  This
+       value  includes  the  size  of the general data block that precedes the
+       code units of the compiled pattern itself. The value that is used  when
+       pcre2_compile()  is  getting memory in which to place the compiled pat-
+       tern may be slightly larger than the value  returned  by  this  option,
+       because  there are cases where the code that calculates the size has to
+       over-estimate. Processing a pattern with  the  JIT  compiler  does  not
        alter the value returned by this option.
 
 
@@ -1787,86 +1863,86 @@ INFORMATION ABOUT A PATTERN'S CALLOUTS
          void *user_data);
 
        A script language that supports the use of string arguments in callouts
-       might  like  to  scan  all the callouts in a pattern before running the
+       might like to scan all the callouts in a  pattern  before  running  the
        match. This can be done by calling pcre2_callout_enumerate(). The first
-       argument  is  a  pointer  to a compiled pattern, the second points to a
-       callback function, and the third is arbitrary user data.  The  callback
-       function  is  called  for  every callout in the pattern in the order in
+       argument is a pointer to a compiled pattern, the  second  points  to  a
+       callback  function,  and the third is arbitrary user data. The callback
+       function is called for every callout in the pattern  in  the  order  in
        which they appear. Its first argument is a pointer to a callout enumer-
-       ation  block,  and  its second argument is the user_data value that was
-       passed to pcre2_callout_enumerate(). The contents of the  callout  enu-
-       meration  block  are described in the pcre2callout documentation, which
+       ation block, and its second argument is the user_data  value  that  was
+       passed  to  pcre2_callout_enumerate(). The contents of the callout enu-
+       meration block are described in the pcre2callout  documentation,  which
        also gives further details about callouts.
 
 
 SERIALIZATION AND PRECOMPILING
 
-       It is possible to save compiled patterns  on  disc  or  elsewhere,  and
-       reload  them  later, subject to a number of restrictions. The functions
+       It  is  possible  to  save  compiled patterns on disc or elsewhere, and
+       reload them later, subject to a number of restrictions.  The  functions
        whose names begin with pcre2_serialize_ are used for this purpose. They
        are described in the pcre2serialize documentation.
 
 
 THE MATCH DATA BLOCK
 
-       pcre2_match_data_create(uint32_t ovecsize,
+       pcre2_match_data *pcre2_match_data_create(uint32_t ovecsize,
          pcre2_general_context *gcontext);
 
-       pcre2_match_data_create_from_pattern(const pcre2_code *code,
-         pcre2_general_context *gcontext);
+       pcre2_match_data *pcre2_match_data_create_from_pattern(
+         const pcre2_code *code, pcre2_general_context *gcontext);
 
        void pcre2_match_data_free(pcre2_match_data *match_data);
 
-       Information  about  a  successful  or unsuccessful match is placed in a
-       match data block, which is an opaque  structure  that  is  accessed  by
-       function  calls.  In particular, the match data block contains a vector
-       of offsets into the subject string that define the matched part of  the
-       subject  and  any  substrings  that  were captured. This is know as the
+       Information about a successful or unsuccessful match  is  placed  in  a
+       match  data  block,  which  is  an opaque structure that is accessed by
+       function calls. In particular, the match data block contains  a  vector
+       of  offsets into the subject string that define the matched part of the
+       subject and any substrings that were captured.  This  is  know  as  the
        ovector.
 
-       Before calling pcre2_match(), pcre2_dfa_match(),  or  pcre2_jit_match()
+       Before  calling  pcre2_match(), pcre2_dfa_match(), or pcre2_jit_match()
        you must create a match data block by calling one of the creation func-
-       tions above. For pcre2_match_data_create(), the first argument  is  the
-       number  of  pairs  of  offsets  in  the ovector. One pair of offsets is
-       required to identify the string that matched the  whole  pattern,  with
-       another  pair  for  each  captured substring. For example, a value of 4
-       creates enough space to record the matched portion of the subject  plus
-       three  captured  substrings. A minimum of at least 1 pair is imposed by
+       tions  above.  For pcre2_match_data_create(), the first argument is the
+       number of pairs of offsets in the  ovector.  One  pair  of  offsets  is
+       required  to  identify  the string that matched the whole pattern, with
+       another pair for each captured substring. For example,  a  value  of  4
+       creates  enough space to record the matched portion of the subject plus
+       three captured substrings. A minimum of at least 1 pair is  imposed  by
        pcre2_match_data_create(), so it is always possible to return the over-
        all matched string.
 
        The second argument of pcre2_match_data_create() is a pointer to a gen-
-       eral context, which can specify custom memory management for  obtaining
+       eral  context, which can specify custom memory management for obtaining
        the memory for the match data block. If you are not using custom memory
        management, pass NULL, which causes malloc() to be used.
 
-       For pcre2_match_data_create_from_pattern(), the  first  argument  is  a
+       For  pcre2_match_data_create_from_pattern(),  the  first  argument is a
        pointer to a compiled pattern. The ovector is created to be exactly the
        right size to hold all the substrings a pattern might capture. The sec-
-       ond  argument is again a pointer to a general context, but in this case
+       ond argument is again a pointer to a general context, but in this  case
        if NULL is passed, the memory is obtained using the same allocator that
        was used for the compiled pattern (custom or default).
 
-       A  match  data block can be used many times, with the same or different
-       compiled patterns. You can extract information from a match data  block
+       A match data block can be used many times, with the same  or  different
+       compiled  patterns. You can extract information from a match data block
        after  a  match  operation  has  finished,  using  functions  that  are
-       described in the sections on  matched  strings  and  other  match  data
+       described  in  the  sections  on  matched  strings and other match data
        below.
 
-       When  a  call  of  pcre2_match()  fails, valid data is available in the
-       match   block   only   when   the   error    is    PCRE2_ERROR_NOMATCH,
-       PCRE2_ERROR_PARTIAL,  or  one  of  the  error  codes for an invalid UTF
+       When a call of pcre2_match() fails, valid  data  is  available  in  the
+       match    block    only   when   the   error   is   PCRE2_ERROR_NOMATCH,
+       PCRE2_ERROR_PARTIAL, or one of the  error  codes  for  an  invalid  UTF
        string. Exactly what is available depends on the error, and is detailed
        below.
 
-       When  one of the matching functions is called, pointers to the compiled
-       pattern and the subject string are set in the match data block so  that
-       they  can  be  referenced  by the extraction functions. After running a
-       match, you must not free a compiled pattern or a subject  string  until
-       after  all  operations  on  the  match data block (for that match) have
+       When one of the matching functions is called, pointers to the  compiled
+       pattern  and the subject string are set in the match data block so that
+       they can be referenced by the extraction  functions.  After  running  a
+       match,  you  must not free a compiled pattern or a subject string until
+       after all operations on the match data  block  (for  that  match)  have
        taken place.
 
-       When a match data block itself is no longer needed, it should be  freed
+       When  a match data block itself is no longer needed, it should be freed
        by calling pcre2_match_data_free().
 
 
@@ -1877,15 +1953,15 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
          uint32_t options, pcre2_match_data *match_data,
          pcre2_match_context *mcontext);
 
-       The  function pcre2_match() is called to match a subject string against
-       a compiled pattern, which is passed in the code argument. You can  call
+       The function pcre2_match() is called to match a subject string  against
+       a  compiled pattern, which is passed in the code argument. You can call
        pcre2_match() with the same code argument as many times as you like, in
-       order to find multiple matches in the subject string or to  match  dif-
+       order  to  find multiple matches in the subject string or to match dif-
        ferent subject strings with the same pattern.
 
-       This  function  is  the  main  matching facility of the library, and it
-       operates in a Perl-like manner. For specialist use  there  is  also  an
-       alternative  matching function, which is described below in the section
+       This function is the main matching facility  of  the  library,  and  it
+       operates  in  a  Perl-like  manner. For specialist use there is also an
+       alternative matching function, which is described below in the  section
        about the pcre2_dfa_match() function.
 
        Here is an example of a simple call to pcre2_match():
@@ -1900,163 +1976,171 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
            match_data,     /* the match data block */
            NULL);          /* a match context; NULL means use defaults */
 
-       If the subject string is zero-terminated, the length can  be  given  as
+       If  the  subject  string is zero-terminated, the length can be given as
        PCRE2_ZERO_TERMINATED. A match context must be provided if certain less
        common matching parameters are to be changed. For details, see the sec-
        tion on the match context above.
 
    The string to be matched by pcre2_match()
 
-       The  subject string is passed to pcre2_match() as a pointer in subject,
-       a length in length, and a starting offset in  startoffset.  The  length
-       and  offset  are  in  code units, not characters.  That is, they are in
-       bytes for the 8-bit library, 16-bit code units for the 16-bit  library,
-       and  32-bit  code units for the 32-bit library, whether or not UTF pro-
+       The subject string is passed to pcre2_match() as a pointer in  subject,
+       a  length  in  length, and a starting offset in startoffset. The length
+       and offset are in code units, not characters.  That  is,  they  are  in
+       bytes  for the 8-bit library, 16-bit code units for the 16-bit library,
+       and 32-bit code units for the 32-bit library, whether or not  UTF  pro-
        cessing is enabled.
 
        If startoffset is greater than the length of the subject, pcre2_match()
-       returns  PCRE2_ERROR_BADOFFSET.  When  the starting offset is zero, the
-       search for a match starts at the beginning of the subject, and this  is
+       returns PCRE2_ERROR_BADOFFSET. When the starting offset  is  zero,  the
+       search  for a match starts at the beginning of the subject, and this is
        by far the most common case. In UTF-8 or UTF-16 mode, the starting off-
-       set must point to the start of a character, or to the end of  the  sub-
-       ject  (in  UTF-32 mode, one code unit equals one character, so all off-
-       sets are valid). Like the  pattern  string,  the  subject  may  contain
+       set  must  point to the start of a character, or to the end of the sub-
+       ject (in UTF-32 mode, one code unit equals one character, so  all  off-
+       sets  are  valid).  Like  the  pattern  string, the subject may contain
        binary zeroes.
 
-       A  non-zero  starting offset is useful when searching for another match
-       in the same subject by calling pcre2_match()  again  after  a  previous
-       success.   Setting  startoffset  differs  from passing over a shortened
-       string and setting PCRE2_NOTBOL in the case of a  pattern  that  begins
+       A non-zero starting offset is useful when searching for  another  match
+       in  the  same  subject  by calling pcre2_match() again after a previous
+       success.  Setting startoffset differs from  passing  over  a  shortened
+       string  and  setting  PCRE2_NOTBOL in the case of a pattern that begins
        with any kind of lookbehind. For example, consider the pattern
 
          \Biss\B
 
-       which  finds  occurrences  of "iss" in the middle of words. (\B matches
-       only if the current position in the subject is not  a  word  boundary.)
+       which finds occurrences of "iss" in the middle of  words.  (\B  matches
+       only  if  the  current position in the subject is not a word boundary.)
        When applied to the string "Mississipi" the first call to pcre2_match()
-       finds the first occurrence. If pcre2_match() is called again with  just
-       the  remainder  of  the  subject,  namely  "issipi", it does not match,
+       finds  the first occurrence. If pcre2_match() is called again with just
+       the remainder of the subject,  namely  "issipi",  it  does  not  match,
        because \B is always false at the start of the subject, which is deemed
-       to  be  a word boundary. However, if pcre2_match() is passed the entire
+       to be a word boundary. However, if pcre2_match() is passed  the  entire
        string again, but with startoffset set to 4, it finds the second occur-
-       rence  of "iss" because it is able to look behind the starting point to
+       rence of "iss" because it is able to look behind the starting point  to
        discover that it is preceded by a letter.
 
-       Finding all the matches in a subject is tricky  when  the  pattern  can
+       Finding  all  the  matches  in a subject is tricky when the pattern can
        match an empty string. It is possible to emulate Perl's /g behaviour by
-       first  trying  the  match  again  at  the   same   offset,   with   the
-       PCRE2_NOTEMPTY_ATSTART  and  PCRE2_ANCHORED  options,  and then if that
-       fails, advancing the starting  offset  and  trying  an  ordinary  match
-       again.  There  is  some  code  that  demonstrates how to do this in the
-       pcre2demo sample program. In the most general case, you have  to  check
-       to  see  if the newline convention recognizes CRLF as a newline, and if
-       so, and the current character is CR followed by LF, advance the  start-
+       first   trying   the   match   again  at  the  same  offset,  with  the
+       PCRE2_NOTEMPTY_ATSTART and PCRE2_ANCHORED options,  and  then  if  that
+       fails,  advancing  the  starting  offset  and  trying an ordinary match
+       again. There is some code that demonstrates  how  to  do  this  in  the
+       pcre2demo  sample  program. In the most general case, you have to check
+       to see if the newline convention recognizes CRLF as a newline,  and  if
+       so,  and the current character is CR followed by LF, advance the start-
        ing offset by two characters instead of one.
 
-       If  a  non-zero starting offset is passed when the pattern is anchored,
+       If a non-zero starting offset is passed when the pattern  is  anchored,
        one attempt to match at the given offset is made. This can only succeed
-       if  the  pattern  does  not require the match to be at the start of the
+       if the pattern does not require the match to be at  the  start  of  the
        subject.
 
    Option bits for pcre2_match()
 
        The unused bits of the options argument for pcre2_match() must be zero.
-       The  only  bits  that  may  be  set  are  PCRE2_ANCHORED, PCRE2_NOTBOL,
+       The only  bits  that  may  be  set  are  PCRE2_ANCHORED,  PCRE2_NOTBOL,
        PCRE2_NOTEOL,          PCRE2_NOTEMPTY,          PCRE2_NOTEMPTY_ATSTART,
-       PCRE2_NO_UTF_CHECK,  PCRE2_PARTIAL_HARD,  and PCRE2_PARTIAL_SOFT. Their
+       PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, and  PCRE2_PARTIAL_SOFT.  Their
        action is described below.
 
-       Setting PCRE2_ANCHORED at match time is not supported by  the  just-in-
-       time  (JIT)  compiler.  If  it is set, JIT matching is disabled and the
+       Setting  PCRE2_ANCHORED  at match time is not supported by the just-in-
+       time (JIT) compiler. If it is set, JIT matching  is  disabled  and  the
        normal interpretive code in pcre2_match() is run. The remaining options
        are supported for JIT matching.
 
          PCRE2_ANCHORED
 
        The PCRE2_ANCHORED option limits pcre2_match() to matching at the first
-       matching position. If a pattern was compiled  with  PCRE2_ANCHORED,  or
-       turned  out to be anchored by virtue of its contents, it cannot be made
-       unachored at matching time. Note that setting the option at match  time
+       matching  position.  If  a pattern was compiled with PCRE2_ANCHORED, or
+       turned out to be anchored by virtue of its contents, it cannot be  made
+       unachored  at matching time. Note that setting the option at match time
        disables JIT matching.
 
          PCRE2_NOTBOL
 
        This option specifies that first character of the subject string is not
-       the beginning of a line, so the  circumflex  metacharacter  should  not
-       match  before  it.  Setting  this without having set PCRE2_MULTILINE at
+       the  beginning  of  a  line, so the circumflex metacharacter should not
+       match before it. Setting this without  having  set  PCRE2_MULTILINE  at
        compile time causes circumflex never to match. This option affects only
        the behaviour of the circumflex metacharacter. It does not affect \A.
 
          PCRE2_NOTEOL
 
        This option specifies that the end of the subject string is not the end
-       of a line, so the dollar metacharacter should not match it nor  (except
-       in  multiline mode) a newline immediately before it. Setting this with-
-       out having set PCRE2_MULTILINE at compile time causes dollar  never  to
+       of  a line, so the dollar metacharacter should not match it nor (except
+       in multiline mode) a newline immediately before it. Setting this  with-
+       out  having  set PCRE2_MULTILINE at compile time causes dollar never to
        match. This option affects only the behaviour of the dollar metacharac-
        ter. It does not affect \Z or \z.
 
          PCRE2_NOTEMPTY
 
        An empty string is not considered to be a valid match if this option is
-       set.  If  there are alternatives in the pattern, they are tried. If all
-       the alternatives match the empty string, the entire  match  fails.  For
+       set. If there are alternatives in the pattern, they are tried.  If  all
+       the  alternatives  match  the empty string, the entire match fails. For
        example, if the pattern
 
          a?b?
 
-       is  applied  to  a  string not beginning with "a" or "b", it matches an
+       is applied to a string not beginning with "a" or  "b",  it  matches  an
        empty string at the start of the subject. With PCRE2_NOTEMPTY set, this
-       match  is  not valid, so pcre2_match() searches further into the string
+       match is not valid, so pcre2_match() searches further into  the  string
        for occurrences of "a" or "b".
 
          PCRE2_NOTEMPTY_ATSTART
 
-       This is like PCRE2_NOTEMPTY, except that it locks out an  empty  string
+       This  is  like PCRE2_NOTEMPTY, except that it locks out an empty string
        match only at the first matching position, that is, at the start of the
-       subject plus the starting offset. An empty string match  later  in  the
-       subject  is  permitted.   If  the pattern is anchored, such a match can
+       subject  plus  the  starting offset. An empty string match later in the
+       subject is permitted.  If the pattern is anchored,  such  a  match  can
        occur only if the pattern contains \K.
 
          PCRE2_NO_UTF_CHECK
 
        When PCRE2_UTF is set at compile time, the validity of the subject as a
-       UTF  string  is  checked  by default when pcre2_match() is subsequently
-       called.  The entire string is checked before any other processing takes
-       place,  and a negative error code is returned if the check fails. There
-       are several UTF error codes for each code unit width, corresponding  to
-       different  problems with the code unit sequence. The value of startoff-
-       set is also checked, to ensure that it points to the start of a charac-
-       ter  or  to  the  end  of  the subject. There are discussions about the
-       validity of UTF-8 strings, UTF-16 strings, and UTF-32  strings  in  the
+       UTF string is checked by default  when  pcre2_match()  is  subsequently
+       called.   If  a non-zero starting offset is given, the check is applied
+       only to that part of the subject that could be inspected during  match-
+       ing,  and there is a check that the starting offset points to the first
+       code unit of a character or to the end of the subject. If there are  no
+       lookbehind  assertions in the pattern, the check starts at the starting
+       offset. Otherwise, it starts at the length of  the  longest  lookbehind
+       before the starting offset, or at the start of the subject if there are
+       not that many characters before the  starting  offset.  Note  that  the
+       sequences \b and \B are one-character lookbehinds.
+
+       The check is carried out before any other processing takes place, and a
+       negative error code is returned if the check fails. There  are  several
+       UTF  error  codes  for each code unit width, corresponding to different
+       problems with the code unit sequence. There are discussions  about  the
+       validity  of  UTF-8  strings, UTF-16 strings, and UTF-32 strings in the
        pcre2unicode page.
 
-       If  you  know  that  your  subject is valid, and you want to skip these
-       checks for performance reasons,  you  can  set  the  PCRE2_NO_UTF_CHECK
-       option  when  calling  pcre2_match(). You might want to do this for the
+       If you know that your subject is valid, and  you  want  to  skip  these
+       checks  for  performance  reasons,  you  can set the PCRE2_NO_UTF_CHECK
+       option when calling pcre2_match(). You might want to do  this  for  the
        second and subsequent calls to pcre2_match() if you are making repeated
        calls to find all the matches in a single subject string.
 
-       NOTE:  When PCRE2_NO_UTF_CHECK is set, the effect of passing an invalid
-       string as a subject, or an invalid value of startoffset, is  undefined.
+       NOTE: When PCRE2_NO_UTF_CHECK is set, the effect of passing an  invalid
+       string  as a subject, or an invalid value of startoffset, is undefined.
        Your program may crash or loop indefinitely.
 
          PCRE2_PARTIAL_HARD
          PCRE2_PARTIAL_SOFT
 
-       These  options  turn  on  the partial matching feature. A partial match
-       occurs if the end of the subject string is  reached  successfully,  but
-       there  are not enough subject characters to complete the match. If this
-       happens when PCRE2_PARTIAL_SOFT (but not  PCRE2_PARTIAL_HARD)  is  set,
-       matching  continues  by  testing any remaining alternatives. Only if no
-       complete match can be found is PCRE2_ERROR_PARTIAL returned instead  of
-       PCRE2_ERROR_NOMATCH.  In other words, PCRE2_PARTIAL_SOFT specifies that
-       the caller is prepared to handle a partial match, but only if  no  com-
+       These options turn on the partial matching  feature.  A  partial  match
+       occurs  if  the  end of the subject string is reached successfully, but
+       there are not enough subject characters to complete the match. If  this
+       happens  when  PCRE2_PARTIAL_SOFT  (but not PCRE2_PARTIAL_HARD) is set,
+       matching continues by testing any remaining alternatives.  Only  if  no
+       complete  match can be found is PCRE2_ERROR_PARTIAL returned instead of
+       PCRE2_ERROR_NOMATCH. In other words, PCRE2_PARTIAL_SOFT specifies  that
+       the  caller  is prepared to handle a partial match, but only if no com-
        plete match can be found.
 
-       If  PCRE2_PARTIAL_HARD is set, it overrides PCRE2_PARTIAL_SOFT. In this
-       case, if a partial match is found,  pcre2_match()  immediately  returns
-       PCRE2_ERROR_PARTIAL,  without  considering  any  other alternatives. In
+       If PCRE2_PARTIAL_HARD is set, it overrides PCRE2_PARTIAL_SOFT. In  this
+       case,  if  a  partial match is found, pcre2_match() immediately returns
+       PCRE2_ERROR_PARTIAL, without considering  any  other  alternatives.  In
        other words, when PCRE2_PARTIAL_HARD is set, a partial match is consid-
        ered to be more important that an alternative complete match.
 
@@ -2066,12 +2150,15 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
 
 NEWLINE HANDLING WHEN MATCHING
 
-       When PCRE2 is built, a default newline convention is set; this is  usu-
-       ally  the standard convention for the operating system. The default can
-       be overridden in a  compile  context.   During  matching,  the  newline
-       choice  affects  the  behaviour  of  the  dot,  circumflex,  and dollar
-       metacharacters. It may also alter the way the match  starting  position
-       is advanced after a match failure for an unanchored pattern.
+       When  PCRE2 is built, a default newline convention is set; this is usu-
+       ally the standard convention for the operating system. The default  can
+       be  overridden  in a compile context by calling pcre2_set_newline(). It
+       can also be overridden by starting a pattern string with, for  example,
+       (*CRLF),  as  described  in  the  section on newline conventions in the
+       pcre2pattern page. During matching, the newline choice affects the  be-
+       haviour  of the dot, circumflex, and dollar metacharacters. It may also
+       alter the way the match starting position is  advanced  after  a  match
+       failure for an unanchored pattern.
 
        When PCRE2_NEWLINE_CRLF, PCRE2_NEWLINE_ANYCRLF, or PCRE2_NEWLINE_ANY is
        set as the newline convention, and a match attempt  for  an  unanchored
@@ -2114,74 +2201,75 @@ HOW PCRE2_MATCH() RETURNS A STRING AND CAPTURED SUBSTRINGS
        be captured. The pcre2_pattern_info() function can be used to find  out
        how many capturing subpatterns there are in a compiled pattern.
 
-       A  successful match returns the overall matched string and any captured
-       substrings to the caller via a vector of  PCRE2_SIZE  values.  This  is
-       called  the ovector, and is contained within the match data block.  You
-       can obtain direct access to  the  ovector  by  calling  pcre2_get_ovec-
-       tor_pointer()  to  find  its  address, and pcre2_get_ovector_count() to
-       find the number of pairs of values it contains. Alternatively, you  can
-       use the auxiliary functions for accessing captured substrings by number
-       or by name (see below).
+       You  can  use  auxiliary functions for accessing captured substrings by
+       number or by name, as described in sections below.
+
+       Alternatively, you can make direct use of the vector of PCRE2_SIZE val-
+       ues,  called  the  ovector,  which  contains  the  offsets  of captured
+       strings.  It  is  part  of  the  match  data   block.    The   function
+       pcre2_get_ovector_pointer()  returns  the  address  of the ovector, and
+       pcre2_get_ovector_count() returns the number of pairs of values it con-
+       tains.
 
        Within the ovector, the first in each pair of values is set to the off-
        set of the first code unit of a substring, and the second is set to the
-       offset of the first code unit after the end of a substring. These  val-
-       ues  are always code unit offsets, not character offsets. That is, they
-       are byte offsets in the 8-bit library, 16-bit  offsets  in  the  16-bit
+       offset  of the first code unit after the end of a substring. These val-
+       ues are always code unit offsets, not character offsets. That is,  they
+       are  byte  offsets  in  the 8-bit library, 16-bit offsets in the 16-bit
        library, and 32-bit offsets in the 32-bit library.
 
-       After  a  partial  match  (error  return PCRE2_ERROR_PARTIAL), only the
-       first pair of offsets (that is, ovector[0]  and  ovector[1])  are  set.
-       They  identify  the part of the subject that was partially matched. See
+       After a partial match  (error  return  PCRE2_ERROR_PARTIAL),  only  the
+       first  pair  of  offsets  (that is, ovector[0] and ovector[1]) are set.
+       They identify the part of the subject that was partially  matched.  See
        the pcre2partial documentation for details of partial matching.
 
        After a successful match, the first pair of offsets identifies the por-
-       tion  of the subject string that was matched by the entire pattern. The
-       next pair is used for the first capturing subpattern, and  so  on.  The
-       value  returned  by pcre2_match() is one more than the highest numbered
-       pair that has been set. For example, if two substrings have  been  cap-
-       tured,  the returned value is 3. If there are no capturing subpatterns,
+       tion of the subject string that was matched by the entire pattern.  The
+       next  pair  is  used for the first capturing subpattern, and so on. The
+       value returned by pcre2_match() is one more than the  highest  numbered
+       pair  that  has been set. For example, if two substrings have been cap-
+       tured, the returned value is 3. If there are no capturing  subpatterns,
        the return value from a successful match is 1, indicating that just the
        first pair of offsets has been set.
 
-       If  a  pattern uses the \K escape sequence within a positive assertion,
+       If a pattern uses the \K escape sequence within a  positive  assertion,
        the reported start of a successful match can be greater than the end of
-       the  match.   For  example,  if the pattern (?=ab\K) is matched against
+       the match.  For example, if the pattern  (?=ab\K)  is  matched  against
        "ab", the start and end offset values for the match are 2 and 0.
 
-       If a capturing subpattern group is matched repeatedly within  a  single
-       match  operation, it is the last portion of the subject that it matched
+       If  a  capturing subpattern group is matched repeatedly within a single
+       match operation, it is the last portion of the subject that it  matched
        that is returned.
 
        If the ovector is too small to hold all the captured substring offsets,
-       as  much  as possible is filled in, and the function returns a value of
-       zero. If captured substrings are not of interest, pcre2_match() may  be
+       as much as possible is filled in, and the function returns a  value  of
+       zero.  If captured substrings are not of interest, pcre2_match() may be
        called with a match data block whose ovector is of minimum length (that
        is, one pair). However, if the pattern contains back references and the
        ovector is not big enough to remember the related substrings, PCRE2 has
-       to get additional memory for use during matching. Thus  it  is  usually
+       to  get  additional  memory for use during matching. Thus it is usually
        advisable to set up a match data block containing an ovector of reason-
        able size.
 
-       It is possible for capturing subpattern number n+1 to match  some  part
+       It  is  possible for capturing subpattern number n+1 to match some part
        of the subject when subpattern n has not been used at all. For example,
-       if the string "abc" is matched  against  the  pattern  (a|(z))(bc)  the
+       if  the  string  "abc"  is  matched against the pattern (a|(z))(bc) the
        return from the function is 4, and subpatterns 1 and 3 are matched, but
-       2 is not. When this happens, both values in  the  offset  pairs  corre-
+       2  is  not.  When  this happens, both values in the offset pairs corre-
        sponding to unused subpatterns are set to PCRE2_UNSET.
 
-       Offset  values  that correspond to unused subpatterns at the end of the
-       expression are also set to PCRE2_UNSET.  For  example,  if  the  string
+       Offset values that correspond to unused subpatterns at the end  of  the
+       expression  are  also  set  to  PCRE2_UNSET. For example, if the string
        "abc" is matched against the pattern (abc)(x(yz)?)? subpatterns 2 and 3
-       are not matched.  The return from the function is 2, because the  high-
+       are  not matched.  The return from the function is 2, because the high-
        est used capturing subpattern number is 1. The offsets for for the sec-
-       ond and third capturing  subpatterns  (assuming  the  vector  is  large
+       ond  and  third  capturing  subpatterns  (assuming  the vector is large
        enough, of course) are set to PCRE2_UNSET.
 
        Elements in the ovector that do not correspond to capturing parentheses
        in the pattern are never changed. That is, if a pattern contains n cap-
        turing parentheses, no more than ovector[0] to ovector[2n+1] are set by
-       pcre2_match(). The other elements retain whatever  values  they  previ-
+       pcre2_match().  The  other  elements retain whatever values they previ-
        ously had.
 
 
@@ -2191,19 +2279,24 @@ OTHER INFORMATION ABOUT A MATCH
 
        PCRE2_SIZE pcre2_get_startchar(pcre2_match_data *match_data);
 
-       As  well as the offsets in the ovector, other information about a match
-       is retained in the match data block and can be retrieved by  the  above
-       functions  in  appropriate  circumstances.  If they are called at other
+       As well as the offsets in the ovector, other information about a  match
+       is  retained  in the match data block and can be retrieved by the above
+       functions in appropriate circumstances. If they  are  called  at  other
        times, the result is undefined.
 
-       After a successful match, a partial match (PCRE2_ERROR_PARTIAL),  or  a
-       failure  to  match  (PCRE2_ERROR_NOMATCH), a (*MARK) name may be avail-
-       able, and pcre2_get_mark() can be called. It returns a pointer  to  the
-       zero-terminated  name,  which is within the compiled pattern. Otherwise
-       NULL is returned. After a successful match, the (*MARK)  name  that  is
-       returned  is  the last one encountered on the matching path through the
-       pattern. After a "no match" or a partial match,  the  last  encountered
-       (*MARK) name is returned. For example, consider this pattern:
+       After  a  successful match, a partial match (PCRE2_ERROR_PARTIAL), or a
+       failure to match (PCRE2_ERROR_NOMATCH), a (*MARK) name  may  be  avail-
+       able,  and  pcre2_get_mark() can be called. It returns a pointer to the
+       zero-terminated name, which is within the compiled  pattern.  Otherwise
+       NULL  is returned. The length of the (*MARK) name (excluding the termi-
+       nating zero) is stored in the code unit that  preceeds  the  name.  You
+       should  use  this  instead  of  relying  on the terminating zero if the
+       (*MARK) name might contain a binary zero.
+
+       After a successful match, the (*MARK) name that is returned is the last
+       one  encountered  on the matching path through the pattern. After a "no
+       match" or a  partial  match,  the  last  encountered  (*MARK)  name  is
+       returned. For example, consider this pattern:
 
          ^(*MARK:A)((*MARK:B)a|b)c
 
@@ -2514,58 +2607,194 @@ CREATING A NEW STRING WITH SUBSTITUTIONS
        int pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject,
          PCRE2_SIZE length, PCRE2_SIZE startoffset,
          uint32_t options, pcre2_match_data *match_data,
-         pcre2_match_context *mcontext, PCRE2_SPTR replacementzfP,
+         pcre2_match_context *mcontext, PCRE2_SPTR replacement,
          PCRE2_SIZE rlength, PCRE2_UCHAR *outputbufferP,
          PCRE2_SIZE *outlengthptr);
+
        This function calls pcre2_match() and then makes a copy of the  subject
        string  in  outputbuffer,  replacing the part that was matched with the
        replacement string, whose length is supplied in rlength.  This  can  be
-       given as PCRE2_ZERO_TERMINATED for a zero-terminated string.
+       given as PCRE2_ZERO_TERMINATED for a zero-terminated string. Matches in
+       which a \K item in a lookahead in the pattern causes the match  to  end
+       before it starts are not supported, and give rise to an error return.
+
+       The  first  seven  arguments  of pcre2_substitute() are the same as for
+       pcre2_match(), except that the partial matching options are not permit-
+       ted,  and  match_data may be passed as NULL, in which case a match data
+       block is obtained and freed within this function, using memory  manage-
+       ment  functions from the match context, if provided, or else those that
+       were used to allocate memory for the compiled code.
+
+       The outlengthptr argument must point to a variable  that  contains  the
+       length,  in  code  units, of the output buffer. If the function is suc-
+       cessful, the value is updated to contain the length of the new  string,
+       excluding the trailing zero that is automatically added.
+
+       If  the  function  is  not  successful,  the value set via outlengthptr
+       depends on the type of error. For  syntax  errors  in  the  replacement
+       string,  the  value  is  the offset in the replacement string where the
+       error was detected. For other  errors,  the  value  is  PCRE2_UNSET  by
+       default.  This  includes the case of the output buffer being too small,
+       unless PCRE2_SUBSTITUTE_OVERFLOW_LENGTH is set (see  below),  in  which
+       case  the  value  is the minimum length needed, including space for the
+       trailing zero. Note that in  order  to  compute  the  required  length,
+       pcre2_substitute()  has  to  simulate  all  the  matching  and copying,
+       instead of giving an error return as soon as the buffer overflows. Note
+       also that the length is in code units, not bytes.
 
        In  the replacement string, which is interpreted as a UTF string in UTF
        mode, and is checked for UTF  validity  unless  the  PCRE2_NO_UTF_CHECK
        option is set, a dollar character is an escape character that can spec-
-       ify the insertion of characters from capturing groups in  the  pattern.
-       The following forms are recognized:
+       ify the insertion of characters from capturing groups or (*MARK)  items
+       in the pattern. The following forms are always recognized:
 
-         $$      insert a dollar character
-         $<n>    insert the contents of group <n>
-         ${<n>}  insert the contents of group <n>
+         $$                  insert a dollar character
+         $<n> or ${<n>}      insert the contents of group <n>
+         $*MARK or ${*MARK}  insert the name of the last (*MARK) encountered
 
        Either  a  group  number  or  a  group name can be given for <n>. Curly
        brackets are required only if the following character would  be  inter-
        preted as part of the number or name. The number may be zero to include
        the entire matched string.   For  example,  if  the  pattern  a(b)c  is
        matched  with "=abc=" and the replacement string "+$1$0$1+", the result
-       is "=+babcb+=". Group insertion is done by calling  pcre2_copy_byname()
-       or pcre2_copy_bynumber() as appropriate.
-
-       The  first  seven  arguments  of pcre2_substitute() are the same as for
-       pcre2_match(), except that the partial matching options are not permit-
-       ted,  and  match_data may be passed as NULL, in which case a match data
-       block is obtained and freed within this function, using memory  manage-
-       ment  functions from the match context, if provided, or else those that
-       were used to allocate memory for the compiled code.
-
-       There is one additional option, PCRE2_SUBSTITUTE_GLOBAL,  which  causes
-       the function to iterate over the subject string, replacing every match-
-       ing substring. If this is not set, only the first matching substring is
-       replaced.
-
-       The  outlengthptr  argument  must point to a variable that contains the
-       length, in code units, of the output buffer. It is updated  to  contain
-       the length of the new string, excluding the trailing zero that is auto-
-       matically added.
-
-       The function returns the number of replacements that  were  made.  This
-       may  be  zero  if  no  matches  were found, and is never greater than 1
-       unless PCRE2_SUBSTITUTE_GLOBAL is set. In the event of an error, a neg-
-       ative  error code is returned. Except for PCRE2_ERROR_NOMATCH (which is
-       never returned), any errors from pcre2_match() or the substring copying
-       functions  are  passed  straight  back.  PCRE2_ERROR_BADREPLACEMENT  is
-       returned for an invalid replacement string (unrecognized sequence  fol-
-       lowing a dollar sign), and PCRE2_ERROR_NOMEMORY is returned if the out-
-       put buffer is not big enough.
+       is "=+babcb+=".
+
+       The facility for inserting a (*MARK) name can be used to perform simple
+       simultaneous substitutions, as this pcre2test example shows:
+
+         /(*:pear)apple|(*:orange)lemon/g,replace=${*MARK}
+             apple lemon
+          2: pear orange
+
+       As  well as the usual options for pcre2_match(), a number of additional
+       options can be set in the options argument.
+
+       PCRE2_SUBSTITUTE_GLOBAL causes the function to iterate over the subject
+       string,  replacing  every  matching substring. If this is not set, only
+       the first matching substring is replaced. If any matched substring  has
+       zero  length, after the substitution has happened, an attempt to find a
+       non-empty match at the same position is performed. If this is not  suc-
+       cessful,  the current position is advanced by one character except when
+       CRLF is a valid newline sequence and the next two  characters  are  CR,
+       LF. In this case, the current position is advanced by two characters.
+
+       PCRE2_SUBSTITUTE_OVERFLOW_LENGTH  changes  what happens when the output
+       buffer is too small. The default action is to return PCRE2_ERROR_NOMEM-
+       ORY  immediately.  If  this  option is set, however, pcre2_substitute()
+       continues to go through the motions of matching and substituting (with-
+       out,  of course, writing anything) in order to compute the size of buf-
+       fer that is needed. This value is  passed  back  via  the  outlengthptr
+       variable,    with    the   result   of   the   function   still   being
+       PCRE2_ERROR_NOMEMORY.
+
+       Passing a buffer size of zero is a permitted way  of  finding  out  how
+       much  memory  is needed for given substitution. However, this does mean
+       that the entire operation is carried out twice. Depending on the appli-
+       cation,  it  may  be more efficient to allocate a large buffer and free
+       the  excess  afterwards,  instead   of   using   PCRE2_SUBSTITUTE_OVER-
+       FLOW_LENGTH.
+
+       PCRE2_SUBSTITUTE_UNKNOWN_UNSET  causes  references  to capturing groups
+       that do not appear in the pattern to be treated as unset  groups.  This
+       option  should  be  used  with  care, because it means that a typo in a
+       group name or  number  no  longer  causes  the  PCRE2_ERROR_NOSUBSTRING
+       error.
+
+       PCRE2_SUBSTITUTE_UNSET_EMPTY  causes  unset capturing groups (including
+       unknown  groups  when  PCRE2_SUBSTITUTE_UNKNOWN_UNSET  is  set)  to  be
+       treated  as  empty  strings  when  inserted as described above. If this
+       option is not set, an attempt to  insert  an  unset  group  causes  the
+       PCRE2_ERROR_UNSET  error.  This  option does not influence the extended
+       substitution syntax described below.
+
+       PCRE2_SUBSTITUTE_EXTENDED causes extra processing to be applied to  the
+       replacement  string.  Without this option, only the dollar character is
+       special, and only the group insertion forms  listed  above  are  valid.
+       When PCRE2_SUBSTITUTE_EXTENDED is set, two things change:
+
+       Firstly,  backslash in a replacement string is interpreted as an escape
+       character. The usual forms such as \n or \x{ddd} can be used to specify
+       particular  character codes, and backslash followed by any non-alphanu-
+       meric character quotes that character. Extended quoting  can  be  coded
+       using \Q...\E, exactly as in pattern strings.
+
+       There  are  also four escape sequences for forcing the case of inserted
+       letters.  The insertion mechanism has three states:  no  case  forcing,
+       force upper case, and force lower case. The escape sequences change the
+       current state: \U and \L change to upper or lower case forcing, respec-
+       tively,  and  \E (when not terminating a \Q quoted sequence) reverts to
+       no case forcing. The sequences \u and \l force the next  character  (if
+       it  is  a  letter)  to  upper or lower case, respectively, and then the
+       state automatically reverts to no case forcing. Case forcing applies to
+       all inserted  characters, including those from captured groups and let-
+       ters within \Q...\E quoted sequences.
+
+       Note that case forcing sequences such as \U...\E do not nest. For exam-
+       ple,  the  result of processing "\Uaa\LBB\Ecc\E" is "AAbbcc"; the final
+       \E has no effect.
+
+       The second effect of setting PCRE2_SUBSTITUTE_EXTENDED is to  add  more
+       flexibility  to  group substitution. The syntax is similar to that used
+       by Bash:
+
+         ${<n>:-<string>}
+         ${<n>:+<string1>:<string2>}
+
+       As before, <n> may be a group number or a name. The first  form  speci-
+       fies  a  default  value. If group <n> is set, its value is inserted; if
+       not, <string> is expanded and the  result  inserted.  The  second  form
+       specifies  strings that are expanded and inserted when group <n> is set
+       or unset, respectively. The first form is just a  convenient  shorthand
+       for
+
+         ${<n>:+${<n>}:<string>}
+
+       Backslash  can  be  used to escape colons and closing curly brackets in
+       the replacement strings. A change of the case forcing  state  within  a
+       replacement  string  remains  in  force  afterwards,  as  shown in this
+       pcre2test example:
+
+         /(some)?(body)/substitute_extended,replace=${1:+\U:\L}HeLLo
+             body
+          1: hello
+             somebody
+          1: HELLO
+
+       The PCRE2_SUBSTITUTE_UNSET_EMPTY option does not affect these  extended
+       substitutions.   However,   PCRE2_SUBSTITUTE_UNKNOWN_UNSET  does  cause
+       unknown groups in the extended syntax forms to be treated as unset.
+
+       If successful, pcre2_substitute() returns the  number  of  replacements
+       that were made. This may be zero if no matches were found, and is never
+       greater than 1 unless PCRE2_SUBSTITUTE_GLOBAL is set.
+
+       In the event of an error, a negative error code is returned. Except for
+       PCRE2_ERROR_NOMATCH    (which   is   never   returned),   errors   from
+       pcre2_match() are passed straight back.
+
+       PCRE2_ERROR_NOSUBSTRING is returned for a non-existent substring inser-
+       tion, unless PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set.
+
+       PCRE2_ERROR_UNSET is returned for an unset substring insertion (includ-
+       ing an unknown substring when  PCRE2_SUBSTITUTE_UNKNOWN_UNSET  is  set)
+       when  the  simple  (non-extended)  syntax  is  used  and  PCRE2_SUBSTI-
+       TUTE_UNSET_EMPTY is not set.
+
+       PCRE2_ERROR_NOMEMORY is returned  if  the  output  buffer  is  not  big
+       enough. If the PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option is set, the size
+       of buffer that is needed is returned via outlengthptr. Note  that  this
+       does not happen by default.
+
+       PCRE2_ERROR_BADREPLACEMENT  is  used for miscellaneous syntax errors in
+       the   replacement   string,   with   more   particular   errors   being
+       PCRE2_ERROR_BADREPESCAPE  (invalid  escape  sequence), PCRE2_ERROR_REP-
+       MISSING_BRACE (closing curly bracket not found),  PCRE2_BADSUBSTITUTION
+       (syntax  error in extended group substitution), and PCRE2_BADSUBPATTERN
+       (the pattern match ended before it started, which can happen if  \K  is
+       used in an assertion).
+
+       As for all PCRE2 errors, a text message that describes the error can be
+       obtained by calling pcre2_get_error_message().
 
 
 DUPLICATE SUBPATTERN NAMES
@@ -2604,8 +2833,8 @@ DUPLICATE SUBPATTERN NAMES
        no entries for the given name.
 
        The format of the name table is described above in the section entitled
-       Information  about a pattern above.  Given all the relevant entries for
-       the name, you can extract each of their numbers, and hence the captured
+       Information  about  a  pattern.  Given all the relevant entries for the
+       name, you can extract each of their numbers,  and  hence  the  captured
        data.
 
 
@@ -2781,8 +3010,8 @@ MATCHING A PATTERN: THE ALTERNATIVE FUNCTION
          PCRE2_ERROR_DFA_UITEM
 
        This  return  is  given  if pcre2_dfa_match() encounters an item in the
-       pattern that it does not support, for instance, the use of \C or a back
-       reference.
+       pattern that it does not support, for instance, the use of \C in a  UTF
+       mode or a back reference.
 
          PCRE2_ERROR_DFA_UCOND
 
@@ -2826,7 +3055,7 @@ AUTHOR
 
 REVISION
 
-       Last updated: 22 April 2015
+       Last updated: 16 December 2015
        Copyright (c) 1997-2015 University of Cambridge.
 ------------------------------------------------------------------------------
 
@@ -2946,10 +3175,18 @@ UNICODE AND UTF SUPPORT
        PCRE2_UCP option. Unless the application  has  set  PCRE2_NEVER_UCP,  a
        pattern may also request this by starting with (*UCP).
 
+
+DISABLING THE USE OF \C
+
        The \C escape sequence, which matches a single code unit, even in a UTF
        mode, can cause unpredictable behaviour because it may leave  the  cur-
-       rent  matching  point  in the middle of a multi-code-unit character. It
-       can be locked out by setting the PCRE2_NEVER_BACKSLASH_C option.
+       rent  matching  point in the middle of a multi-code-unit character. The
+       application can lock it  out  by  setting  the  PCRE2_NEVER_BACKSLASH_C
+       option when calling pcre2_compile(). There is also a build-time option
+
+         --enable-never-backslash-C
+
+       (note the upper case C) which locks out the use of \C entirely.
 
 
 JUST-IN-TIME COMPILER SUPPORT
@@ -2958,10 +3195,10 @@ JUST-IN-TIME COMPILER SUPPORT
 
          --enable-jit
 
-       This support is available only for certain hardware  architectures.  If
-       this  option  is  set for an unsupported architecture, a building error
-       occurs.  See the pcre2jit documentation for a discussion of JIT  usage.
-       When  JIT  support is enabled, pcre2grep automatically makes use of it,
+       This  support  is available only for certain hardware architectures. If
+       this option is set for an unsupported architecture,  a  building  error
+       occurs.   See the pcre2jit documentation for a discussion of JIT usage.
+       When JIT support is enabled, pcre2grep automatically makes use  of  it,
        unless you add
 
          --disable-pcre2grep-jit
@@ -2971,14 +3208,14 @@ JUST-IN-TIME COMPILER SUPPORT
 
 NEWLINE RECOGNITION
 
-       By default, PCRE2 interprets the linefeed (LF) character as  indicating
-       the  end  of  a line. This is the normal newline character on Unix-like
-       systems. You can compile PCRE2 to use carriage return (CR) instead,  by
+       By  default, PCRE2 interprets the linefeed (LF) character as indicating
+       the end of a line. This is the normal newline  character  on  Unix-like
+       systems.  You can compile PCRE2 to use carriage return (CR) instead, by
        adding
 
          --enable-newline-is-cr
 
-       to  the  configure  command.  There  is  also an --enable-newline-is-lf
+       to the configure  command.  There  is  also  an  --enable-newline-is-lf
        option, which explicitly specifies linefeed as the newline character.
 
        Alternatively, you can specify that line endings are to be indicated by
@@ -2991,76 +3228,76 @@ NEWLINE RECOGNITION
 
          --enable-newline-is-anycrlf
 
-       which causes PCRE2 to recognize any of the three sequences CR,  LF,  or
+       which  causes  PCRE2 to recognize any of the three sequences CR, LF, or
        CRLF as indicating a line ending. Finally, a fifth option, specified by
 
          --enable-newline-is-any
 
-       causes  PCRE2  to  recognize  any Unicode newline sequence. The Unicode
+       causes PCRE2 to recognize any Unicode  newline  sequence.  The  Unicode
        newline sequences are the three just mentioned, plus the single charac-
        ters VT (vertical tab, U+000B), FF (form feed, U+000C), NEL (next line,
-       U+0085), LS (line separator,  U+2028),  and  PS  (paragraph  separator,
+       U+0085),  LS  (line  separator,  U+2028),  and PS (paragraph separator,
        U+2029).
 
        Whatever default line ending convention is selected when PCRE2 is built
-       can be overridden by applications that use the library. At  build  time
+       can  be  overridden by applications that use the library. At build time
        it is 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, independently of what has been selected as  the  line  ending
+       By default, the sequence \R in a pattern matches  any  Unicode  newline
+       sequence,  independently  of  what 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 PCRE2 is built can be overridden by  applications
+       the default is changed so that \R matches only CR, LF, or  CRLF.  What-
+       ever  is selected when PCRE2 is built can be overridden by applications
        that use the called.
 
 
 HANDLING VERY LARGE PATTERNS
 
-       Within  a  compiled  pattern,  offset values are used to point from one
-       part to another (for example, from an opening parenthesis to an  alter-
-       nation  metacharacter).  By default, in the 8-bit and 16-bit libraries,
-       two-byte values are used for these offsets, leading to a  maximum  size
-       for  a compiled pattern of around 64K code units. This is sufficient to
+       Within a compiled pattern, offset values are used  to  point  from  one
+       part  to another (for example, from an opening parenthesis to an alter-
+       nation metacharacter). By default, in the 8-bit and  16-bit  libraries,
+       two-byte  values  are used for these offsets, leading to a maximum size
+       for a compiled pattern of around 64K code units. This is sufficient  to
        handle all but the most gigantic patterns. Nevertheless, some people do
-       want  to  process truly enormous patterns, so it is possible to compile
-       PCRE2 to use three-byte or four-byte offsets by adding a  setting  such
+       want to process truly enormous patterns, so it is possible  to  compile
+       PCRE2  to  use three-byte or four-byte offsets by adding a setting such
        as
 
          --with-link-size=3
 
-       to  the  configure command. The value given must be 2, 3, or 4. For the
-       16-bit library, a value of 3 is rounded up to 4.  In  these  libraries,
-       using  longer  offsets slows down the operation of PCRE2 because it has
-       to load additional data when handling them. For the 32-bit library  the
-       value  is  always 4 and cannot be overridden; the value of --with-link-
+       to the configure command. The value given must be 2, 3, or 4.  For  the
+       16-bit  library,  a  value of 3 is rounded up to 4. In these libraries,
+       using longer offsets slows down the operation of PCRE2 because  it  has
+       to  load additional data when handling them. For the 32-bit library the
+       value is always 4 and cannot be overridden; the value  of  --with-link-
        size is ignored.
 
 
 AVOIDING EXCESSIVE STACK USAGE
 
-       When matching with the pcre2_match() function, PCRE2  implements  back-
-       tracking  by  making  recursive  calls  to  an internal function called
-       match(). In environments where the size of the stack is  limited,  this
-       can  severely  limit  PCRE2's operation. (The Unix environment does not
-       usually suffer from this problem, but it may sometimes be necessary  to
+       When  matching  with the pcre2_match() function, PCRE2 implements back-
+       tracking by making recursive  calls  to  an  internal  function  called
+       match().  In  environments where the size of the stack is limited, this
+       can severely limit PCRE2's operation. (The Unix  environment  does  not
+       usually  suffer from this problem, but it may sometimes be necessary to
        increase  the  maximum  stack  size.  There  is  a  discussion  in  the
-       pcre2stack documentation.) An alternative approach  to  recursion  that
-       uses  memory from the heap to remember data, instead of using recursive
-       function calls, has been implemented to work round the problem of  lim-
-       ited  stack  size.  If  you want to build a version of PCRE2 that works
+       pcre2stack  documentation.)  An  alternative approach to recursion that
+       uses memory from the heap to remember data, instead of using  recursive
+       function  calls, has been implemented to work round the problem of lim-
+       ited stack size. If you want to build a version  of  PCRE2  that  works
        this way, add
 
          --disable-stack-for-recursion
 
        to the configure command. By default, the system functions malloc() and
-       free()  are called to manage the heap memory that is required, but cus-
-       tom memory management functions  can  be  called  instead.  PCRE2  runs
+       free() are called to manage the heap memory that is required, but  cus-
+       tom  memory  management  functions  can  be  called instead. PCRE2 runs
        noticeably more slowly when built in this way. This option affects only
        the pcre2_match() function; it is not relevant for pcre2_dfa_match().
 
@@ -3068,30 +3305,30 @@ AVOIDING EXCESSIVE STACK USAGE
 LIMITING PCRE2 RESOURCE USAGE
 
        Internally, PCRE2 has a function called match(), which it calls repeat-
-       edly   (sometimes   recursively)  when  matching  a  pattern  with  the
+       edly  (sometimes  recursively)  when  matching  a  pattern   with   the
        pcre2_match() function. By controlling the maximum number of times this
-       function  may be called during a single matching operation, a limit can
-       be placed on the resources used by a single call to pcre2_match().  The
+       function may be called during a single matching operation, a limit  can
+       be  placed on the resources used by a single call to pcre2_match(). The
        limit can be changed at run time, as described in the pcre2api documen-
-       tation. The default is 10 million, but this can be changed by adding  a
+       tation.  The default is 10 million, but this can be changed by adding a
        setting such as
 
          --with-match-limit=500000
 
-       to   the   configure  command.  This  setting  has  no  effect  on  the
+       to  the  configure  command.  This  setting  has  no  effect   on   the
        pcre2_dfa_match() matching function.
 
-       In some environments it is desirable to limit the  depth  of  recursive
+       In  some  environments  it is desirable to limit the depth of recursive
        calls of match() more strictly than the total number of calls, in order
-       to restrict the maximum amount of stack (or heap,  if  --disable-stack-
+       to  restrict  the maximum amount of stack (or heap, if --disable-stack-
        for-recursion is specified) that is used. A second limit controls this;
-       it defaults to the value that  is  set  for  --with-match-limit,  which
-       imposes  no  additional constraints. However, you can set a lower limit
+       it  defaults  to  the  value  that is set for --with-match-limit, which
+       imposes no additional constraints. However, you can set a  lower  limit
        by adding, for example,
 
          --with-match-limit-recursion=10000
 
-       to the configure command. This value can  also  be  overridden  at  run
+       to  the  configure  command.  This  value can also be overridden at run
        time.
 
 
@@ -3099,45 +3336,45 @@ CREATING CHARACTER TABLES AT BUILD TIME
 
        PCRE2 uses fixed tables for processing characters whose code points are
        less than 256. By default, PCRE2 is built with a set of tables that are
-       distributed  in  the file src/pcre2_chartables.c.dist. These tables are
+       distributed in the file src/pcre2_chartables.c.dist. These  tables  are
        for ASCII codes only. If you add
 
          --enable-rebuild-chartables
 
-       to the configure command, the distributed tables are  no  longer  used.
-       Instead,  a  program  called dftables is compiled and run. This outputs
+       to  the  configure  command, the distributed tables are no longer used.
+       Instead, a program called dftables is compiled and  run.  This  outputs
        the source for new set of tables, created in the default locale of your
-       C  run-time  system. (This method of replacing the tables does not work
-       if you are cross compiling, because dftables is run on the local  host.
+       C run-time system. (This method of replacing the tables does  not  work
+       if  you are cross compiling, because dftables is run on the local host.
        If you need to create alternative tables when cross compiling, you will
        have to do so "by hand".)
 
 
 USING EBCDIC CODE
 
-       PCRE2 assumes by default that it will run in an environment  where  the
-       character  code is ASCII or Unicode, which is a superset of ASCII. This
+       PCRE2  assumes  by default that it will run in an environment where the
+       character code is ASCII or Unicode, which is a superset of ASCII.  This
        is the case for most computer operating systems. PCRE2 can, however, be
        compiled to run in an 8-bit EBCDIC environment by adding
 
          --enable-ebcdic --disable-unicode
 
        to the configure command. This setting implies --enable-rebuild-charta-
-       bles. You should only use it if you know that  you  are  in  an  EBCDIC
+       bles.  You  should  only  use  it if you know that you are in an EBCDIC
        environment (for example, an IBM mainframe operating system).
 
-       It  is  not possible to support both EBCDIC and UTF-8 codes in the same
-       version of the library. Consequently,  --enable-unicode  and  --enable-
+       It is not possible to support both EBCDIC and UTF-8 codes in  the  same
+       version  of  the  library. Consequently, --enable-unicode and --enable-
        ebcdic are mutually exclusive.
 
        The EBCDIC character that corresponds to an ASCII LF is assumed to have
-       the value 0x15 by default. However, in some EBCDIC  environments,  0x25
+       the  value  0x15 by default. However, in some EBCDIC environments, 0x25
        is used. In such an environment you should use
 
          --enable-ebcdic-nl25
 
        as well as, or instead of, --enable-ebcdic. The EBCDIC character for CR
-       has the same value as in ASCII, namely, 0x0d.  Whichever  of  0x15  and
+       has  the  same  value  as in ASCII, namely, 0x0d. Whichever of 0x15 and
        0x25 is not chosen as LF is made to correspond to the Unicode NEL char-
        acter (which, in Unicode, is 0x85).
 
@@ -3148,31 +3385,31 @@ USING EBCDIC CODE
 
 PCRE2GREP OPTIONS FOR COMPRESSED FILE SUPPORT
 
-       By default, pcre2grep reads all files as plain text. You can  build  it
-       so  that  it recognizes files whose names end in .gz or .bz2, and reads
+       By  default,  pcre2grep 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-pcre2grep-libz
          --enable-pcre2grep-libbz2
 
        to the configure command. These options naturally require that the rel-
-       evant  libraries  are installed on your system. Configuration will fail
+       evant libraries are installed on your system. Configuration  will  fail
        if they are not.
 
 
 PCRE2GREP BUFFER SIZE
 
-       pcre2grep uses an internal buffer to hold a "window" on the file it  is
+       pcre2grep  uses an internal buffer to hold a "window" on the file it is
        scanning, in order to be able to output "before" and "after" lines when
-       it finds a match. The size of the buffer is controlled by  a  parameter
+       it  finds  a match. The size of the buffer is controlled by a parameter
        whose default value is 20K. The buffer itself is three times this size,
        but because of the way it is used for holding "before" lines, the long-
-       est  line  that  is guaranteed to be processable is the parameter size.
+       est line that is guaranteed to be processable is  the  parameter  size.
        You can change the default parameter value by adding, for example,
 
          --with-pcre2grep-bufsize=50K
 
-       to the configure command. The caller of  pcre2grep  can  override  this
+       to  the  configure  command.  The caller of pcre2grep can override this
        value by using --buffer-size on the command line..
 
 
@@ -3183,26 +3420,26 @@ PCRE2TEST OPTION FOR LIBREADLINE SUPPORT
          --enable-pcre2test-libreadline
          --enable-pcre2test-libedit
 
-       to  the  configure  command,  pcre2test  is linked with the libreadline
+       to the configure command, pcre2test  is  linked  with  the  libreadline
        orlibedit library, respectively, 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-licensed,  so  if
-       you  distribute  a binary of pcre2test linked in this way, there may be
+       it reads it using the readline() function. This  provides  line-editing
+       and  history  facilities.  Note that libreadline is GPL-licensed, so if
+       you distribute a binary of pcre2test linked in this way, there  may  be
        licensing issues. These can be avoided by linking instead with libedit,
        which has a BSD licence.
 
-       Setting  --enable-pcre2test-libreadline causes the -lreadline option to
-       be added to the pcre2test build. In many operating environments with  a
-       sytem-installed  readline  library this is sufficient. However, in some
+       Setting --enable-pcre2test-libreadline causes the -lreadline option  to
+       be  added to the pcre2test build. In many operating environments with a
+       sytem-installed readline library this is sufficient. However,  in  some
        environments (e.g. if an unmodified distribution version of readline is
-       in  use),  some  extra configuration may be necessary. The INSTALL file
+       in use), some extra configuration may be necessary.  The  INSTALL  file
        for libreadline says this:
 
          "Readline uses the termcap functions, but does not link with
          the termcap or curses library itself, allowing applications
          which link with readline the to choose an appropriate library."
 
-       If your environment has not been set up so that an appropriate  library
+       If  your environment has not been set up so that an appropriate library
        is automatically included, you may need to add something like
 
          LIBS="-ncurses"
@@ -3216,7 +3453,7 @@ INCLUDING DEBUGGING CODE
 
          --enable-debug
 
-       to  the configure command, additional debugging code is included in the
+       to the configure command, additional debugging code is included in  the
        build. This feature is intended for use by the PCRE2 maintainers.
 
 
@@ -3226,15 +3463,15 @@ DEBUGGING WITH VALGRIND SUPPORT
 
          --enable-valgrind
 
-       to the configure command, PCRE2 will use valgrind annotations  to  mark
-       certain  memory  regions  as  unaddressable.  This  allows it to detect
-       invalid memory accesses, and  is  mostly  useful  for  debugging  PCRE2
+       to  the  configure command, PCRE2 will use valgrind annotations to mark
+       certain memory regions as  unaddressable.  This  allows  it  to  detect
+       invalid  memory  accesses,  and  is  mostly  useful for debugging PCRE2
        itself.
 
 
 CODE COVERAGE REPORTING
 
-       If  your  C  compiler is gcc, you can build a version of PCRE2 that can
+       If your C compiler is gcc, you can build a version of  PCRE2  that  can
        generate a code coverage report for its test suite. To enable this, you
        must install lcov version 1.6 or above. Then specify
 
@@ -3243,20 +3480,20 @@ CODE COVERAGE REPORTING
        to the configure command and build PCRE2 in the usual way.
 
        Note that using ccache (a caching C compiler) is incompatible with code
-       coverage reporting. If you have configured ccache to run  automatically
+       coverage  reporting. If you have configured ccache to run automatically
        on your system, you must set the environment variable
 
          CCACHE_DISABLE=1
 
        before running make to build PCRE2, so that ccache is not used.
 
-       When  --enable-coverage  is  used,  the  following addition targets are
+       When --enable-coverage is used,  the  following  addition  targets  are
        added to the Makefile:
 
          make coverage
 
-       This creates a fresh coverage report for the PCRE2 test  suite.  It  is
-       equivalent  to running "make coverage-reset", "make coverage-baseline",
+       This  creates  a  fresh coverage report for the PCRE2 test suite. It is
+       equivalent to running "make coverage-reset", "make  coverage-baseline",
        "make check", and then "make coverage-report".
 
          make coverage-reset
@@ -3273,18 +3510,18 @@ CODE COVERAGE REPORTING
 
          make coverage-clean-report
 
-       This removes the generated coverage report without cleaning the  cover-
+       This  removes the generated coverage report without cleaning the cover-
        age data itself.
 
          make coverage-clean-data
 
-       This  removes  the captured coverage data without removing the coverage
+       This removes the captured coverage data without removing  the  coverage
        files created at compile time (*.gcno).
 
          make coverage-clean
 
-       This cleans all coverage data including the generated coverage  report.
-       For  more  information about code coverage, see the gcov and lcov docu-
+       This  cleans all coverage data including the generated coverage report.
+       For more information about code coverage, see the gcov and  lcov  docu-
        mentation.
 
 
@@ -3302,7 +3539,7 @@ AUTHOR
 
 REVISION
 
-       Last updated: 24 April 2015
+       Last updated: 16 October 2015
        Copyright (c) 1997-2015 University of Cambridge.
 ------------------------------------------------------------------------------
 
@@ -3922,6 +4159,12 @@ SIMPLE USE OF JIT
        exactly the same results. The returned value  from  pcre2_jit_compile()
        is zero on success, or a negative error code.
 
+       There  is  a limit to the size of pattern that JIT supports, imposed by
+       the size of machine stack that it uses. The exact rules are  not  docu-
+       mented  because  they  may  change at any time, in particular, when new
+       optimizations are introduced.  If a pattern  is  too  big,  a  call  to
+       pcre2_jit_compile() returns PCRE2_ERROR_NOMEMORY.
+
        PCRE2_JIT_COMPLETE  requests the JIT compiler to generate code for com-
        plete matches. If you want to run partial matches using the  PCRE2_PAR-
        TIAL_HARD  or  PCRE2_PARTIAL_SOFT  options of pcre2_match(), you should
@@ -4051,13 +4294,17 @@ CONTROLLING THE JIT STACK
        interpreter.
 
        You may safely use the same JIT stack for more than one pattern (either
-       by assigning directly or by callback), as long as the patterns are  all
-       matched  sequentially in the same thread. In a multithread application,
-       if you do not specify a JIT stack, or if you assign or pass  back  NULL
-       from  a  callback, that is thread-safe, because each thread has its own
-       machine stack. However, if you assign  or  pass  back  a  non-NULL  JIT
-       stack,  this  must  be  a  different  stack for each thread so that the
-       application is thread-safe.
+       by assigning directly or by callback), as  long  as  the  patterns  are
+       matched sequentially in the same thread. Currently, the only way to set
+       up non-sequential matches in one thread is to use callouts: if a  call-
+       out  function starts another match, that match must use a different JIT
+       stack to the one used for currently suspended match(es).
+
+       In a multithread application, if you do not specify a JIT stack, or  if
+       you  assign  or  pass  back  NULL from a callback, that is thread-safe,
+       because each thread has its own machine stack. However, if  you  assign
+       or  pass  back a non-NULL JIT stack, this must be a different stack for
+       each thread so that the application is thread-safe.
 
        Strictly speaking, even more is allowed. You can assign the  same  non-
        NULL  stack  to a match context that is used by any number of patterns,
@@ -4234,8 +4481,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 27 November 2014
-       Copyright (c) 1997-2014 University of Cambridge.
+       Last updated: 14 November 2015
+       Copyright (c) 1997-2015 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -4262,6 +4509,10 @@ SIZE AND OTHER LIMITATIONS
        of execution is slower. In the 32-bit  library,  the  internal  linkage
        size is always 4.
 
+       The maximum length of a source pattern string is essentially unlimited;
+       it is the largest number a PCRE2_SIZE variable can hold.  However,  the
+       program that calls pcre2_compile() can specify a smaller limit.
+
        The maximum length (in code units) of a subject string is one less than
        the largest number a PCRE2_SIZE variable can  hold.  PCRE2_SIZE  is  an
        unsigned  integer  type,  usually  defined as size_t. Its maximum value
@@ -4276,6 +4527,8 @@ SIZE AND OTHER LIMITATIONS
 
        All values in repeating quantifiers must be less than 65536.
 
+       The maximum length of a lookbehind assertion is 65535 characters.
+
        There is no limit to the number of parenthesized subpatterns, but there
        can be no more than 65535 capturing subpatterns. There is,  however,  a
        limit  to  the  depth  of  nesting  of parenthesized subpatterns of all
@@ -4306,8 +4559,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 25 November 2014
-       Copyright (c) 1997-2014 University of Cambridge.
+       Last updated: 05 November 2015
+       Copyright (c) 1997-2015 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -4970,230 +5223,4577 @@ REVISION
 ------------------------------------------------------------------------------
 
 
-PCRE2UNICODE(3)            Library Functions Manual            PCRE2UNICODE(3)
+PCRE2PATTERN(3)            Library Functions Manual            PCRE2PATTERN(3)
 
 
 
 NAME
-       PCRE - Perl-compatible regular expressions (revised API)
+       PCRE2 - Perl-compatible regular expressions (revised API)
 
-UNICODE AND UTF SUPPORT
+PCRE2 REGULAR EXPRESSION DETAILS
+
+       The  syntax and semantics of the regular expressions that are supported
+       by PCRE2 are described in detail below. There is a quick-reference syn-
+       tax  summary  in the pcre2syntax page. PCRE2 tries to match Perl syntax
+       and semantics as closely as it can.  PCRE2 also supports some  alterna-
+       tive  regular  expression syntax (which does not conflict with the Perl
+       syntax) in order to provide some compatibility with regular expressions
+       in Python, .NET, and Oniguruma.
+
+       Perl's  regular expressions are described in its own documentation, and
+       regular expressions in general are covered in a number of  books,  some
+       of  which  have  copious  examples. Jeffrey Friedl's "Mastering Regular
+       Expressions", published by  O'Reilly,  covers  regular  expressions  in
+       great  detail.  This  description  of  PCRE2's  regular  expressions is
+       intended as reference material.
+
+       This document discusses the patterns that are supported by  PCRE2  when
+       its  main  matching function, pcre2_match(), is used. PCRE2 also has an
+       alternative matching function, pcre2_dfa_match(), which matches using a
+       different  algorithm  that is not Perl-compatible. Some of the features
+       discussed below are not available when DFA matching is used. The advan-
+       tages and disadvantages of the alternative function, and how it differs
+       from the normal function, are discussed in the pcre2matching page.
+
+
+SPECIAL START-OF-PATTERN ITEMS
+
+       A number of options that can be passed to pcre2_compile() can  also  be
+       set by special items at the start of a pattern. These are not Perl-com-
+       patible, but are provided to make these options accessible  to  pattern
+       writers  who are not able to change the program that processes the pat-
+       tern. Any number of these items  may  appear,  but  they  must  all  be
+       together right at the start of the pattern string, and the letters must
+       be in upper case.
+
+   UTF support
+
+       In the 8-bit and 16-bit PCRE2 libraries, characters may be coded either
+       as single code units, or as multiple UTF-8 or UTF-16 code units. UTF-32
+       can be specified for the 32-bit library, in which  case  it  constrains
+       the  character  values  to  valid  Unicode  code points. To process UTF
+       strings, PCRE2 must be built to include Unicode support (which  is  the
+       default).  When  using  UTF  strings you must either call the compiling
+       function with the PCRE2_UTF option, or the pattern must start with  the
+       special  sequence  (*UTF),  which is equivalent to setting the relevant
+       option. How setting a UTF mode affects pattern matching is mentioned in
+       several  places  below.  There  is  also  a  summary of features in the
+       pcre2unicode page.
 
-       When PCRE2 is built with Unicode support (which is the default), it has
-       knowledge of Unicode character properties and can process text  strings
-       in  UTF-8, UTF-16, or UTF-32 format (depending on the code unit width).
-       However, by default, PCRE2 assumes that one code unit is one character.
-       To  process  a  pattern  as a UTF string, where a character may require
-       more than one  code  unit,  you  must  call  pcre2_compile()  with  the
-       PCRE2_UTF  option  flag,  or  the  pattern must start with the sequence
-       (*UTF). When either of these is the case, both the pattern and any sub-
-       ject  strings  that  are  matched against it are treated as UTF strings
-       instead of strings of individual one-code-unit characters.
+       Some applications that allow their users to supply patterns may wish to
+       restrict   them   to   non-UTF   data  for  security  reasons.  If  the
+       PCRE2_NEVER_UTF option is passed  to  pcre2_compile(),  (*UTF)  is  not
+       allowed, and its appearance in a pattern causes an error.
 
-       If you do not need Unicode support you can build PCRE2 without  it,  in
-       which case the library will be smaller.
+   Unicode property support
 
+       Another  special  sequence that may appear at the start of a pattern is
+       (*UCP).  This has the same effect as setting the PCRE2_UCP  option:  it
+       causes  sequences such as \d and \w to use Unicode properties to deter-
+       mine character types, instead of recognizing only characters with codes
+       less than 256 via a lookup table.
 
-UNICODE PROPERTY SUPPORT
+       Some applications that allow their users to supply patterns may wish to
+       restrict them for security reasons. If the  PCRE2_NEVER_UCP  option  is
+       passed to pcre2_compile(), (*UCP) is not allowed, and its appearance in
+       a pattern causes an error.
 
-       When  PCRE2 is built with Unicode support, the escape sequences \p{..},
-       \P{..}, and \X can be used. The Unicode properties that can  be  tested
-       are  limited to the general category properties such as Lu for an upper
-       case letter or Nd for a decimal number, the Unicode script  names  such
-       as Arabic or Han, and the derived properties Any and L&. Full lists are
-       given in the pcre2pattern and pcre2syntax documentation. Only the short
-       names  for  properties are supported. For example, \p{L} matches a let-
-       ter. Its Perl synonym, \p{Letter}, is not supported.   Furthermore,  in
-       Perl,  many properties may optionally be prefixed by "Is", for compati-
-       bility with Perl 5.6. PCRE does not support this.
+   Locking out empty string matching
 
+       Starting a pattern with (*NOTEMPTY) or (*NOTEMPTY_ATSTART) has the same
+       effect  as  passing the PCRE2_NOTEMPTY or PCRE2_NOTEMPTY_ATSTART option
+       to whichever matching function is subsequently called to match the pat-
+       tern.  These  options  lock  out  the matching of empty strings, either
+       entirely, or only at the start of the subject.
 
-WIDE CHARACTERS AND UTF MODES
+   Disabling auto-possessification
 
-       Codepoints less than 256 can be specified in patterns by either  braced
-       or unbraced hexadecimal escape sequences (for example, \x{b3} or \xb3).
-       Larger values have to use braced sequences. Unbraced octal code  points
-       up to \777 are also recognized; larger ones can be coded using \o{...}.
+       If a pattern starts with (*NO_AUTO_POSSESS), it has the same effect  as
+       setting  the PCRE2_NO_AUTO_POSSESS option. This stops PCRE2 from making
+       quantifiers possessive when what  follows  cannot  match  the  repeated
+       item. For example, by default a+b is treated as a++b. For more details,
+       see the pcre2api documentation.
 
-       In  UTF modes, repeat quantifiers apply to complete UTF characters, not
-       to individual code units.
+   Disabling start-up optimizations
 
-       In UTF modes, the dot metacharacter matches one UTF  character  instead
-       of a single code unit.
+       If a pattern starts with (*NO_START_OPT), it has  the  same  effect  as
+       setting the PCRE2_NO_START_OPTIMIZE option. This disables several opti-
+       mizations for quickly reaching "no match" results.  For  more  details,
+       see the pcre2api documentation.
 
-       The  escape  sequence  \C can be used to match a single code unit, in a
-       UTF mode, but its use can lead  to  some  strange  effects  because  it
-       breaks  up  multi-unit  characters  (see  the  description of \C in the
-       pcre2pattern documentation). The use of \C  is  not  supported  in  the
-       alternative matching function pcre2_dfa_match(), nor is it supported in
-       UTF mode by the JIT optimization. If JIT optimization is requested  for
-       a  UTF pattern that contains \C, it will not succeed, and so the match-
-       ing will be carried out by the normal interpretive function.
+   Disabling automatic anchoring
 
-       The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly test
-       characters  of  any  code  value,  but, by default, the characters that
-       PCRE2 recognizes as digits, spaces, or word characters remain the  same
-       set  as  in  non-UTF  mode,  all  with  code points less than 256. This
-       remains true even when PCRE2  is  built  to  include  Unicode  support,
-       because  to do otherwise would slow down matching in many common cases.
-       Note that this also applies to \b and \B, because they are  defined  in
-       terms  of  \w  and  \W.  If you want to test for a wider sense of, say,
-       "digit", you can use explicit Unicode property tests  such  as  \p{Nd}.
-       Alternatively,  if you set the PCRE2_UCP option, the way that the char-
-       acter escapes work is changed so that Unicode properties  are  used  to
-       determine which characters match. There are more details in the section
-       on generic character types in the pcre2pattern documentation.
+       If  a  pattern starts with (*NO_DOTSTAR_ANCHOR), it has the same effect
+       as setting the PCRE2_NO_DOTSTAR_ANCHOR option. This disables  optimiza-
+       tions that apply to patterns whose top-level branches all start with .*
+       (match any number of arbitrary characters). For more details,  see  the
+       pcre2api documentation.
 
-       Similarly, characters that match the POSIX named character classes  are
-       all low-valued characters, unless the PCRE2_UCP option is set.
+   Disabling JIT compilation
 
-       However,  the  special  horizontal  and  vertical  white space matching
-       escapes (\h, \H, \v, and \V) do match all the appropriate Unicode char-
-       acters, whether or not PCRE2_UCP is set.
+       If  a  pattern  that starts with (*NO_JIT) is successfully compiled, an
+       attempt by the application to apply the  JIT  optimization  by  calling
+       pcre2_jit_compile() is ignored.
 
-       Case-insensitive  matching in UTF mode makes use of Unicode properties.
-       A few Unicode characters such as Greek sigma have more than  two  code-
-       points that are case-equivalent, and these are treated as such.
+   Setting match and recursion limits
 
+       The  caller of pcre2_match() can set a limit on the number of times the
+       internal match() function is called and on the maximum depth of  recur-
+       sive calls. These facilities are provided to catch runaway matches that
+       are provoked by patterns with huge matching trees (a typical example is
+       a  pattern  with  nested unlimited repeats) and to avoid running out of
+       system stack by too  much  recursion.  When  one  of  these  limits  is
+       reached,  pcre2_match()  gives  an error return. The limits can also be
+       set by items at the start of the pattern of the form
 
-VALIDITY OF UTF STRINGS
+         (*LIMIT_MATCH=d)
+         (*LIMIT_RECURSION=d)
 
-       When  the  PCRE2_UTF  option is set, the strings passed as patterns and
-       subjects are (by default) checked for validity on entry to the relevant
-       functions.   If an invalid UTF string is passed, an negative error code
-       is returned. The code unit offset to the  offending  character  can  be
-       extracted  from  the match data block by calling pcre2_get_startchar(),
-       which is used for this purpose after a UTF error.
+       where d is any number of decimal digits. However, the value of the set-
+       ting  must  be  less than the value set (or defaulted) by the caller of
+       pcre2_match() for it to have any effect. In other  words,  the  pattern
+       writer  can lower the limits set by the programmer, but not raise them.
+       If there is more than one setting of one of  these  limits,  the  lower
+       value is used.
 
-       UTF-16 and UTF-32 strings can indicate their endianness by special code
-       knows  as  a  byte-order  mark (BOM). The PCRE2 functions do not handle
-       this, expecting strings to be in host byte order.
+   Newline conventions
 
-       The entire string is checked before any other processing  takes  place.
-       In  addition  to checking the format of the string, there is a check to
-       ensure that all code points lie in the range U+0 to U+10FFFF, excluding
-       the  surrogate area.  The so-called "non-character" code points are not
-       excluded because Unicode corrigendum #9 makes it clear that they should
-       not be.
+       PCRE2 supports five different conventions for indicating line breaks in
+       strings: a single CR (carriage return) character, a  single  LF  (line-
+       feed) character, the two-character sequence CRLF, any of the three pre-
+       ceding, or any Unicode newline sequence. The pcre2api page has  further
+       discussion  about newlines, and shows how to set the newline convention
+       when calling pcre2_compile().
+
+       It is also possible to specify a newline convention by starting a  pat-
+       tern string with one of the following five sequences:
+
+         (*CR)        carriage return
+         (*LF)        linefeed
+         (*CRLF)      carriage return, followed by linefeed
+         (*ANYCRLF)   any of the three above
+         (*ANY)       all Unicode newline sequences
+
+       These override the default and the options given to the compiling func-
+       tion. For example, on a Unix system where LF  is  the  default  newline
+       sequence, the pattern
+
+         (*CR)a.b
+
+       changes the convention to CR. That pattern matches "a\nb" because LF is
+       no longer a newline. If more than one of these settings is present, the
+       last one is used.
+
+       The  newline  convention affects where the circumflex and dollar asser-
+       tions are true. It also affects the interpretation of the dot metachar-
+       acter  when  PCRE2_DOTALL is not set, and the behaviour of \N. However,
+       it 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 setting can be combined with
+       a change of newline convention.
+
+   Specifying what \R matches
+
+       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
+       PCRE2_BSR_ANYCRLF at compile time. This effect can also be achieved  by
+       starting  a  pattern  with (*BSR_ANYCRLF). For completeness, (*BSR_UNI-
+       CODE) is also recognized, corresponding to PCRE2_BSR_UNICODE.
+
+
+EBCDIC CHARACTER CODES
+
+       PCRE2 can be compiled to run in an environment that uses EBCDIC as  its
+       character code rather than ASCII or Unicode (typically a mainframe sys-
+       tem). In the sections below, character code values are  ASCII  or  Uni-
+       code; in an EBCDIC environment these characters may have different code
+       values, and there are no code points greater than 255.
+
+
+CHARACTERS AND METACHARACTERS
+
+       A regular expression is a pattern that is  matched  against  a  subject
+       string  from  left  to right. Most characters stand for themselves in a
+       pattern, and match the corresponding characters in the  subject.  As  a
+       trivial example, the pattern
+
+         The quick brown fox
+
+       matches a portion of a subject string that is identical to itself. When
+       caseless matching is specified (the PCRE2_CASELESS option), letters are
+       matched independently of case.
+
+       The  power  of  regular  expressions  comes from the ability to include
+       alternatives and repetitions in the pattern. These are encoded  in  the
+       pattern by the use of metacharacters, which do not stand for themselves
+       but instead are interpreted in some special way.
+
+       There are two different sets of metacharacters: those that  are  recog-
+       nized  anywhere in the pattern except within square brackets, and those
+       that are recognized within square brackets.  Outside  square  brackets,
+       the metacharacters are as follows:
+
+         \      general escape character with several uses
+         ^      assert start of string (or line, in multiline mode)
+         $      assert end of string (or line, in multiline mode)
+         .      match any character except newline (by default)
+         [      start character class definition
+         |      start of alternative branch
+         (      start subpattern
+         )      end subpattern
+         ?      extends the meaning of (
+                also 0 or 1 quantifier
+                also quantifier minimizer
+         *      0 or more quantifier
+         +      1 or more quantifier
+                also "possessive quantifier"
+         {      start min/max quantifier
+
+       Part  of  a  pattern  that is in square brackets is called a "character
+       class". In a character class the only metacharacters are:
+
+         \      general escape character
+         ^      negate the class, but only if the first character
+         -      indicates character range
+         [      POSIX character class (only if followed by POSIX
+                  syntax)
+         ]      terminates the character class
+
+       The following sections describe the use of each of the metacharacters.
+
+
+BACKSLASH
+
+       The backslash character has several uses. Firstly, if it is followed by
+       a character that is not a number or a letter, it takes away any special
+       meaning that character may have. This use of  backslash  as  an  escape
+       character applies both inside and outside character classes.
+
+       For  example,  if  you want to match a * character, you write \* in the
+       pattern.  This escaping action applies whether  or  not  the  following
+       character  would  otherwise be interpreted as a metacharacter, so it is
+       always safe to precede a non-alphanumeric  with  backslash  to  specify
+       that  it stands for itself. In particular, if you want to match a back-
+       slash, you write \\.
+
+       In a UTF mode, only ASCII numbers and letters have any special  meaning
+       after  a  backslash.  All  other characters (in particular, those whose
+       codepoints are greater than 127) are treated as literals.
+
+       If a pattern is compiled with the  PCRE2_EXTENDED  option,  most  white
+       space  in the pattern (other than in a character class), and characters
+       between a # outside a character class and the next newline,  inclusive,
+       are ignored. An escaping backslash can be used to include a white space
+       or # character as part of the pattern.
+
+       If you want to remove the special meaning from a  sequence  of  charac-
+       ters,  you can do so by putting them between \Q and \E. This is differ-
+       ent from Perl in that $ and  @  are  handled  as  literals  in  \Q...\E
+       sequences  in PCRE2, whereas in Perl, $ and @ cause variable interpola-
+       tion. Note the following examples:
+
+         Pattern            PCRE2 matches   Perl matches
+
+         \Qabc$xyz\E        abc$xyz        abc followed by the
+                                             contents of $xyz
+         \Qabc\$xyz\E       abc\$xyz       abc\$xyz
+         \Qabc\E\$\Qxyz\E   abc$xyz        abc$xyz
+
+       The \Q...\E sequence is recognized both inside  and  outside  character
+       classes.   An  isolated \E that is not preceded by \Q is ignored. If \Q
+       is not followed by \E later in the pattern, the literal  interpretation
+       continues  to  the  end  of  the pattern (that is, \E is assumed at the
+       end). If the isolated \Q is inside a character class,  this  causes  an
+       error, because the character class is not terminated.
+
+   Non-printing characters
+
+       A second use of backslash provides a way of encoding non-printing char-
+       acters in patterns in a visible manner. There is no restriction on  the
+       appearance  of non-printing characters in a pattern, but when a pattern
+       is being prepared by text editing, it is often easier to use one of the
+       following  escape sequences than the binary character it represents. In
+       an ASCII or Unicode environment, these escapes are as follows:
+
+         \a        alarm, that is, the BEL character (hex 07)
+         \cx       "control-x", where x is any printable ASCII character
+         \e        escape (hex 1B)
+         \f        form feed (hex 0C)
+         \n        linefeed (hex 0A)
+         \r        carriage return (hex 0D)
+         \t        tab (hex 09)
+         \0dd      character with octal code 0dd
+         \ddd      character with octal code ddd, or back reference
+         \o{ddd..} character with octal code ddd..
+         \xhh      character with hex code hh
+         \x{hhh..} character with hex code hhh.. (default mode)
+         \uhhhh    character with hex code hhhh (when PCRE2_ALT_BSUX is set)
+
+       The precise effect of \cx on ASCII characters is as follows: if x is  a
+       lower  case  letter,  it  is converted to upper case. Then bit 6 of the
+       character (hex 40) is inverted. Thus \cA to \cZ become hex 01 to hex 1A
+       (A  is  41, Z is 5A), but \c{ becomes hex 3B ({ is 7B), and \c; becomes
+       hex 7B (; is 3B). If the code unit following \c has a value  less  than
+       32  or  greater  than  126, a compile-time error occurs. This locks out
+       non-printable ASCII characters in all modes.
+
+       When PCRE2 is compiled in EBCDIC mode, \a, \e, \f, \n, \r, and \t  gen-
+       erate the appropriate EBCDIC code values. The \c escape is processed as
+       specified for Perl in the perlebcdic document. The only characters that
+       are  allowed  after  \c are A-Z, a-z, or one of @, [, \, ], ^, _, or ?.
+       Any other character provokes a  compile-time  error.  The  sequence  \@
+       encodes  character  code 0; the letters (in either case) encode charac-
+       ters 1-26 (hex 01 to hex 1A); [, \, ], ^, and _ encode characters 27-31
+       (hex 1B to hex 1F), and \? becomes either 255 (hex FF) or 95 (hex 5F).
+
+       Thus,  apart  from  \?,  these escapes generate the same character code
+       values as they do in an ASCII environment, though the meanings  of  the
+       values  mostly  differ.  For example, \G always generates code value 7,
+       which is BEL in ASCII but DEL in EBCDIC.
+
+       The sequence \? generates DEL (127, hex 7F) in  an  ASCII  environment,
+       but  because  127  is  not a control character in EBCDIC, Perl makes it
+       generate the APC character. Unfortunately, there are  several  variants
+       of  EBCDIC.  In  most  of them the APC character has the value 255 (hex
+       FF), but in the one Perl calls POSIX-BC its value is 95  (hex  5F).  If
+       certain  other characters have POSIX-BC values, PCRE2 makes \? generate
+       95; otherwise it generates 255.
+
+       After \0 up to two further octal digits are read. If  there  are  fewer
+       than  two  digits,  just  those  that  are  present  are used. Thus the
+       sequence \0\x\015 specifies two binary zeros followed by a CR character
+       (code value 13). Make sure you supply two digits after the initial zero
+       if the pattern character that follows is itself an octal digit.
+
+       The escape \o must be followed by a sequence of octal digits,  enclosed
+       in  braces.  An  error occurs if this is not the case. This escape is a
+       recent addition to Perl; it provides way of specifying  character  code
+       points  as  octal  numbers  greater than 0777, and it also allows octal
+       numbers and back references to be unambiguously specified.
+
+       For greater clarity and unambiguity, it is best to avoid following \ by
+       a digit greater than zero. Instead, use \o{} or \x{} to specify charac-
+       ter numbers, and \g{} to specify back references. The  following  para-
+       graphs describe the old, ambiguous syntax.
+
+       The handling of a backslash followed by a digit other than 0 is compli-
+       cated, and Perl has changed over time, causing PCRE2 also to change.
+
+       Outside a character class, PCRE2 reads the digit and any following dig-
+       its as a decimal number. If the number is less than 10, begins with the
+       digit 8 or 9, or if there are at least  that  many  previous  capturing
+       left  parentheses  in the expression, the entire sequence is taken as a
+       back reference. A description of how this works is given later, follow-
+       ing  the  discussion  of  parenthesized  subpatterns.  Otherwise, up to
+       three octal digits are read to form a character code.
+
+       Inside a character class, PCRE2 handles \8 and \9 as the literal  char-
+       acters  "8"  and "9", and otherwise reads up to three octal digits fol-
+       lowing the backslash, using them to generate a data character. Any sub-
+       sequent  digits  stand for themselves. For example, outside a character
+       class:
+
+         \040   is another way of writing an ASCII space
+         \40    is the same, provided there are fewer than 40
+                   previous capturing subpatterns
+         \7     is always a back reference
+         \11    might be a back reference, or another way of
+                   writing a tab
+         \011   is always a tab
+         \0113  is a tab followed by the character "3"
+         \113   might be a back reference, otherwise the
+                   character with octal code 113
+         \377   might be a back reference, otherwise
+                   the value 255 (decimal)
+         \81    is always a back reference
+
+       Note that octal values of 100 or greater that are specified using  this
+       syntax  must  not be introduced by a leading zero, because no more than
+       three octal digits are ever read.
+
+       By default, after \x that is not followed by {, from zero to two  hexa-
+       decimal  digits  are  read (letters can be in upper or lower case). Any
+       number of hexadecimal digits may appear between \x{ and }. If a charac-
+       ter  other  than  a  hexadecimal digit appears between \x{ and }, or if
+       there is no terminating }, an error occurs.
+
+       If the PCRE2_ALT_BSUX option is set, the interpretation  of  \x  is  as
+       just described only when it is followed by two hexadecimal digits. Oth-
+       erwise, it matches a literal "x" character. In this mode mode,  support
+       for  code points greater than 256 is provided by \u, which must be fol-
+       lowed by four hexadecimal digits; otherwise it matches  a  literal  "u"
+       character.
+
+       Characters whose value is less than 256 can be defined by either of the
+       two syntaxes for \x (or by \u in PCRE2_ALT_BSUX mode). There is no dif-
+       ference  in  the way they are handled. For example, \xdc is exactly the
+       same as \x{dc} (or \u00dc in PCRE2_ALT_BSUX mode).
+
+   Constraints on character values
+
+       Characters that are specified using octal or  hexadecimal  numbers  are
+       limited to certain values, as follows:
+
+         8-bit non-UTF mode    less than 0x100
+         8-bit UTF-8 mode      less than 0x10ffff and a valid codepoint
+         16-bit non-UTF mode   less than 0x10000
+         16-bit UTF-16 mode    less than 0x10ffff and a valid codepoint
+         32-bit non-UTF mode   less than 0x100000000
+         32-bit UTF-32 mode    less than 0x10ffff and a valid codepoint
+
+       Invalid  Unicode  codepoints  are  the  range 0xd800 to 0xdfff (the so-
+       called "surrogate" codepoints), and 0xffef.
+
+   Escape sequences in character classes
+
+       All the sequences that define a single character value can be used both
+       inside  and  outside character classes. In addition, inside a character
+       class, \b is interpreted as the backspace character (hex 08).
+
+       \N is not allowed in a character class. \B, \R, and \X are not  special
+       inside  a  character  class.  Like other unrecognized alphabetic escape
+       sequences, they cause  an  error.  Outside  a  character  class,  these
+       sequences have different meanings.
+
+   Unsupported escape sequences
+
+       In  Perl, the sequences \l, \L, \u, and \U are recognized by its string
+       handler and used  to  modify  the  case  of  following  characters.  By
+       default, PCRE2 does not support these escape sequences. However, if the
+       PCRE2_ALT_BSUX option is set, \U matches a "U" character, and \u can be
+       used  to define a character by code point, as described in the previous
+       section.
+
+   Absolute and relative back references
+
+       The sequence \g followed by an unsigned or a negative  number,  option-
+       ally  enclosed  in braces, is an absolute or relative back reference. A
+       named back reference can be coded as \g{name}. Back references are dis-
+       cussed later, following the discussion of parenthesized subpatterns.
+
+   Absolute and relative subroutine calls
+
+       For  compatibility with Oniguruma, the non-Perl syntax \g followed by a
+       name or a number enclosed either in angle brackets or single quotes, is
+       an  alternative  syntax for referencing a subpattern as a "subroutine".
+       Details are discussed later.   Note  that  \g{...}  (Perl  syntax)  and
+       \g<...>  (Oniguruma  syntax)  are  not synonymous. The former is a back
+       reference; the latter is a subroutine call.
+
+   Generic character types
+
+       Another use of backslash is for specifying generic character types:
+
+         \d     any decimal digit
+         \D     any character that is not a decimal digit
+         \h     any horizontal white space character
+         \H     any character that is not a horizontal white space character
+         \s     any white space character
+         \S     any character that is not a white space character
+         \v     any vertical white space character
+         \V     any character that is not a vertical white space character
+         \w     any "word" character
+         \W     any "non-word" character
+
+       There is also the single sequence \N, which matches a non-newline char-
+       acter.   This is the same as the "." metacharacter when PCRE2_DOTALL is
+       not set. Perl also uses \N to match characters by name; PCRE2 does  not
+       support this.
+
+       Each  pair of lower and upper case escape sequences partitions the com-
+       plete set of characters into two disjoint  sets.  Any  given  character
+       matches  one, and only one, of each pair. The sequences can appear both
+       inside and outside character classes. They each match one character  of
+       the  appropriate  type.  If the current matching point is at the end of
+       the subject string, all of them fail, because there is no character  to
+       match.
+
+       The  default  \s  characters  are HT (9), LF (10), VT (11), FF (12), CR
+       (13), and space (32), which are defined  as  white  space  in  the  "C"
+       locale. This list may vary if locale-specific matching is taking place.
+       For example, in some locales the "non-breaking space" character  (\xA0)
+       is recognized as white space, and in others the VT character is not.
+
+       A  "word"  character is an underscore or any character that is a letter
+       or digit.  By default, the definition of letters  and  digits  is  con-
+       trolled by PCRE2's low-valued character tables, and may vary if locale-
+       specific matching is taking place (see "Locale support" in the pcre2api
+       page).  For  example,  in  a French locale such as "fr_FR" in Unix-like
+       systems, or "french" in Windows, some character codes greater than  127
+       are  used  for  accented letters, and these are then matched by \w. The
+       use of locales with Unicode is discouraged.
+
+       By default, characters whose code points are  greater  than  127  never
+       match \d, \s, or \w, and always match \D, \S, and \W, although this may
+       be different for characters in the range 128-255  when  locale-specific
+       matching  is  happening.   These escape sequences retain their original
+       meanings from before Unicode support was available,  mainly  for  effi-
+       ciency  reasons.  If  the  PCRE2_UCP  option  is  set, the behaviour is
+       changed so that Unicode properties  are  used  to  determine  character
+       types, as follows:
+
+         \d  any character that matches \p{Nd} (decimal digit)
+         \s  any character that matches \p{Z} or \h or \v
+         \w  any character that matches \p{L} or \p{N}, plus underscore
+
+       The  upper case escapes match the inverse sets of characters. Note that
+       \d matches only decimal digits, whereas \w matches any  Unicode  digit,
+       as well as any Unicode letter, and underscore. Note also that PCRE2_UCP
+       affects \b, and \B because they are defined in  terms  of  \w  and  \W.
+       Matching these sequences is noticeably slower when PCRE2_UCP is set.
+
+       The  sequences  \h, \H, \v, and \V, in contrast to the other sequences,
+       which match only ASCII characters by default, always match  a  specific
+       list  of  code  points, whether or not PCRE2_UCP is set. The horizontal
+       space characters are:
+
+         U+0009     Horizontal tab (HT)
+         U+0020     Space
+         U+00A0     Non-break space
+         U+1680     Ogham space mark
+         U+180E     Mongolian vowel separator
+         U+2000     En quad
+         U+2001     Em quad
+         U+2002     En space
+         U+2003     Em space
+         U+2004     Three-per-em space
+         U+2005     Four-per-em space
+         U+2006     Six-per-em space
+         U+2007     Figure space
+         U+2008     Punctuation space
+         U+2009     Thin space
+         U+200A     Hair space
+         U+202F     Narrow no-break space
+         U+205F     Medium mathematical space
+         U+3000     Ideographic space
+
+       The vertical space characters are:
+
+         U+000A     Linefeed (LF)
+         U+000B     Vertical tab (VT)
+         U+000C     Form feed (FF)
+         U+000D     Carriage return (CR)
+         U+0085     Next line (NEL)
+         U+2028     Line separator
+         U+2029     Paragraph separator
+
+       In 8-bit, non-UTF-8 mode, only the characters  with  code  points  less
+       than 256 are relevant.
+
+   Newline sequences
+
+       Outside  a  character class, by default, the escape sequence \R matches
+       any Unicode newline sequence. In 8-bit non-UTF-8 mode \R is  equivalent
+       to the following:
+
+         (?>\r\n|\n|\x0b|\f|\r|\x85)
+
+       This  is  an  example  of an "atomic group", details of which are given
+       below.  This particular group matches either the two-character sequence
+       CR  followed  by  LF,  or  one  of  the single characters LF (linefeed,
+       U+000A), VT (vertical tab, U+000B), FF (form feed,  U+000C),  CR  (car-
+       riage  return,  U+000D), or NEL (next line, U+0085). Because this is an
+       atomic group, the two-character sequence is treated as  a  single  unit
+       that cannot be split.
+
+       In  other modes, two additional characters whose codepoints are greater
+       than 255 are added: LS (line separator, U+2028) and PS (paragraph sepa-
+       rator,  U+2029).  Unicode support is not needed for 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
+       PCRE2_BSR_ANYCRLF at compile time. (BSR is an  abbrevation  for  "back-
+       slash R".) This can be made the default when PCRE2 is built; if this is
+       the case, the other behaviour can be requested via  the  PCRE2_BSR_UNI-
+       CODE  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 the compiling func-
+       tion.  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)
+
+       They  can also be combined with the (*UTF) or (*UCP) special sequences.
+       Inside a character class, \R  is  treated  as  an  unrecognized  escape
+       sequence, and causes an error.
+
+   Unicode character properties
+
+       When  PCRE2  is  built  with Unicode support (the default), three addi-
+       tional escape sequences that match characters with specific  properties
+       are  available.  In 8-bit non-UTF-8 mode, these sequences are of course
+       limited to testing characters whose codepoints are less than  256,  but
+       they do work in this mode.  The extra escape sequences are:
+
+         \p{xx}   a character with the xx property
+         \P{xx}   a character without the xx property
+         \X       a Unicode extended grapheme cluster
+
+       The  property  names represented by xx above are limited to the Unicode
+       script names, the general category properties, "Any", which matches any
+       character  (including  newline),  and  some  special  PCRE2  properties
+       (described in the next section).  Other Perl properties such as  "InMu-
+       sicalSymbols"  are  not supported by PCRE2.  Note that \P{Any} does not
+       match any characters, so always causes a match failure.
+
+       Sets of Unicode characters are defined as belonging to certain scripts.
+       A  character from one of these sets can be matched using a script name.
+       For example:
+
+         \p{Greek}
+         \P{Han}
+
+       Those that are not part of an identified script are lumped together  as
+       "Common". The current list of scripts is:
+
+       Ahom,   Anatolian_Hieroglyphs,  Arabic,  Armenian,  Avestan,  Balinese,
+       Bamum, Bassa_Vah, Batak, Bengali, Bopomofo, Brahmi, Braille,  Buginese,
+       Buhid,  Canadian_Aboriginal,  Carian, Caucasian_Albanian, Chakma, Cham,
+       Cherokee,  Common,  Coptic,  Cuneiform,  Cypriot,  Cyrillic,   Deseret,
+       Devanagari,  Duployan,  Egyptian_Hieroglyphs,  Elbasan, Ethiopic, Geor-
+       gian, Glagolitic, Gothic,  Grantha,  Greek,  Gujarati,  Gurmukhi,  Han,
+       Hangul, Hanunoo, Hatran, Hebrew, Hiragana, Imperial_Aramaic, Inherited,
+       Inscriptional_Pahlavi, Inscriptional_Parthian, Javanese,  Kaithi,  Kan-
+       nada,  Katakana,  Kayah_Li,  Kharoshthi, Khmer, Khojki, Khudawadi, Lao,
+       Latin, Lepcha, Limbu, Linear_A, Linear_B, Lisu, Lycian,  Lydian,  Maha-
+       jani,  Malayalam,  Mandaic,  Manichaean,  Meetei_Mayek,  Mende_Kikakui,
+       Meroitic_Cursive, Meroitic_Hieroglyphs,  Miao,  Modi,  Mongolian,  Mro,
+       Multani,   Myanmar,   Nabataean,  New_Tai_Lue,  Nko,  Ogham,  Ol_Chiki,
+       Old_Hungarian, Old_Italic, Old_North_Arabian, Old_Permic,  Old_Persian,
+       Old_South_Arabian, Old_Turkic, Oriya, Osmanya, Pahawh_Hmong, Palmyrene,
+       Pau_Cin_Hau,  Phags_Pa,  Phoenician,  Psalter_Pahlavi,  Rejang,  Runic,
+       Samaritan, Saurashtra, Sharada, Shavian, Siddham, SignWriting, Sinhala,
+       Sora_Sompeng,  Sundanese,  Syloti_Nagri,  Syriac,  Tagalog,   Tagbanwa,
+       Tai_Le,   Tai_Tham,  Tai_Viet,  Takri,  Tamil,  Telugu,  Thaana,  Thai,
+       Tibetan, Tifinagh, Tirhuta, Ugaritic, Vai, Warang_Citi, Yi.
+
+       Each character has exactly one Unicode general category property, spec-
+       ified  by a two-letter abbreviation. For compatibility with Perl, nega-
+       tion can be specified by including a  circumflex  between  the  opening
+       brace  and  the  property  name.  For  example,  \p{^Lu} is the same as
+       \P{Lu}.
+
+       If only one letter is specified with \p or \P, it includes all the gen-
+       eral  category properties that start with that letter. In this case, in
+       the absence of negation, the curly brackets in the escape sequence  are
+       optional; these two examples have the same effect:
+
+         \p{L}
+         \pL
+
+       The following general category property codes are supported:
+
+         C     Other
+         Cc    Control
+         Cf    Format
+         Cn    Unassigned
+         Co    Private use
+         Cs    Surrogate
+
+         L     Letter
+         Ll    Lower case letter
+         Lm    Modifier letter
+         Lo    Other letter
+         Lt    Title case letter
+         Lu    Upper case letter
+
+         M     Mark
+         Mc    Spacing mark
+         Me    Enclosing mark
+         Mn    Non-spacing mark
+
+         N     Number
+         Nd    Decimal number
+         Nl    Letter number
+         No    Other number
+
+         P     Punctuation
+         Pc    Connector punctuation
+         Pd    Dash punctuation
+         Pe    Close punctuation
+         Pf    Final punctuation
+         Pi    Initial punctuation
+         Po    Other punctuation
+         Ps    Open punctuation
+
+         S     Symbol
+         Sc    Currency symbol
+         Sk    Modifier symbol
+         Sm    Mathematical symbol
+         So    Other symbol
+
+         Z     Separator
+         Zl    Line separator
+         Zp    Paragraph separator
+         Zs    Space separator
+
+       The  special property L& is also supported: it matches a character that
+       has the Lu, Ll, or Lt property, in other words, a letter  that  is  not
+       classified as a modifier or "other".
+
+       The  Cs  (Surrogate)  property  applies only to characters in the range
+       U+D800 to U+DFFF. Such characters are not valid in Unicode strings  and
+       so  cannot  be  tested  by PCRE2, unless UTF validity checking has been
+       turned off (see the discussion of PCRE2_NO_UTF_CHECK  in  the  pcre2api
+       page). Perl does not support the Cs property.
+
+       The  long  synonyms  for  property  names  that  Perl supports (such as
+       \p{Letter}) are not supported by PCRE2, nor is it permitted  to  prefix
+       any of these properties with "Is".
+
+       No character that is in the Unicode table has the Cn (unassigned) prop-
+       erty.  Instead, this property is assumed for any code point that is not
+       in the Unicode table.
+
+       Specifying  caseless  matching  does not affect these escape sequences.
+       For example, \p{Lu} always matches only upper  case  letters.  This  is
+       different from the behaviour of current versions of Perl.
+
+       Matching  characters by Unicode property is not fast, because PCRE2 has
+       to do a multistage table lookup in order to find  a  character's  prop-
+       erty. That is why the traditional escape sequences such as \d and \w do
+       not use Unicode properties in PCRE2 by default,  though  you  can  make
+       them  do  so by setting the PCRE2_UCP option or by starting the pattern
+       with (*UCP).
+
+   Extended grapheme clusters
+
+       The \X escape matches any number of Unicode  characters  that  form  an
+       "extended grapheme cluster", and treats the sequence as an atomic group
+       (see below).  Unicode supports various kinds of composite character  by
+       giving  each  character  a grapheme breaking property, and having rules
+       that use these properties to define the boundaries of extended grapheme
+       clusters.  \X  always  matches  at least one character. Then it decides
+       whether to add additional characters according to the  following  rules
+       for ending a cluster:
+
+       1. End at the end of the subject string.
+
+       2.  Do not end between CR and LF; otherwise end after any control char-
+       acter.
 
-       Characters  in  the "Surrogate Area" of Unicode are reserved for use by
-       UTF-16, where they are used in pairs to encode code points with  values
-       greater  than  0xFFFF. The code points that are encoded by UTF-16 pairs
-       are available independently in the  UTF-8  and  UTF-32  encodings.  (In
-       other  words,  the  whole  surrogate  thing is a fudge for UTF-16 which
-       unfortunately messes up UTF-8 and UTF-32.)
+       3. Do not break Hangul (a Korean  script)  syllable  sequences.  Hangul
+       characters  are of five types: L, V, T, LV, and LVT. An L character may
+       be followed by an L, V, LV, or LVT character; an LV or V character  may
+       be followed by a V or T character; an LVT or T character may be follwed
+       only by a T character.
+
+       4. Do not end before extending characters or spacing marks.  Characters
+       with  the  "mark"  property  always have the "extend" grapheme breaking
+       property.
+
+       5. Do not end after prepend characters.
+
+       6. Otherwise, end the cluster.
+
+   PCRE2's additional properties
+
+       As well as the standard Unicode properties described above, PCRE2  sup-
+       ports  four  more  that  make it possible to convert traditional escape
+       sequences such as \w and \s to use Unicode properties. PCRE2 uses these
+       non-standard,  non-Perl  properties  internally  when PCRE2_UCP is set.
+       However, they may also be used explicitly. These properties are:
+
+         Xan   Any alphanumeric character
+         Xps   Any POSIX space character
+         Xsp   Any Perl space character
+         Xwd   Any Perl "word" character
+
+       Xan matches characters that have either the L (letter) or the  N  (num-
+       ber)  property. Xps matches the characters tab, linefeed, vertical tab,
+       form feed, or carriage return, and any other character that has  the  Z
+       (separator)  property.   Xsp  is  the  same as Xps; in PCRE1 it used to
+       exclude vertical tab, for Perl compatibility,  but  Perl  changed.  Xwd
+       matches the same characters as Xan, plus underscore.
+
+       There  is another non-standard property, Xuc, which matches any charac-
+       ter that can be represented by a Universal Character Name  in  C++  and
+       other  programming  languages.  These are the characters $, @, ` (grave
+       accent), and all characters with Unicode code points  greater  than  or
+       equal  to U+00A0, except for the surrogates U+D800 to U+DFFF. Note that
+       most base (ASCII) characters are excluded. (Universal  Character  Names
+       are  of  the  form \uHHHH or \UHHHHHHHH where H is a hexadecimal digit.
+       Note that the Xuc property does not match these sequences but the char-
+       acters that they represent.)
+
+   Resetting the match start
+
+       The  escape sequence \K causes any previously matched characters not to
+       be included in the final matched sequence. For example, the pattern:
+
+         foo\Kbar
+
+       matches "foobar", but reports that it has matched "bar".  This  feature
+       is  similar  to  a lookbehind assertion (described below).  However, in
+       this case, the part of the subject before the real match does not  have
+       to  be of fixed length, as lookbehind assertions do. The use of \K does
+       not interfere with the setting of captured  substrings.   For  example,
+       when the pattern
+
+         (foo)\Kbar
+
+       matches "foobar", the first substring is still set to "foo".
+
+       Perl  documents  that  the  use  of  \K  within assertions is "not well
+       defined". In PCRE2, \K is acted upon when  it  occurs  inside  positive
+       assertions,  but  is  ignored  in negative assertions. Note that when a
+       pattern such as (?=ab\K) matches, the reported start of the  match  can
+       be greater than the end of the match.
+
+   Simple assertions
+
+       The  final use of backslash is for certain simple assertions. An asser-
+       tion specifies a condition that has to be met at a particular point  in
+       a  match, without consuming any characters from the subject string. The
+       use of subpatterns for more complicated assertions is described  below.
+       The backslashed assertions are:
+
+         \b     matches at a word boundary
+         \B     matches when not at a word boundary
+         \A     matches at the start of the subject
+         \Z     matches at the end of the subject
+                 also matches before a newline at the end of the subject
+         \z     matches only at the end of the subject
+         \G     matches at the first matching position in the subject
+
+       Inside  a  character  class, \b has a different meaning; it matches the
+       backspace character. If any other of  these  assertions  appears  in  a
+       character class, an "invalid escape sequence" error is generated.
+
+       A  word  boundary is a position in the subject string where the current
+       character and the previous character do not both match \w or  \W  (i.e.
+       one  matches  \w  and the other matches \W), or the start or end of the
+       string if the first or last character matches \w,  respectively.  In  a
+       UTF  mode,  the  meanings  of  \w  and \W can be changed by setting the
+       PCRE2_UCP option. When this is done, it also affects \b and \B. Neither
+       PCRE2  nor Perl has a separate "start of word" or "end of word" metase-
+       quence. However, whatever follows \b normally determines which  it  is.
+       For example, the fragment \ba matches "a" at the start of a word.
+
+       The  \A,  \Z,  and \z assertions differ from the traditional circumflex
+       and dollar (described in the next section) in that they only ever match
+       at  the  very start and end of the subject string, whatever options are
+       set. Thus, they are independent of multiline mode. These  three  asser-
+       tions  are  not  affected  by the PCRE2_NOTBOL or PCRE2_NOTEOL options,
+       which affect only the behaviour of the circumflex and dollar  metachar-
+       acters.  However,  if the startoffset argument of pcre2_match() is non-
+       zero, indicating that matching is to start at a point  other  than  the
+       beginning  of  the subject, \A can never match.  The difference between
+       \Z and \z is that \Z matches before a newline at the end of the  string
+       as well as at the very end, whereas \z matches only at the end.
+
+       The  \G assertion is true only when the current matching position is at
+       the start point of the match, as specified by the startoffset  argument
+       of  pcre2_match().  It differs from \A when the value of startoffset is
+       non-zero. By calling  pcre2_match()  multiple  times  with  appropriate
+       arguments,  you  can  mimic Perl's /g option, and it is in this kind of
+       implementation where \G can be useful.
+
+       Note, however, that PCRE2's interpretation of \G, as the start  of  the
+       current match, is subtly different from Perl's, which defines it as the
+       end of the previous match. In Perl, these can  be  different  when  the
+       previously  matched string was empty. Because PCRE2 does just one match
+       at a time, it cannot reproduce this behaviour.
+
+       If all the alternatives of a pattern begin with \G, the  expression  is
+       anchored to the starting match position, and the "anchored" flag is set
+       in the compiled regular expression.
+
+
+CIRCUMFLEX AND DOLLAR
+
+       The circumflex and dollar  metacharacters  are  zero-width  assertions.
+       That  is,  they test for a particular condition being true without con-
+       suming any characters from the subject string. These two metacharacters
+       are  concerned  with matching the starts and ends of lines. If the new-
+       line convention is set so that only the two-character sequence CRLF  is
+       recognized  as  a newline, isolated CR and LF characters are treated as
+       ordinary data characters, and are not recognized as newlines.
+
+       Outside a character class, in the default matching mode, the circumflex
+       character  is  an  assertion  that is true only if the current matching
+       point is at the start of the subject string. If the  startoffset  argu-
+       ment  of  pcre2_match() is non-zero, or if PCRE2_NOTBOL is set, circum-
+       flex can never match if the PCRE2_MULTILINE option is unset.  Inside  a
+       character  class,  circumflex  has  an  entirely different meaning (see
+       below).
+
+       Circumflex need not be the first character of the pattern if  a  number
+       of  alternatives are involved, but it should be the first thing in each
+       alternative in which it appears if the pattern is ever  to  match  that
+       branch.  If all possible alternatives start with a circumflex, that is,
+       if the pattern is constrained to match only at the start  of  the  sub-
+       ject,  it  is  said  to be an "anchored" pattern. (There are also other
+       constructs that can cause a pattern to be anchored.)
+
+       The dollar character is an assertion that is true only if  the  current
+       matching  point  is  at  the  end of the subject string, or immediately
+       before a newline  at  the  end  of  the  string  (by  default),  unless
+       PCRE2_NOTEOL is set. Note, however, that it does not actually match the
+       newline. Dollar need not be the last character of the pattern if a num-
+       ber of alternatives are involved, but it should be the last item in any
+       branch in which it appears. Dollar has no special meaning in a  charac-
+       ter class.
+
+       The  meaning  of  dollar  can be changed so that it matches only at the
+       very end of the string, by setting the PCRE2_DOLLAR_ENDONLY  option  at
+       compile time. This does not affect the \Z assertion.
+
+       The meanings of the circumflex and dollar metacharacters are changed if
+       the PCRE2_MULTILINE option is set. When this  is  the  case,  a  dollar
+       character  matches before any newlines in the string, as well as at the
+       very end, and a circumflex matches immediately after internal  newlines
+       as  well as at the start of the subject string. It does not match after
+       a newline that ends the string, for compatibility with  Perl.  However,
+       this can be changed by setting the PCRE2_ALT_CIRCUMFLEX option.
+
+       For  example, the pattern /^abc$/ matches the subject string "def\nabc"
+       (where \n represents a newline) in multiline mode, but  not  otherwise.
+       Consequently,  patterns  that  are anchored in single line mode because
+       all branches start with ^ are not anchored in  multiline  mode,  and  a
+       match  for  circumflex  is  possible  when  the startoffset argument of
+       pcre2_match() is non-zero. The PCRE2_DOLLAR_ENDONLY option  is  ignored
+       if PCRE2_MULTILINE is set.
+
+       When  the  newline  convention (see "Newline conventions" below) recog-
+       nizes the two-character sequence CRLF as a newline, this is  preferred,
+       even  if  the  single  characters CR and LF are also recognized as new-
+       lines. For example, if the newline convention  is  "any",  a  multiline
+       mode  circumflex matches before "xyz" in the string "abc\r\nxyz" rather
+       than after CR, even though CR on its own is a valid newline.  (It  also
+       matches at the very start of the string, of course.)
+
+       Note  that  the sequences \A, \Z, and \z can be used to match the start
+       and end of the subject in both modes, and if all branches of a  pattern
+       start  with \A it is always anchored, whether or not PCRE2_MULTILINE is
+       set.
+
+
+FULL STOP (PERIOD, DOT) AND \N
+
+       Outside a character class, a dot in the pattern matches any one charac-
+       ter  in  the subject string except (by default) a character that signi-
+       fies the end of a line.
+
+       When a line ending is defined as a single character, dot never  matches
+       that  character; when the two-character sequence CRLF is used, dot does
+       not match CR if it is immediately followed  by  LF,  but  otherwise  it
+       matches  all characters (including isolated CRs and LFs). When any Uni-
+       code line endings are being recognized, dot does not match CR or LF  or
+       any of the other line ending characters.
+
+       The  behaviour  of  dot  with regard to newlines can be changed. If the
+       PCRE2_DOTALL option is set, a dot matches any  one  character,  without
+       exception.   If  the two-character sequence CRLF is present in the sub-
+       ject string, it takes two dots to match it.
+
+       The handling of dot is entirely independent of the handling of  circum-
+       flex  and  dollar,  the  only relationship being that they both involve
+       newlines. Dot has no special meaning in a character class.
+
+       The escape sequence \N behaves like  a  dot,  except  that  it  is  not
+       affected  by  the  PCRE2_DOTALL  option. In other words, it matches any
+       character except one that signifies the end of a line. Perl  also  uses
+       \N to match characters by name; PCRE2 does not support this.
+
+
+MATCHING A SINGLE CODE UNIT
+
+       Outside  a character class, the escape sequence \C matches any one code
+       unit, whether or not a UTF mode is set. In the 8-bit library, one  code
+       unit  is  one  byte;  in the 16-bit library it is a 16-bit unit; in the
+       32-bit library it is a 32-bit unit. Unlike a  dot,  \C  always  matches
+       line-ending  characters.  The  feature  is provided in Perl in order to
+       match individual bytes in UTF-8 mode, but it is unclear how it can use-
+       fully be used.
+
+       Because  \C  breaks  up characters into individual code units, matching
+       one unit with \C in UTF-8 or UTF-16 mode means that  the  rest  of  the
+       string  may  start  with  a malformed UTF character. This has undefined
+       results, because PCRE2 assumes that it is matching character by charac-
+       ter  in  a  valid UTF string (by default it checks the subject string's
+       validity at the  start  of  processing  unless  the  PCRE2_NO_UTF_CHECK
+       option is used).
+
+       An   application   can   lock   out  the  use  of  \C  by  setting  the
+       PCRE2_NEVER_BACKSLASH_C option when compiling a  pattern.  It  is  also
+       possible to build PCRE2 with the use of \C permanently disabled.
+
+       PCRE2  does  not allow \C to appear in lookbehind assertions (described
+       below) in a UTF mode, because this would make it impossible  to  calcu-
+       late  the  length  of  the lookbehind. Neither the alternative matching
+       function pcre2_dfa_match() not the JIT optimizer support \C  in  a  UTF
+       mode. The former gives a match-time error; the latter fails to optimize
+       and so the match is always run using the interpreter.
+
+       In general, the \C escape sequence is best avoided. However, one way of
+       using  it that avoids the problem of malformed UTF characters is to use
+       a lookahead to check the length of the next character, as in this  pat-
+       tern,  which  could be used with a UTF-8 string (ignore white space and
+       line breaks):
+
+         (?| (?=[\x00-\x7f])(\C) |
+             (?=[\x80-\x{7ff}])(\C)(\C) |
+             (?=[\x{800}-\x{ffff}])(\C)(\C)(\C) |
+             (?=[\x{10000}-\x{1fffff}])(\C)(\C)(\C)(\C))
+
+       In this example, a group that starts  with  (?|  resets  the  capturing
+       parentheses numbers in each alternative (see "Duplicate Subpattern Num-
+       bers" below). The assertions at the start of each branch check the next
+       UTF-8  character  for  values  whose encoding uses 1, 2, 3, or 4 bytes,
+       respectively. The character's individual bytes are then captured by the
+       appropriate number of \C groups.
+
+
+SQUARE BRACKETS AND CHARACTER CLASSES
+
+       An opening square bracket introduces a character class, terminated by a
+       closing square bracket. A closing square bracket on its own is not spe-
+       cial  by  default.  If a closing square bracket is required as a member
+       of the class, it should be the first data character in the class (after
+       an  initial  circumflex,  if present) or escaped with a backslash. This
+       means that, by default, an empty class cannot be defined.  However,  if
+       the  PCRE2_ALLOW_EMPTY_CLASS option is set, a closing square bracket at
+       the start does end the (empty) class.
+
+       A character class matches a single character in the subject. A  matched
+       character must be in the set of characters defined by the class, unless
+       the first character in the class definition is a circumflex,  in  which
+       case the subject character must not be in the set defined by the class.
+       If a circumflex is actually required as a member of the  class,  ensure
+       it is not the first character, or escape it with a backslash.
+
+       For  example, the character class [aeiou] matches any lower case vowel,
+       while [^aeiou] matches any character that is not a  lower  case  vowel.
+       Note that a circumflex is just a convenient notation for specifying the
+       characters that are in the class by enumerating those that are  not.  A
+       class  that starts with a circumflex is not an assertion; it still con-
+       sumes a character from the subject string, and therefore  it  fails  if
+       the current pointer is at the end of the string.
+
+       When  caseless  matching  is set, any letters in a class represent both
+       their upper case and lower case versions, so for  example,  a  caseless
+       [aeiou]  matches  "A"  as well as "a", and a caseless [^aeiou] does not
+       match "A", whereas a caseful version would.
+
+       Characters that might indicate line breaks are  never  treated  in  any
+       special  way  when  matching  character  classes,  whatever line-ending
+       sequence is in use,  and  whatever  setting  of  the  PCRE2_DOTALL  and
+       PCRE2_MULTILINE  options  is  used. A class such as [^a] always matches
+       one of these characters.
+
+       The minus (hyphen) character can be used to specify a range of  charac-
+       ters  in  a  character  class.  For  example,  [d-m] matches any letter
+       between d and m, inclusive. If a  minus  character  is  required  in  a
+       class,  it  must  be  escaped  with a backslash or appear in a position
+       where it cannot be interpreted as indicating a range, typically as  the
+       first or last character in the class, or immediately after a range. For
+       example, [b-d-z] matches letters in the range b to d, a hyphen  charac-
+       ter, or z.
+
+       It is not possible to have the literal character "]" as the end charac-
+       ter of a range. A pattern such as [W-]46] is interpreted as a class  of
+       two  characters ("W" and "-") followed by a literal string "46]", so it
+       would match "W46]" or "-46]". However, if the "]"  is  escaped  with  a
+       backslash  it is interpreted as the end of range, so [W-\]46] is inter-
+       preted as a class containing a range followed by two other  characters.
+       The  octal or hexadecimal representation of "]" can also be used to end
+       a range.
+
+       An error is generated if a POSIX character  class  (see  below)  or  an
+       escape  sequence other than one that defines a single character appears
+       at a point where a range ending character  is  expected.  For  example,
+       [z-\xff] is valid, but [A-\d] and [A-[:digit:]] are not.
+
+       Ranges normally include all code points between the start and end char-
+       acters, inclusive. They can also be  used  for  code  points  specified
+       numerically, for example [\000-\037]. Ranges can include any characters
+       that are valid for the current mode.
+
+       There is a special case in EBCDIC environments  for  ranges  whose  end
+       points are both specified as literal letters in the same case. For com-
+       patibility with Perl, EBCDIC code points within the range that are  not
+       letters  are  omitted. For example, [h-k] matches only four characters,
+       even though the codes for h and k are 0x88 and 0x92, a range of 11 code
+       points.  However,  if  the range is specified numerically, for example,
+       [\x88-\x92] or [h-\x92], all code points are included.
+
+       If a range that includes letters is used when caseless matching is set,
+       it matches the letters in either case. For example, [W-c] is equivalent
+       to [][\\^_`wxyzabc], matched caselessly, and  in  a  non-UTF  mode,  if
+       character  tables  for  a French locale are in use, [\xc8-\xcb] matches
+       accented E characters in both cases.
+
+       The character escape sequences \d, \D, \h, \H, \p, \P, \s, \S, \v,  \V,
+       \w, and \W may appear in a character class, and add the characters that
+       they match to the class. For example, [\dABCDEF] matches any  hexadeci-
+       mal  digit.  In UTF modes, the PCRE2_UCP option affects the meanings of
+       \d, \s, \w and their upper case partners, just as  it  does  when  they
+       appear  outside a character class, as described in the section entitled
+       "Generic character types" above. The escape sequence \b has a different
+       meaning  inside  a character class; it matches the backspace character.
+       The sequences \B, \N, \R, and \X are not  special  inside  a  character
+       class.  Like  any  other  unrecognized  escape sequences, they cause an
+       error.
+
+       A circumflex can conveniently be used with  the  upper  case  character
+       types  to specify a more restricted set of characters than the matching
+       lower case type.  For example, the class [^\W_] matches any  letter  or
+       digit, but not underscore, whereas [\w] includes underscore. A positive
+       character class should be read as "something OR something OR ..." and a
+       negative class as "NOT something AND NOT something AND NOT ...".
+
+       The  only  metacharacters  that are recognized in character classes are
+       backslash, hyphen (only where it can be  interpreted  as  specifying  a
+       range),  circumflex  (only  at the start), opening square bracket (only
+       when it can be interpreted as introducing a POSIX class name, or for  a
+       special  compatibility  feature  -  see the next two sections), and the
+       terminating  closing  square  bracket.  However,  escaping  other  non-
+       alphanumeric characters does no harm.
+
+
+POSIX CHARACTER CLASSES
+
+       Perl supports the POSIX notation for character classes. This uses names
+       enclosed by [: and :] within the enclosing square brackets. PCRE2  also
+       supports this notation. For example,
+
+         [01[:alpha:]%]
+
+       matches "0", "1", any alphabetic character, or "%". The supported class
+       names are:
+
+         alnum    letters and digits
+         alpha    letters
+         ascii    character codes 0 - 127
+         blank    space or tab only
+         cntrl    control characters
+         digit    decimal digits (same as \d)
+         graph    printing characters, excluding space
+         lower    lower case letters
+         print    printing characters, including space
+         punct    printing characters, excluding letters and digits and space
+         space    white space (the same as \s from PCRE2 8.34)
+         upper    upper case letters
+         word     "word" characters (same as \w)
+         xdigit   hexadecimal digits
+
+       The default "space" characters are HT (9), LF (10), VT (11),  FF  (12),
+       CR  (13),  and space (32). If locale-specific matching is taking place,
+       the list of space characters may be different; there may  be  fewer  or
+       more of them. "Space" and \s match the same set of characters.
+
+       The  name  "word"  is  a Perl extension, and "blank" is a GNU extension
+       from Perl 5.8. Another Perl extension is negation, which  is  indicated
+       by a ^ character after the colon. For example,
+
+         [12[:^digit:]]
+
+       matches "1", "2", or any non-digit. PCRE2 (and Perl) also recognize the
+       POSIX syntax [.ch.] and [=ch=] where "ch" is a "collating element", but
+       these are not supported, and an error is given if they are encountered.
+
+       By default, characters with values greater than 127 do not match any of
+       the POSIX character classes, although this may be different for charac-
+       ters  in  the range 128-255 when locale-specific matching is happening.
+       However, if the PCRE2_UCP option is passed to pcre2_compile(), some  of
+       the  classes are changed so that Unicode character properties are used.
+       This  is  achieved  by  replacing  certain  POSIX  classes  with  other
+       sequences, as follows:
+
+         [:alnum:]  becomes  \p{Xan}
+         [:alpha:]  becomes  \p{L}
+         [:blank:]  becomes  \h
+         [:cntrl:]  becomes  \p{Cc}
+         [:digit:]  becomes  \p{Nd}
+         [:lower:]  becomes  \p{Ll}
+         [:space:]  becomes  \p{Xps}
+         [:upper:]  becomes  \p{Lu}
+         [:word:]   becomes  \p{Xwd}
+
+       Negated  versions, such as [:^alpha:] use \P instead of \p. Three other
+       POSIX classes are handled specially in UCP mode:
+
+       [:graph:] This matches characters that have glyphs that mark  the  page
+                 when printed. In Unicode property terms, it matches all char-
+                 acters with the L, M, N, P, S, or Cf properties, except for:
+
+                   U+061C           Arabic Letter Mark
+                   U+180E           Mongolian Vowel Separator
+                   U+2066 - U+2069  Various "isolate"s
+
+
+       [:print:] This matches the same  characters  as  [:graph:]  plus  space
+                 characters  that  are  not controls, that is, characters with
+                 the Zs property.
+
+       [:punct:] This matches all characters that have the Unicode P (punctua-
+                 tion)  property,  plus those characters with code points less
+                 than 256 that have the S (Symbol) property.
+
+       The other POSIX classes are unchanged, and match only  characters  with
+       code points less than 256.
+
+
+COMPATIBILITY FEATURE FOR WORD BOUNDARIES
+
+       In  the POSIX.2 compliant library that was included in 4.4BSD Unix, the
+       ugly syntax [[:<:]] and [[:>:]] is used for matching  "start  of  word"
+       and "end of word". PCRE2 treats these items as follows:
+
+         [[:<:]]  is converted to  \b(?=\w)
+         [[:>:]]  is converted to  \b(?<=\w)
+
+       Only these exact character sequences are recognized. A sequence such as
+       [a[:<:]b] provokes error for an unrecognized  POSIX  class  name.  This
+       support  is not compatible with Perl. It is provided to help migrations
+       from other environments, and is best not used in any new patterns. Note
+       that  \b matches at the start and the end of a word (see "Simple asser-
+       tions" above), and in a Perl-style pattern the preceding  or  following
+       character  normally  shows  which  is  wanted, without the need for the
+       assertions that are used above in order to give exactly the  POSIX  be-
+       haviour.
 
-       In some situations, you may already know that your strings  are  valid,
-       and  therefore  want  to  skip these checks in order to improve perfor-
-       mance, for example in the case of a long subject string that  is  being
-       scanned  repeatedly.   If you set the PCRE2_NO_UTF_CHECK option at com-
-       pile time or at match time, PCRE2 assumes that the pattern  or  subject
-       it is given (respectively) contains only valid UTF code unit sequences.
 
-       Passing  PCRE2_NO_UTF_CHECK  to pcre2_compile() just disables the check
-       for the pattern; it does not also apply to subject strings. If you want
-       to  disable the check for a subject string you must pass this option to
-       pcre2_match() or pcre2_dfa_match().
+VERTICAL BAR
+
+       Vertical  bar characters are used to separate alternative patterns. For
+       example, the pattern
+
+         gilbert|sullivan
+
+       matches either "gilbert" or "sullivan". Any number of alternatives  may
+       appear,  and  an  empty  alternative  is  permitted (matching the empty
+       string). The matching process tries each alternative in turn, from left
+       to  right, and the first one that succeeds is used. If the alternatives
+       are within a subpattern (defined below), "succeeds" means matching  the
+       rest of the main pattern as well as the alternative in the subpattern.
+
 
-       If you pass an invalid UTF string when PCRE2_NO_UTF_CHECK is  set,  the
-       result is undefined and your program may crash or loop indefinitely.
+INTERNAL OPTION SETTING
 
-   Errors in UTF-8 strings
+       The  settings of the PCRE2_CASELESS, PCRE2_MULTILINE, PCRE2_DOTALL, and
+       PCRE2_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
 
-       The following negative error codes are given for invalid UTF-8 strings:
+         i  for PCRE2_CASELESS
+         m  for PCRE2_MULTILINE
+         s  for PCRE2_DOTALL
+         x  for PCRE2_EXTENDED
 
-         PCRE2_ERROR_UTF8_ERR1
-         PCRE2_ERROR_UTF8_ERR2
-         PCRE2_ERROR_UTF8_ERR3
-         PCRE2_ERROR_UTF8_ERR4
-         PCRE2_ERROR_UTF8_ERR5
+       For example, (?im) sets caseless, multiline matching. It is also possi-
+       ble to unset these options by preceding the letter with a hyphen, and a
+       combined setting and unsetting such as (?im-sx), which sets PCRE2_CASE-
+       LESS    and    PCRE2_MULTILINE   while   unsetting   PCRE2_DOTALL   and
+       PCRE2_EXTENDED, is also permitted. If a letter appears both before  and
+       after  the  hyphen, the option is unset. An empty options setting "(?)"
+       is allowed. Needless to say, it has no effect.
 
-       The  string  ends  with a truncated UTF-8 character; the code specifies
-       how many bytes are missing (1 to 5). Although RFC 3629 restricts  UTF-8
-       characters  to  be  no longer than 4 bytes, the encoding scheme (origi-
-       nally defined by RFC 2279) allows for  up  to  6  bytes,  and  this  is
-       checked first; hence the possibility of 4 or 5 missing bytes.
+       The PCRE2-specific options PCRE2_DUPNAMES  and  PCRE2_UNGREEDY  can  be
+       changed  in  the  same  way as the Perl-compatible options by using the
+       characters J and U respectively.
 
-         PCRE2_ERROR_UTF8_ERR6
-         PCRE2_ERROR_UTF8_ERR7
-         PCRE2_ERROR_UTF8_ERR8
-         PCRE2_ERROR_UTF8_ERR9
-         PCRE2_ERROR_UTF8_ERR10
+       When one of these option changes occurs at  top  level  (that  is,  not
+       inside  subpattern parentheses), the change applies to the remainder of
+       the pattern that follows. If the change is placed right at the start of
+       a  pattern,  PCRE2  extracts  it  into  the global options (and it will
+       therefore show up in data extracted by the  pcre2_pattern_info()  func-
+       tion).
 
-       The two most significant bits of the 2nd, 3rd, 4th, 5th, or 6th byte of
-       the character do not have the binary value 0b10 (that  is,  either  the
-       most significant bit is 0, or the next bit is 1).
+       An  option  change  within a subpattern (see below for a description of
+       subpatterns) affects only that part of the subpattern that follows  it,
+       so
 
-         PCRE2_ERROR_UTF8_ERR11
-         PCRE2_ERROR_UTF8_ERR12
+         (a(?i)b)c
 
-       A  character that is valid by the RFC 2279 rules is either 5 or 6 bytes
-       long; these code points are excluded by RFC 3629.
+       matches  abc  and  aBc and no other strings (assuming PCRE2_CASELESS is
+       not used).  By this means, options can be made to have  different  set-
+       tings in different parts of the pattern. Any changes made in one alter-
+       native do carry on into subsequent branches within the same subpattern.
+       For example,
 
-         PCRE2_ERROR_UTF8_ERR13
+         (a(?i)b|c)
 
-       A 4-byte character has a value greater than 0x10fff; these code  points
-       are excluded by RFC 3629.
+       matches  "ab",  "aB",  "c",  and "C", even though when matching "C" the
+       first branch is abandoned before the option setting.  This  is  because
+       the  effects  of option settings happen at compile time. There would be
+       some very weird behaviour otherwise.
 
-         PCRE2_ERROR_UTF8_ERR14
+       As a convenient shorthand, if any option settings are required  at  the
+       start  of a non-capturing subpattern (see the next section), the option
+       letters may appear between the "?" and the ":". Thus the two patterns
 
-       A  3-byte  character  has  a  value in the range 0xd800 to 0xdfff; this
-       range of code points are reserved by RFC 3629 for use with UTF-16,  and
-       so are excluded from UTF-8.
+         (?i:saturday|sunday)
+         (?:(?i)saturday|sunday)
 
-         PCRE2_ERROR_UTF8_ERR15
-         PCRE2_ERROR_UTF8_ERR16
-         PCRE2_ERROR_UTF8_ERR17
-         PCRE2_ERROR_UTF8_ERR18
-         PCRE2_ERROR_UTF8_ERR19
+       match exactly the same set of strings.
 
-       A  2-, 3-, 4-, 5-, or 6-byte character is "overlong", that is, it codes
-       for a value that can be represented by fewer bytes, which  is  invalid.
-       For  example,  the two bytes 0xc0, 0xae give the value 0x2e, whose cor-
-       rect coding uses just one byte.
+       Note: There are other PCRE2-specific options that can  be  set  by  the
+       application when the compiling function is called. The pattern can con-
+       tain special leading sequences such as (*CRLF)  to  override  what  the
+       application  has  set  or what has been defaulted. Details are given in
+       the section entitled "Newline sequences"  above.  There  are  also  the
+       (*UTF)  and  (*UCP)  leading  sequences that can be used to set UTF and
+       Unicode property modes; they are equivalent to  setting  the  PCRE2_UTF
+       and  PCRE2_UCP  options, respectively. However, the application can set
+       the PCRE2_NEVER_UTF and PCRE2_NEVER_UCP options, which lock out the use
+       of the (*UTF) and (*UCP) sequences.
 
-         PCRE2_ERROR_UTF8_ERR20
 
-       The two most significant bits of the first byte of a character have the
-       binary  value 0b10 (that is, the most significant bit is 1 and the sec-
-       ond is 0). Such a byte can only validly occur as the second  or  subse-
-       quent byte of a multi-byte character.
+SUBPATTERNS
 
-         PCRE2_ERROR_UTF8_ERR21
+       Subpatterns are delimited by parentheses (round brackets), which can be
+       nested.  Turning part of a pattern into a subpattern does two things:
 
-       The  first byte of a character has the value 0xfe or 0xff. These values
-       can never occur in a valid UTF-8 string.
+       1. It localizes a set of alternatives. For example, the pattern
 
-   Errors in UTF-16 strings
+         cat(aract|erpillar|)
 
-       The following  negative  error  codes  are  given  for  invalid  UTF-16
-       strings:
+       matches "cataract", "caterpillar", or "cat". Without  the  parentheses,
+       it would match "cataract", "erpillar" or an empty string.
 
-         PCRE_UTF16_ERR1  Missing low surrogate at end of string
-         PCRE_UTF16_ERR2  Invalid low surrogate follows high surrogate
-         PCRE_UTF16_ERR3  Isolated low surrogate
+       2.  It  sets  up  the  subpattern as a capturing subpattern. This means
+       that, when the whole pattern matches, the portion of the subject string
+       that  matched  the  subpattern is passed back to the caller, separately
+       from the portion that matched the whole pattern. (This applies only  to
+       the  traditional  matching function; the DFA matching function does not
+       support capturing.)
 
+       Opening parentheses are counted from left to right (starting from 1) to
+       obtain  numbers  for  the  capturing  subpatterns.  For example, if the
+       string "the red king" is matched against the pattern
 
-   Errors in UTF-32 strings
+         the ((red|white) (king|queen))
 
-       The  following  negative  error  codes  are  given  for  invalid UTF-32
-       strings:
+       the captured substrings are "red king", "red", and "king", and are num-
+       bered 1, 2, and 3, respectively.
 
-         PCRE_UTF32_ERR1  Surrogate character (range from 0xd800 to 0xdfff)
-         PCRE_UTF32_ERR2  Code point is greater than 0x10ffff
+       The  fact  that  plain  parentheses  fulfil two functions is not always
+       helpful.  There are often times when a grouping subpattern is  required
+       without  a capturing requirement. If an opening parenthesis is followed
+       by a question mark and a colon, the subpattern does not do any  captur-
+       ing,  and  is  not  counted when computing the number of any subsequent
+       capturing subpatterns. For example, if the string "the white queen"  is
+       matched against the pattern
+
+         the ((?:red|white) (king|queen))
+
+       the captured substrings are "white queen" and "queen", and are numbered
+       1 and 2. The maximum number of capturing subpatterns is 65535.
+
+       As a convenient shorthand, if any option settings are required  at  the
+       start  of  a  non-capturing  subpattern,  the option letters may appear
+       between the "?" and the ":". Thus the two patterns
+
+         (?i:saturday|sunday)
+         (?:(?i)saturday|sunday)
+
+       match exactly the same set of strings. Because alternative branches are
+       tried  from  left  to right, and options are not reset until the end of
+       the subpattern is reached, an option setting in one branch does  affect
+       subsequent  branches,  so  the above patterns match "SUNDAY" as well as
+       "Saturday".
+
+
+DUPLICATE SUBPATTERN NUMBERS
+
+       Perl 5.10 introduced a feature whereby each alternative in a subpattern
+       uses  the same numbers for its capturing parentheses. Such a subpattern
+       starts with (?| and is itself a non-capturing subpattern. For  example,
+       consider this pattern:
 
+         (?|(Sat)ur|(Sun))day
 
-AUTHOR
+       Because  the two alternatives are inside a (?| group, both sets of cap-
+       turing parentheses are numbered one. Thus, when  the  pattern  matches,
+       you  can  look  at captured substring number one, whichever alternative
+       matched. This construct is useful when you want to  capture  part,  but
+       not all, of one of a number of alternatives. Inside a (?| group, paren-
+       theses are numbered as usual, but the number is reset at the  start  of
+       each  branch.  The numbers of any capturing parentheses that follow the
+       subpattern start after the highest number used in any branch. The  fol-
+       lowing example is taken from the Perl documentation. The numbers under-
+       neath show in which buffer the captured content will be stored.
+
+         # before  ---------------branch-reset----------- after
+         / ( a )  (?| x ( y ) z | (p (q) r) | (t) u (v) ) ( z ) /x
+         # 1            2         2  3        2     3     4
+
+       A back reference to a numbered subpattern uses the  most  recent  value
+       that  is  set  for that number by any subpattern. The following pattern
+       matches "abcabc" or "defdef":
+
+         /(?|(abc)|(def))\1/
+
+       In contrast, a subroutine call to a numbered subpattern  always  refers
+       to  the  first  one in the pattern with the given number. The following
+       pattern matches "abcabc" or "defabc":
+
+         /(?|(abc)|(def))(?1)/
+
+       A relative reference such as (?-1) is no different: it is just a conve-
+       nient way of computing an absolute group number.
+
+       If  a condition test for a subpattern's having matched refers to a non-
+       unique number, the test is true if any of the subpatterns of that  num-
+       ber have matched.
+
+       An  alternative approach to using this "branch reset" feature is to use
+       duplicate named subpatterns, as described in the next section.
+
+
+NAMED SUBPATTERNS
+
+       Identifying capturing parentheses by number is simple, but  it  can  be
+       very  hard  to keep track of the numbers in complicated regular expres-
+       sions. Furthermore, if an  expression  is  modified,  the  numbers  may
+       change. To help with this difficulty, PCRE2 supports the naming of sub-
+       patterns. This feature was not added to Perl until release 5.10. Python
+       had  the feature earlier, and PCRE1 introduced it at release 4.0, using
+       the Python syntax. PCRE2 supports both the Perl and the Python  syntax.
+       Perl  allows  identically numbered subpatterns to have different names,
+       but PCRE2 does not.
+
+       In PCRE2, a subpattern can be named in one of three ways:  (?<name>...)
+       or  (?'name'...)  as in Perl, or (?P<name>...) as in Python. References
+       to capturing parentheses from other parts of the pattern, such as  back
+       references,  recursion,  and conditions, can be made by name as well as
+       by number.
+
+       Names consist of up to 32 alphanumeric characters and underscores,  but
+       must  start  with  a  non-digit.  Named capturing parentheses are still
+       allocated numbers as well as names, exactly as if the  names  were  not
+       present. The PCRE2 API provides function calls for extracting the name-
+       to-number translation table from a compiled  pattern.  There  are  also
+       convenience functions for extracting a captured substring by name.
+
+       By  default, a name must be unique within a pattern, but it is possible
+       to relax this constraint by setting the PCRE2_DUPNAMES option  at  com-
+       pile  time.  (Duplicate names are also always permitted for subpatterns
+       with the same number, set up as described  in  the  previous  section.)
+       Duplicate  names  can be useful for patterns where only one instance of
+       the named parentheses can match.  Suppose you want to match the name of
+       a  weekday,  either as a 3-letter abbreviation or as the full name, and
+       in both cases you  want  to  extract  the  abbreviation.  This  pattern
+       (ignoring the line breaks) does the job:
+
+         (?<DN>Mon|Fri|Sun)(?:day)?|
+         (?<DN>Tue)(?:sday)?|
+         (?<DN>Wed)(?:nesday)?|
+         (?<DN>Thu)(?:rsday)?|
+         (?<DN>Sat)(?:urday)?
+
+       There  are  five capturing substrings, but only one is ever set after a
+       match.  (An alternative way of solving this problem is to use a "branch
+       reset" subpattern, as described in the previous section.)
+
+       The  convenience  functions for extracting the data by name returns the
+       substring for the first (and in this example, the only)  subpattern  of
+       that  name  that  matched.  This saves searching to find which numbered
+       subpattern it was.
+
+       If you make a back reference to  a  non-unique  named  subpattern  from
+       elsewhere  in the pattern, the subpatterns to which the name refers are
+       checked in the order in which they appear in the overall  pattern.  The
+       first one that is set is used for the reference. For example, this pat-
+       tern matches both "foofoo" and "barbar" but not "foobar" or "barfoo":
+
+         (?:(?<n>foo)|(?<n>bar))\k<n>
+
+
+       If you make a subroutine call to a non-unique named subpattern, the one
+       that  corresponds  to  the first occurrence of the name is used. In the
+       absence of duplicate numbers (see the previous section) this is the one
+       with the lowest number.
+
+       If you use a named reference in a condition test (see the section about
+       conditions below), either to check whether a subpattern has matched, or
+       to  check for recursion, all subpatterns with the same name are tested.
+       If the condition is true for any one of them, the overall condition  is
+       true.  This  is  the  same  behaviour as testing by number. For further
+       details of the interfaces  for  handling  named  subpatterns,  see  the
+       pcre2api documentation.
+
+       Warning: You cannot use different names to distinguish between two sub-
+       patterns with the same number because PCRE2 uses only the numbers  when
+       matching. For this reason, an error is given at compile time if differ-
+       ent names are given to subpatterns with the same number.  However,  you
+       can always give the same name to subpatterns with the same number, even
+       when PCRE2_DUPNAMES is not set.
+
+
+REPETITION
+
+       Repetition is specified by quantifiers, which can  follow  any  of  the
+       following items:
+
+         a literal data character
+         the dot metacharacter
+         the \C escape sequence
+         the \X escape sequence
+         the \R escape sequence
+         an escape such as \d or \pL that matches a single character
+         a character class
+         a back reference
+         a parenthesized subpattern (including most assertions)
+         a subroutine call to a subpattern (recursive or otherwise)
+
+       The  general repetition quantifier specifies a minimum and maximum num-
+       ber of permitted matches, by giving the two numbers in  curly  brackets
+       (braces),  separated  by  a comma. The numbers must be less than 65536,
+       and the first must be less than or equal to the second. For example:
+
+         z{2,4}
+
+       matches "zz", "zzz", or "zzzz". A closing brace on its  own  is  not  a
+       special  character.  If  the second number is omitted, but the comma is
+       present, there is no upper limit; if the second number  and  the  comma
+       are  both omitted, the quantifier specifies an exact number of required
+       matches. Thus
+
+         [aeiou]{3,}
+
+       matches at least 3 successive vowels, but may match many more, whereas
+
+         \d{8}
+
+       matches exactly 8 digits. An opening curly bracket that  appears  in  a
+       position  where a quantifier is not allowed, or one that does not match
+       the syntax of a quantifier, is taken as a literal character. For  exam-
+       ple, {,6} is not a quantifier, but a literal string of four characters.
+
+       In UTF modes, quantifiers apply to characters rather than to individual
+       code units. Thus, for example, \x{100}{2} matches two characters,  each
+       of which is represented by a two-byte sequence in a UTF-8 string. Simi-
+       larly, \X{3} matches three Unicode extended grapheme clusters, each  of
+       which  may  be  several  code  units long (and they may be of different
+       lengths).
+
+       The quantifier {0} is permitted, causing the expression to behave as if
+       the previous item and the quantifier were not present. This may be use-
+       ful for subpatterns that are referenced as subroutines  from  elsewhere
+       in the pattern (but see also the section entitled "Defining subpatterns
+       for use by reference only" below). Items other  than  subpatterns  that
+       have a {0} quantifier are omitted from the compiled pattern.
+
+       For  convenience, the three most common quantifiers have single-charac-
+       ter abbreviations:
+
+         *    is equivalent to {0,}
+         +    is equivalent to {1,}
+         ?    is equivalent to {0,1}
+
+       It is possible to construct infinite loops by  following  a  subpattern
+       that can match no characters with a quantifier that has no upper limit,
+       for example:
 
-       Philip Hazel
-       University Computing Service
-       Cambridge, England.
+         (a?)*
 
+       Earlier versions of Perl and PCRE1 used to give  an  error  at  compile
+       time for such patterns. However, because there are cases where this can
+       be useful, such patterns are now accepted, but if any repetition of the
+       subpattern  does in fact match no characters, the loop is forcibly bro-
+       ken.
 
-REVISION
+       By default, the quantifiers are "greedy", that is, they match  as  much
+       as  possible  (up  to  the  maximum number of permitted times), without
+       causing the rest of the pattern to fail. The classic example  of  where
+       this gives problems is in trying to match comments in C programs. These
+       appear between /* and */ and within the comment,  individual  *  and  /
+       characters  may  appear. An attempt to match C comments by applying the
+       pattern
 
-       Last updated: 23 November 2014
-       Copyright (c) 1997-2014 University of Cambridge.
+         /\*.*\*/
+
+       to the string
+
+         /* first comment */  not comment  /* second comment */
+
+       fails, because it matches the entire string owing to the greediness  of
+       the .*  item.
+
+       If a quantifier is followed by a question mark, it ceases to be greedy,
+       and instead matches the minimum number of times possible, so  the  pat-
+       tern
+
+         /\*.*?\*/
+
+       does  the  right  thing with the C comments. The meaning of the various
+       quantifiers is not otherwise changed,  just  the  preferred  number  of
+       matches.   Do  not  confuse this use of question mark with its use as a
+       quantifier in its own right. Because it has two uses, it can  sometimes
+       appear doubled, as in
+
+         \d??\d
+
+       which matches one digit by preference, but can match two if that is the
+       only way the rest of the pattern matches.
+
+       If the PCRE2_UNGREEDY option is set (an option that is not available in
+       Perl),  the  quantifiers are not greedy by default, but individual ones
+       can be made greedy by following them with a  question  mark.  In  other
+       words, it inverts the default behaviour.
+
+       When  a  parenthesized  subpattern  is quantified with a minimum repeat
+       count that is greater than 1 or with a limited maximum, more memory  is
+       required  for  the  compiled  pattern, in proportion to the size of the
+       minimum or maximum.
+
+       If a pattern starts with  .*  or  .{0,}  and  the  PCRE2_DOTALL  option
+       (equivalent  to  Perl's /s) is set, thus allowing the dot to match new-
+       lines, the pattern is implicitly  anchored,  because  whatever  follows
+       will  be  tried against every character position in the subject string,
+       so there is no point in retrying the  overall  match  at  any  position
+       after the first. PCRE2 normally treats such a pattern as though it were
+       preceded by \A.
+
+       In cases where it is known that the subject  string  contains  no  new-
+       lines,  it  is worth setting PCRE2_DOTALL in order to obtain this opti-
+       mization, or alternatively, using ^ to indicate anchoring explicitly.
+
+       However, there are some cases where the optimization  cannot  be  used.
+       When .*  is inside capturing parentheses that are the subject of a back
+       reference elsewhere in the pattern, a match at the start may fail where
+       a later one succeeds. Consider, for example:
+
+         (.*)abc\1
+
+       If  the subject is "xyz123abc123" the match point is the fourth charac-
+       ter. For this reason, such a pattern is not implicitly anchored.
+
+       Another case where implicit anchoring is not applied is when the  lead-
+       ing  .* is inside an atomic group. Once again, a match at the start may
+       fail where a later one succeeds. Consider this pattern:
+
+         (?>.*?a)b
+
+       It matches "ab" in the subject "aab". The use of the backtracking  con-
+       trol  verbs  (*PRUNE)  and  (*SKIP) also disable this optimization, and
+       there is an option, PCRE2_NO_DOTSTAR_ANCHOR, to do so explicitly.
+
+       When a capturing subpattern is repeated, the value captured is the sub-
+       string that matched the final iteration. For example, after
+
+         (tweedle[dume]{3}\s*)+
+
+       has matched "tweedledum tweedledee" the value of the captured substring
+       is "tweedledee". However, if there are  nested  capturing  subpatterns,
+       the  corresponding captured values may have been set in previous itera-
+       tions. For example, after
+
+         (a|(b))+
+
+       matches "aba" the value of the second captured substring is "b".
+
+
+ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS
+
+       With both maximizing ("greedy") and minimizing ("ungreedy"  or  "lazy")
+       repetition,  failure  of what follows normally causes the repeated item
+       to be re-evaluated to see if a different number of repeats  allows  the
+       rest  of  the pattern to match. Sometimes it is useful to prevent this,
+       either to change the nature of the match, or to cause it  fail  earlier
+       than  it otherwise might, when the author of the pattern knows there is
+       no point in carrying on.
+
+       Consider, for example, the pattern \d+foo when applied to  the  subject
+       line
+
+         123456bar
+
+       After matching all 6 digits and then failing to match "foo", the normal
+       action of the matcher is to try again with only 5 digits  matching  the
+       \d+  item,  and  then  with  4,  and  so on, before ultimately failing.
+       "Atomic grouping" (a term taken from Jeffrey  Friedl's  book)  provides
+       the  means for specifying that once a subpattern has matched, it is not
+       to be re-evaluated in this way.
+
+       If we use atomic grouping for the previous example, the  matcher  gives
+       up  immediately  on failing to match "foo" the first time. The notation
+       is a kind of special parenthesis, starting with (?> as in this example:
+
+         (?>\d+)foo
+
+       This kind of parenthesis "locks up" the  part of the  pattern  it  con-
+       tains  once  it  has matched, and a failure further into the pattern is
+       prevented from backtracking into it. Backtracking past it  to  previous
+       items, however, works as normal.
+
+       An  alternative  description  is that a subpattern of this type matches
+       exactly the string of characters that an identical  standalone  pattern
+       would match, if anchored at the current point in the subject string.
+
+       Atomic grouping subpatterns are not capturing subpatterns. Simple cases
+       such as the above example can be thought of as a maximizing repeat that
+       must  swallow  everything  it can. So, while both \d+ and \d+? are pre-
+       pared to adjust the number of digits they match in order  to  make  the
+       rest of the pattern match, (?>\d+) can only match an entire sequence of
+       digits.
+
+       Atomic groups in general can of course contain arbitrarily  complicated
+       subpatterns,  and  can  be  nested. However, when the subpattern for an
+       atomic group is just a single repeated item, as in the example above, a
+       simpler  notation,  called  a "possessive quantifier" can be used. This
+       consists of an additional + character  following  a  quantifier.  Using
+       this notation, the previous example can be rewritten as
+
+         \d++foo
+
+       Note that a possessive quantifier can be used with an entire group, for
+       example:
+
+         (abc|xyz){2,3}+
+
+       Possessive  quantifiers  are  always  greedy;  the   setting   of   the
+       PCRE2_UNGREEDY  option  is  ignored. They are a convenient notation for
+       the simpler forms of atomic group. However, there is no  difference  in
+       the meaning of a possessive quantifier and the equivalent atomic group,
+       though there may be a performance  difference;  possessive  quantifiers
+       should be slightly faster.
+
+       The  possessive  quantifier syntax is an extension to the Perl 5.8 syn-
+       tax.  Jeffrey Friedl originated the idea (and the name)  in  the  first
+       edition of his book. Mike McCloskey liked it, so implemented it when he
+       built Sun's Java package, and PCRE1 copied it from there. It ultimately
+       found its way into Perl at release 5.10.
+
+       PCRE2  has  an  optimization  that automatically "possessifies" certain
+       simple pattern constructs. For example, the sequence A+B is treated  as
+       A++B  because  there is no point in backtracking into a sequence of A's
+       when B must follow.  This feature can be disabled by the PCRE2_NO_AUTO-
+       POSSESS option, or starting the pattern with (*NO_AUTO_POSSESS).
+
+       When  a  pattern  contains an unlimited repeat inside a subpattern that
+       can itself be repeated an unlimited number of  times,  the  use  of  an
+       atomic  group  is  the  only way to avoid some failing matches taking a
+       very long time indeed. The pattern
+
+         (\D+|<\d+>)*[!?]
+
+       matches an unlimited number of substrings that either consist  of  non-
+       digits,  or  digits  enclosed in <>, followed by either ! or ?. When it
+       matches, it runs quickly. However, if it is applied to
+
+         aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+       it takes a long time before reporting  failure.  This  is  because  the
+       string  can be divided between the internal \D+ repeat and the external
+       * repeat in a large number of ways, and all  have  to  be  tried.  (The
+       example  uses  [!?]  rather than a single character at the end, because
+       both PCRE2 and Perl have an optimization that allows for  fast  failure
+       when  a single character is used. They remember the last single charac-
+       ter that is required for a match, and fail early if it is  not  present
+       in  the  string.)  If  the pattern is changed so that it uses an atomic
+       group, like this:
+
+         ((?>\D+)|<\d+>)*[!?]
+
+       sequences of non-digits cannot be broken, and failure happens quickly.
+
+
+BACK REFERENCES
+
+       Outside a character class, a backslash followed by a digit greater than
+       0 (and possibly further digits) is a back reference to a capturing sub-
+       pattern earlier (that is, to its left) in the pattern,  provided  there
+       have been that many previous capturing left parentheses.
+
+       However,  if the decimal number following the backslash is less than 8,
+       it is always taken as a back reference, and causes  an  error  only  if
+       there  are  not that many capturing left parentheses in the entire pat-
+       tern. In other words, the parentheses that are referenced need  not  be
+       to  the  left of the reference for numbers less than 8. A "forward back
+       reference" of this type can make sense when a  repetition  is  involved
+       and  the  subpattern to the right has participated in an earlier itera-
+       tion.
+
+       It is not possible to have a numerical "forward back  reference"  to  a
+       subpattern  whose  number  is  8  or  more  using this syntax because a
+       sequence such as \50 is interpreted as a character  defined  in  octal.
+       See the subsection entitled "Non-printing characters" above for further
+       details of the handling of digits following a backslash.  There  is  no
+       such  problem  when named parentheses are used. A back reference to any
+       subpattern is possible using named parentheses (see below).
+
+       Another way of avoiding the ambiguity inherent in  the  use  of  digits
+       following  a  backslash  is  to use the \g escape sequence. This escape
+       must be followed by an unsigned number or a negative number, optionally
+       enclosed in braces. These examples are all identical:
+
+         (ring), \1
+         (ring), \g1
+         (ring), \g{1}
+
+       An  unsigned number specifies an absolute reference without the ambigu-
+       ity that is present in the older syntax. It is also useful when literal
+       digits follow the reference. A negative number is a relative reference.
+       Consider this example:
+
+         (abc(def)ghi)\g{-1}
+
+       The sequence \g{-1} is a reference to the most recently started captur-
+       ing subpattern before \g, that is, is it equivalent to \2 in this exam-
+       ple.  Similarly, \g{-2} would be equivalent to \1. The use of  relative
+       references  can  be helpful in long patterns, and also in patterns that
+       are created by  joining  together  fragments  that  contain  references
+       within themselves.
+
+       A  back  reference matches whatever actually matched the capturing sub-
+       pattern in the current subject string, rather  than  anything  matching
+       the subpattern itself (see "Subpatterns as subroutines" below for a way
+       of doing that). So the pattern
+
+         (sens|respons)e and \1ibility
+
+       matches "sense and sensibility" and "response and responsibility",  but
+       not  "sense and responsibility". If caseful matching is in force at the
+       time of the back reference, the case of letters is relevant. For  exam-
+       ple,
+
+         ((?i)rah)\s+\1
+
+       matches  "rah  rah"  and  "RAH RAH", but not "RAH rah", even though the
+       original capturing subpattern is matched caselessly.
+
+       There are several different ways of writing back  references  to  named
+       subpatterns.  The  .NET syntax \k{name} and the Perl syntax \k<name> or
+       \k'name' are supported, as is the Python syntax (?P=name). Perl  5.10's
+       unified back reference syntax, in which \g can be used for both numeric
+       and named references, is also supported. We  could  rewrite  the  above
+       example in any of the following ways:
+
+         (?<p1>(?i)rah)\s+\k<p1>
+         (?'p1'(?i)rah)\s+\k{p1}
+         (?P<p1>(?i)rah)\s+(?P=p1)
+         (?<p1>(?i)rah)\s+\g{p1}
+
+       A  subpattern  that  is  referenced  by  name may appear in the pattern
+       before or after the reference.
+
+       There may be more than one back reference to the same subpattern. If  a
+       subpattern  has  not actually been used in a particular match, any back
+       references to it always fail by default. For example, the pattern
+
+         (a|(bc))\2
+
+       always fails if it starts to match "a" rather than  "bc".  However,  if
+       the  PCRE2_MATCH_UNSET_BACKREF  option  is  set at compile time, a back
+       reference to an unset value matches an empty string.
+
+       Because there may be many capturing parentheses in a pattern, all  dig-
+       its  following a backslash are taken as part of a potential back refer-
+       ence number.  If the pattern continues with  a  digit  character,  some
+       delimiter  must  be  used  to  terminate  the  back  reference.  If the
+       PCRE2_EXTENDED option is set, this can be white space.  Otherwise,  the
+       \g{ syntax or an empty comment (see "Comments" below) can be used.
+
+   Recursive back references
+
+       A  back reference that occurs inside the parentheses to which it refers
+       fails when the subpattern is first used, so, for example,  (a\1)  never
+       matches.   However,  such references can be useful inside repeated sub-
+       patterns. For example, the pattern
+
+         (a|b\1)+
+
+       matches any number of "a"s and also "aba", "ababbaa" etc. At each iter-
+       ation  of  the  subpattern,  the  back  reference matches the character
+       string corresponding to the previous iteration. In order  for  this  to
+       work,  the  pattern must be such that the first iteration does not need
+       to match the back reference. This can be done using alternation, as  in
+       the example above, or by a quantifier with a minimum of zero.
+
+       Back  references of this type cause the group that they reference to be
+       treated as an atomic group.  Once the whole group has been  matched,  a
+       subsequent  matching  failure cannot cause backtracking into the middle
+       of the group.
+
+
+ASSERTIONS
+
+       An assertion is a test on the characters  following  or  preceding  the
+       current matching point that does not consume any characters. The simple
+       assertions coded as \b, \B, \A, \G, \Z,  \z,  ^  and  $  are  described
+       above.
+
+       More  complicated  assertions  are  coded as subpatterns. There are two
+       kinds: those that look ahead of the current  position  in  the  subject
+       string,  and  those  that  look  behind  it. An assertion subpattern is
+       matched in the normal way, except that it does not  cause  the  current
+       matching position to be changed.
+
+       Assertion  subpatterns are not capturing subpatterns. If such an asser-
+       tion contains capturing subpatterns within it, these  are  counted  for
+       the  purposes  of numbering the capturing subpatterns in the whole pat-
+       tern. However, substring capturing is carried  out  only  for  positive
+       assertions. (Perl sometimes, but not always, does do capturing in nega-
+       tive assertions.)
+
+       For  compatibility  with  Perl,  most  assertion  subpatterns  may   be
+       repeated;  though  it  makes  no sense to assert the same thing several
+       times, the side effect of capturing  parentheses  may  occasionally  be
+       useful.  However,  an  assertion  that forms the condition for a condi-
+       tional subpattern may not be quantified. In practice, for other  asser-
+       tions, there only three cases:
+
+       (1)  If  the  quantifier  is  {0}, the assertion is never obeyed during
+       matching.  However, it may  contain  internal  capturing  parenthesized
+       groups that are called from elsewhere via the subroutine mechanism.
+
+       (2)  If quantifier is {0,n} where n is greater than zero, it is treated
+       as if it were {0,1}. At run time, the rest  of  the  pattern  match  is
+       tried with and without the assertion, the order depending on the greed-
+       iness of the quantifier.
+
+       (3) If the minimum repetition is greater than zero, the  quantifier  is
+       ignored.   The  assertion  is  obeyed just once when encountered during
+       matching.
+
+   Lookahead assertions
+
+       Lookahead assertions start with (?= for positive assertions and (?! for
+       negative assertions. For example,
+
+         \w+(?=;)
+
+       matches  a word followed by a semicolon, but does not include the semi-
+       colon in the match, and
+
+         foo(?!bar)
+
+       matches any occurrence of "foo" that is not  followed  by  "bar".  Note
+       that the apparently similar pattern
+
+         (?!foo)bar
+
+       does  not  find  an  occurrence  of "bar" that is preceded by something
+       other than "foo"; it finds any occurrence of "bar" whatsoever,  because
+       the assertion (?!foo) is always true when the next three characters are
+       "bar". A lookbehind assertion is needed to achieve the other effect.
+
+       If you want to force a matching failure at some point in a pattern, the
+       most  convenient  way  to  do  it  is with (?!) because an empty string
+       always matches, so an assertion that requires there not to be an  empty
+       string must always fail.  The backtracking control verb (*FAIL) or (*F)
+       is a synonym for (?!).
+
+   Lookbehind assertions
+
+       Lookbehind assertions start with (?<= for positive assertions and  (?<!
+       for negative assertions. For example,
+
+         (?<!foo)bar
+
+       does  find  an  occurrence  of "bar" that is not preceded by "foo". The
+       contents of a lookbehind assertion are restricted  such  that  all  the
+       strings it matches must have a fixed length. However, if there are sev-
+       eral top-level alternatives, they do not all  have  to  have  the  same
+       fixed length. Thus
+
+         (?<=bullock|donkey)
+
+       is permitted, but
+
+         (?<!dogs?|cats?)
+
+       causes  an  error at compile time. Branches that match different length
+       strings are permitted only at the top level of a lookbehind  assertion.
+       This is an extension compared with Perl, which requires all branches to
+       match the same length of string. An assertion such as
+
+         (?<=ab(c|de))
+
+       is not permitted, because its single top-level  branch  can  match  two
+       different  lengths,  but  it is acceptable to PCRE2 if rewritten to use
+       two top-level branches:
+
+         (?<=abc|abde)
+
+       In some cases, the escape sequence \K (see above) can be  used  instead
+       of a lookbehind assertion to get round the fixed-length restriction.
+
+       The  implementation  of lookbehind assertions is, for each alternative,
+       to temporarily move the current position back by the fixed  length  and
+       then try to match. If there are insufficient characters before the cur-
+       rent position, the assertion fails.
+
+       In a UTF mode, PCRE2 does not allow the \C escape (which matches a sin-
+       gle  code  unit even in a UTF mode) to appear in lookbehind assertions,
+       because it makes it impossible to calculate the length of  the  lookbe-
+       hind.  The \X and \R escapes, which can match different numbers of code
+       units, are also not permitted.
+
+       "Subroutine" calls (see below) such as (?2) or (?&X) are  permitted  in
+       lookbehinds,  as  long as the subpattern matches a fixed-length string.
+       Recursion, however, is not supported.
+
+       Possessive quantifiers can  be  used  in  conjunction  with  lookbehind
+       assertions to specify efficient matching of fixed-length strings at the
+       end of subject strings. Consider a simple pattern such as
+
+         abcd$
+
+       when applied to a long string that does  not  match.  Because  matching
+       proceeds  from  left to right, PCRE2 will look for each "a" in the sub-
+       ject and then see if what follows matches the rest of the  pattern.  If
+       the pattern is specified as
+
+         ^.*abcd$
+
+       the  initial .* matches the entire string at first, but when this fails
+       (because there is no following "a"), it backtracks to match all but the
+       last  character,  then all but the last two characters, and so on. Once
+       again the search for "a" covers the entire string, from right to  left,
+       so we are no better off. However, if the pattern is written as
+
+         ^.*+(?<=abcd)
+
+       there can be no backtracking for the .*+ item because of the possessive
+       quantifier; it can match only the entire string. The subsequent lookbe-
+       hind  assertion  does  a single test on the last four characters. If it
+       fails, the match fails immediately. For  long  strings,  this  approach
+       makes a significant difference to the processing time.
+
+   Using multiple assertions
+
+       Several assertions (of any sort) may occur in succession. For example,
+
+         (?<=\d{3})(?<!999)foo
+
+       matches  "foo" preceded by three digits that are not "999". Notice that
+       each of the assertions is applied independently at the  same  point  in
+       the  subject  string.  First  there  is a check that the previous three
+       characters are all digits, and then there is  a  check  that  the  same
+       three characters are not "999".  This pattern does not match "foo" pre-
+       ceded by six characters, the first of which are  digits  and  the  last
+       three  of  which  are not "999". For example, it doesn't match "123abc-
+       foo". A pattern to do that is
+
+         (?<=\d{3}...)(?<!999)foo
+
+       This time the first assertion looks at the  preceding  six  characters,
+       checking that the first three are digits, and then the second assertion
+       checks that the preceding three characters are not "999".
+
+       Assertions can be nested in any combination. For example,
+
+         (?<=(?<!foo)bar)baz
+
+       matches an occurrence of "baz" that is preceded by "bar" which in  turn
+       is not preceded by "foo", while
+
+         (?<=\d{3}(?!999)...)foo
+
+       is  another pattern that matches "foo" preceded by three digits and any
+       three characters that are not "999".
+
+
+CONDITIONAL SUBPATTERNS
+
+       It is possible to cause the matching process to obey a subpattern  con-
+       ditionally  or to choose between two alternative subpatterns, depending
+       on the result of an assertion, or whether a specific capturing  subpat-
+       tern  has  already  been matched. The two possible forms of conditional
+       subpattern are:
+
+         (?(condition)yes-pattern)
+         (?(condition)yes-pattern|no-pattern)
+
+       If the condition is satisfied, the yes-pattern is used;  otherwise  the
+       no-pattern  (if  present)  is used. If there are more than two alterna-
+       tives in the subpattern, a compile-time error occurs. Each of  the  two
+       alternatives may itself contain nested subpatterns of any form, includ-
+       ing  conditional  subpatterns;  the  restriction  to  two  alternatives
+       applies only at the level of the condition. This pattern fragment is an
+       example where the alternatives are complex:
+
+         (?(1) (A|B|C) | (D | (?(2)E|F) | E) )
+
+
+       There are five kinds of condition: references  to  subpatterns,  refer-
+       ences  to  recursion,  two pseudo-conditions called DEFINE and VERSION,
+       and assertions.
+
+   Checking for a used subpattern by number
+
+       If the text between the parentheses consists of a sequence  of  digits,
+       the condition is true if a capturing subpattern of that number has pre-
+       viously matched. If there is more than one  capturing  subpattern  with
+       the  same  number  (see  the earlier section about duplicate subpattern
+       numbers), the condition is true if any of them have matched. An  alter-
+       native  notation is to precede the digits with a plus or minus sign. In
+       this case, the subpattern number is relative rather than absolute.  The
+       most  recently opened parentheses can be referenced by (?(-1), the next
+       most recent by (?(-2), and so on. Inside loops it can also  make  sense
+       to refer to subsequent groups. The next parentheses to be opened can be
+       referenced as (?(+1), and so on. (The value zero in any of these  forms
+       is not used; it provokes a compile-time error.)
+
+       Consider  the  following  pattern, which contains non-significant white
+       space to make it more readable (assume the PCRE2_EXTENDED  option)  and
+       to divide it into three parts for ease of discussion:
+
+         ( \( )?    [^()]+    (?(1) \) )
+
+       The  first  part  matches  an optional opening parenthesis, and if that
+       character is present, sets it as the first captured substring. The sec-
+       ond  part  matches one or more characters that are not parentheses. The
+       third part is a conditional subpattern that tests whether  or  not  the
+       first  set  of  parentheses  matched.  If they did, that is, if subject
+       started with an opening parenthesis, the condition is true, and so  the
+       yes-pattern  is  executed and a closing parenthesis is required. Other-
+       wise, since no-pattern is not present, the subpattern matches  nothing.
+       In  other  words,  this  pattern matches a sequence of non-parentheses,
+       optionally enclosed in parentheses.
+
+       If you were embedding this pattern in a larger one,  you  could  use  a
+       relative reference:
+
+         ...other stuff... ( \( )?    [^()]+    (?(-1) \) ) ...
+
+       This  makes  the  fragment independent of the parentheses in the larger
+       pattern.
+
+   Checking for a used subpattern by name
+
+       Perl uses the syntax (?(<name>)...) or (?('name')...)  to  test  for  a
+       used  subpattern  by  name.  For compatibility with earlier versions of
+       PCRE1, which had this facility before Perl, the syntax (?(name)...)  is
+       also recognized.
+
+       Rewriting the above example to use a named subpattern gives this:
+
+         (?<OPEN> \( )?    [^()]+    (?(<OPEN>) \) )
+
+       If  the  name used in a condition of this kind is a duplicate, the test
+       is applied to all subpatterns of the same name, and is true if any  one
+       of them has matched.
+
+   Checking for pattern recursion
+
+       If the condition is the string (R), and there is no subpattern with the
+       name R, the condition is true if a recursive call to the whole  pattern
+       or any subpattern has been made. If digits or a name preceded by amper-
+       sand follow the letter R, for example:
+
+         (?(R3)...) or (?(R&name)...)
+
+       the condition is true if the most recent recursion is into a subpattern
+       whose number or name is given. This condition does not check the entire
+       recursion stack. If the name used in a condition  of  this  kind  is  a
+       duplicate, the test is applied to all subpatterns of the same name, and
+       is true if any one of them is the most recent recursion.
+
+       At "top level", all these recursion test  conditions  are  false.   The
+       syntax for recursive patterns is described below.
+
+   Defining subpatterns for use by reference only
+
+       If  the  condition  is  the string (DEFINE), and there is no subpattern
+       with the name DEFINE, the condition is  always  false.  In  this  case,
+       there  may  be  only  one  alternative  in the subpattern. It is always
+       skipped if control reaches this point  in  the  pattern;  the  idea  of
+       DEFINE  is that it can be used to define subroutines that can be refer-
+       enced from elsewhere. (The use of subroutines is described below.)  For
+       example,  a  pattern  to match an IPv4 address such as "192.168.23.245"
+       could be written like this (ignore white space and line breaks):
+
+         (?(DEFINE) (?<byte> 2[0-4]\d | 25[0-5] | 1\d\d | [1-9]?\d) )
+         \b (?&byte) (\.(?&byte)){3} \b
+
+       The first part of the pattern is a DEFINE group inside which a  another
+       group  named "byte" is defined. This matches an individual component of
+       an IPv4 address (a number less than 256). When  matching  takes  place,
+       this  part  of  the pattern is skipped because DEFINE acts like a false
+       condition. The rest of the pattern uses references to the  named  group
+       to  match the four dot-separated components of an IPv4 address, insist-
+       ing on a word boundary at each end.
+
+   Checking the PCRE2 version
+
+       Programs that link with a PCRE2 library can check the version by  call-
+       ing  pcre2_config()  with  appropriate arguments. Users of applications
+       that do not have access to the underlying code cannot do this.  A  spe-
+       cial  "condition" called VERSION exists to allow such users to discover
+       which version of PCRE2 they are dealing with by using this condition to
+       match  a string such as "yesno". VERSION must be followed either by "="
+       or ">=" and a version number.  For example:
+
+         (?(VERSION>=10.4)yes|no)
+
+       This pattern matches "yes" if the PCRE2 version is greater or equal  to
+       10.4,  or "no" otherwise. The fractional part of the version number may
+       not contain more than two digits.
+
+   Assertion conditions
+
+       If the condition is not in any of the above  formats,  it  must  be  an
+       assertion.   This may be a positive or negative lookahead or lookbehind
+       assertion. Consider  this  pattern,  again  containing  non-significant
+       white space, and with the two alternatives on the second line:
+
+         (?(?=[^a-z]*[a-z])
+         \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} )
+
+       The  condition  is  a  positive  lookahead  assertion  that  matches an
+       optional sequence of non-letters followed by a letter. In other  words,
+       it  tests  for the presence of at least one letter in the subject. If a
+       letter is found, the subject is matched against the first  alternative;
+       otherwise  it  is  matched  against  the  second.  This pattern matches
+       strings in one of the two forms dd-aaa-dd or dd-dd-dd,  where  aaa  are
+       letters and dd are digits.
+
+
+COMMENTS
+
+       There are two ways of including comments in patterns that are processed
+       by PCRE2. In both cases, the start of the comment  must  not  be  in  a
+       character  class,  nor  in  the middle of any other sequence of related
+       characters such as (?: or a subpattern name or number.  The  characters
+       that make up a comment play no part in the pattern matching.
+
+       The  sequence (?# marks the start of a comment that continues up to the
+       next closing parenthesis. Nested parentheses are not permitted. If  the
+       PCRE2_EXTENDED  option is set, an unescaped # character also introduces
+       a comment, which in this case continues to immediately after  the  next
+       newline  character  or character sequence in the pattern. Which charac-
+       ters are interpreted as newlines is controlled by an option  passed  to
+       the  compiling  function  or  by a special sequence at the start of the
+       pattern, as described in the  section  entitled  "Newline  conventions"
+       above.  Note  that the end of this type of comment is a literal newline
+       sequence in the pattern; escape sequences that happen  to  represent  a
+       newline   do  not  count.  For  example,  consider  this  pattern  when
+       PCRE2_EXTENDED is set, and the default  newline  convention  (a  single
+       linefeed character) is in force:
+
+         abc #comment \n still comment
+
+       On  encountering  the # character, pcre2_compile() skips along, looking
+       for a newline in the pattern. The sequence \n is still literal at  this
+       stage,  so  it does not terminate the comment. Only an actual character
+       with the code value 0x0a (the default newline) does so.
+
+
+RECURSIVE PATTERNS
+
+       Consider the problem of matching a string in parentheses, allowing  for
+       unlimited  nested  parentheses.  Without the use of recursion, the best
+       that can be done is to use a pattern that  matches  up  to  some  fixed
+       depth  of  nesting.  It  is not possible to handle an arbitrary nesting
+       depth.
+
+       For some time, Perl has provided a facility that allows regular expres-
+       sions  to recurse (amongst other things). It does this by interpolating
+       Perl code in the expression at run time, and the code can refer to  the
+       expression itself. A Perl pattern using code interpolation to solve the
+       parentheses problem can be created like this:
+
+         $re = qr{\( (?: (?>[^()]+) | (?p{$re}) )* \)}x;
+
+       The (?p{...}) item interpolates Perl code at run time, and in this case
+       refers recursively to the pattern in which it appears.
+
+       Obviously,  PCRE2  cannot  support  the  interpolation  of  Perl  code.
+       Instead, it supports special syntax for recursion of  the  entire  pat-
+       tern, and also for individual subpattern recursion. After its introduc-
+       tion in PCRE1 and Python,  this  kind  of  recursion  was  subsequently
+       introduced into Perl at release 5.10.
+
+       A  special  item  that consists of (? followed by a number greater than
+       zero and a closing parenthesis is a recursive subroutine  call  of  the
+       subpattern  of  the  given  number, provided that it occurs inside that
+       subpattern. (If not, it is a non-recursive subroutine  call,  which  is
+       described  in  the  next  section.)  The special item (?R) or (?0) is a
+       recursive call of the entire regular expression.
+
+       This PCRE2 pattern solves the nested parentheses  problem  (assume  the
+       PCRE2_EXTENDED option is set so that white space is ignored):
+
+         \( ( [^()]++ | (?R) )* \)
+
+       First  it matches an opening parenthesis. Then it matches any number of
+       substrings which can either be a  sequence  of  non-parentheses,  or  a
+       recursive  match  of the pattern itself (that is, a correctly parenthe-
+       sized substring).  Finally there is a closing parenthesis. Note the use
+       of a possessive quantifier to avoid backtracking into sequences of non-
+       parentheses.
+
+       If this were part of a larger pattern, you would not  want  to  recurse
+       the entire pattern, so instead you could use this:
+
+         ( \( ( [^()]++ | (?1) )* \) )
+
+       We  have  put the pattern into parentheses, and caused the recursion to
+       refer to them instead of the whole pattern.
+
+       In a larger pattern,  keeping  track  of  parenthesis  numbers  can  be
+       tricky.  This is made easier by the use of relative references. Instead
+       of (?1) in the pattern above you can write (?-2) to refer to the second
+       most  recently  opened  parentheses  preceding  the recursion. In other
+       words, a negative number counts capturing  parentheses  leftwards  from
+       the point at which it is encountered.
+
+       Be aware however, that if duplicate subpattern numbers are in use, rel-
+       ative references refer to the earliest subpattern with the  appropriate
+       number. Consider, for example:
+
+         (?|(a)|(b)) (c) (?-2)
+
+       The  first  two  capturing  groups (a) and (b) are both numbered 1, and
+       group (c) is number 2. When the reference  (?-2)  is  encountered,  the
+       second most recently opened parentheses has the number 1, but it is the
+       first such group (the (a) group) to which the  recursion  refers.  This
+       would  be  the  same  if  an absolute reference (?1) was used. In other
+       words, relative references are just a shorthand for computing  a  group
+       number.
+
+       It  is  also  possible  to refer to subsequently opened parentheses, by
+       writing references such as (?+2). However, these  cannot  be  recursive
+       because  the  reference  is  not inside the parentheses that are refer-
+       enced. They are always non-recursive subroutine calls, as described  in
+       the next section.
+
+       An  alternative  approach  is to use named parentheses. The Perl syntax
+       for this is (?&name); PCRE1's earlier syntax  (?P>name)  is  also  sup-
+       ported. We could rewrite the above example as follows:
+
+         (?<pn> \( ( [^()]++ | (?&pn) )* \) )
+
+       If  there  is more than one subpattern with the same name, the earliest
+       one is used.
+
+       The example pattern that we have been looking at contains nested unlim-
+       ited  repeats,  and  so the use of a possessive quantifier for matching
+       strings of non-parentheses is important when applying  the  pattern  to
+       strings that do not match. For example, when this pattern is applied to
+
+         (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()
+
+       it  yields  "no  match" quickly. However, if a possessive quantifier is
+       not used, the match runs for a very long time indeed because there  are
+       so  many  different  ways the + and * repeats can carve up the subject,
+       and all have to be tested before failure can be reported.
+
+       At the end of a match, the values of capturing  parentheses  are  those
+       from  the outermost level. If you want to obtain intermediate values, a
+       callout function can be used (see below and the pcre2callout documenta-
+       tion). If the pattern above is matched against
+
+         (ab(cd)ef)
+
+       the  value  for  the  inner capturing parentheses (numbered 2) is "ef",
+       which is the last value taken on at the top level. If a capturing  sub-
+       pattern  is  not  matched at the top level, its final captured value is
+       unset, even if it was (temporarily) set at a deeper  level  during  the
+       matching process.
+
+       If there are more than 15 capturing parentheses in a pattern, PCRE2 has
+       to obtain extra memory from the heap to store data during a  recursion.
+       If   no   memory   can   be   obtained,   the   match  fails  with  the
+       PCRE2_ERROR_NOMEMORY error.
+
+       Do not confuse the (?R) item with the condition (R),  which  tests  for
+       recursion.   Consider  this pattern, which matches text in angle brack-
+       ets, allowing for arbitrary nesting. Only digits are allowed in  nested
+       brackets  (that is, when recursing), whereas any characters are permit-
+       ted at the outer level.
+
+         < (?: (?(R) \d++  | [^<>]*+) | (?R)) * >
+
+       In this pattern, (?(R) is the start of a conditional  subpattern,  with
+       two  different  alternatives for the recursive and non-recursive cases.
+       The (?R) item is the actual recursive call.
+
+   Differences in recursion processing between PCRE2 and Perl
+
+       Recursion processing in PCRE2 differs from Perl in two important  ways.
+       In PCRE2 (like Python, but unlike Perl), a recursive subpattern call is
+       always treated as an atomic group. That is, once it has matched some of
+       the subject string, it is never re-entered, even if it contains untried
+       alternatives and there is a subsequent matching failure.  This  can  be
+       illustrated  by the following pattern, which purports to match a palin-
+       dromic string that contains an odd number of characters  (for  example,
+       "a", "aba", "abcba", "abcdcba"):
+
+         ^(.|(.)(?1)\2)$
+
+       The idea is that it either matches a single character, or two identical
+       characters surrounding a sub-palindrome. In Perl, this  pattern  works;
+       in  PCRE2  it  does not if the pattern is longer than three characters.
+       Consider the subject string "abcba":
+
+       At the top level, the first character is matched, but as it is  not  at
+       the end of the string, the first alternative fails; the second alterna-
+       tive is taken and the recursion kicks in. The recursive call to subpat-
+       tern  1  successfully  matches the next character ("b"). (Note that the
+       beginning and end of line tests are not part of the recursion).
+
+       Back at the top level, the next character ("c") is compared  with  what
+       subpattern  2 matched, which was "a". This fails. Because the recursion
+       is treated as an atomic group, there are now  no  backtracking  points,
+       and  so  the  entire  match fails. (Perl is able, at this point, to re-
+       enter the recursion and try the second alternative.)  However,  if  the
+       pattern is written with the alternatives in the other order, things are
+       different:
+
+         ^((.)(?1)\2|.)$
+
+       This time, the recursing alternative is tried first, and  continues  to
+       recurse  until  it runs out of characters, at which point the recursion
+       fails. But this time we do have  another  alternative  to  try  at  the
+       higher  level.  That  is  the  big difference: in the previous case the
+       remaining alternative is at a deeper recursion level, which PCRE2  can-
+       not use.
+
+       To  change  the pattern so that it matches all palindromic strings, not
+       just those with an odd number of characters, it is tempting  to  change
+       the pattern to this:
+
+         ^((.)(?1)\2|.?)$
+
+       Again,  this  works in Perl, but not in PCRE2, and for the same reason.
+       When a deeper recursion has matched a single character,  it  cannot  be
+       entered  again  in  order  to match an empty string. The solution is to
+       separate the two cases, and write out the odd and even cases as  alter-
+       natives at the higher level:
+
+         ^(?:((.)(?1)\2|)|((.)(?3)\4|.))
+
+       If  you  want  to match typical palindromic phrases, the pattern has to
+       ignore all non-word characters, which can be done like this:
+
+         ^\W*+(?:((.)\W*+(?1)\W*+\2|)|((.)\W*+(?3)\W*+\4|\W*+.\W*+))\W*+$
+
+       If run with the PCRE2_CASELESS option,  this  pattern  matches  phrases
+       such  as  "A  man, a plan, a canal: Panama!" and it works in both PCRE2
+       and Perl. Note the use of the possessive quantifier *+ to  avoid  back-
+       tracking  into  sequences  of  non-word characters. Without this, PCRE2
+       takes a great deal longer (ten times or more) to match typical phrases,
+       and Perl takes so long that you think it has gone into a loop.
+
+       WARNING:  The  palindrome-matching patterns above work only if the sub-
+       ject string does not start with a palindrome that is shorter  than  the
+       entire  string.  For example, although "abcba" is correctly matched, if
+       the subject is "ababa", PCRE2 finds the palindrome "aba" at the  start,
+       then  fails at top level because the end of the string does not follow.
+       Once again, it cannot jump back into the recursion to try other  alter-
+       natives, so the entire match fails.
+
+       The  second  way in which PCRE2 and Perl differ in their recursion pro-
+       cessing is in the handling of captured values. In Perl, when a  subpat-
+       tern  is  called recursively or as a subpattern (see the next section),
+       it has no access to any values that were captured  outside  the  recur-
+       sion,  whereas  in  PCRE2 these values can be referenced. Consider this
+       pattern:
+
+         ^(.)(\1|a(?2))
+
+       In PCRE2, this pattern matches "bab". The first  capturing  parentheses
+       match  "b",  then in the second group, when the back reference \1 fails
+       to match "b", the second alternative matches "a" and then recurses.  In
+       the  recursion,  \1 does now match "b" and so the whole match succeeds.
+       In Perl, the pattern fails to match because inside the  recursive  call
+       \1 cannot access the externally set value.
+
+
+SUBPATTERNS AS SUBROUTINES
+
+       If  the  syntax for a recursive subpattern call (either by number or by
+       name) is used outside the parentheses to which it refers,  it  operates
+       like  a subroutine in a programming language. The called subpattern may
+       be defined before or after the reference. A numbered reference  can  be
+       absolute or relative, as in these examples:
+
+         (...(absolute)...)...(?2)...
+         (...(relative)...)...(?-1)...
+         (...(?+1)...(relative)...
+
+       An earlier example pointed out that the pattern
+
+         (sens|respons)e and \1ibility
+
+       matches  "sense and sensibility" and "response and responsibility", but
+       not "sense and responsibility". If instead the pattern
+
+         (sens|respons)e and (?1)ibility
+
+       is used, it does match "sense and responsibility" as well as the  other
+       two  strings.  Another  example  is  given  in the discussion of DEFINE
+       above.
+
+       All subroutine calls, whether recursive or not, are always  treated  as
+       atomic  groups. That is, once a subroutine has matched some of the sub-
+       ject string, it is never re-entered, even if it contains untried alter-
+       natives  and  there  is  a  subsequent  matching failure. Any capturing
+       parentheses that are set during the subroutine  call  revert  to  their
+       previous values afterwards.
+
+       Processing  options  such as case-independence are fixed when a subpat-
+       tern is defined, so if it is used as a subroutine, such options  cannot
+       be changed for different calls. For example, consider this pattern:
+
+         (abc)(?i:(?-1))
+
+       It  matches  "abcabc". It does not match "abcABC" because the change of
+       processing option does not affect the called subpattern.
+
+
+ONIGURUMA SUBROUTINE SYNTAX
+
+       For compatibility with Oniguruma, the non-Perl syntax \g followed by  a
+       name or a number enclosed either in angle brackets or single quotes, is
+       an alternative syntax for referencing a  subpattern  as  a  subroutine,
+       possibly  recursively. Here are two of the examples used above, rewrit-
+       ten using this syntax:
+
+         (?<pn> \( ( (?>[^()]+) | \g<pn> )* \) )
+         (sens|respons)e and \g'1'ibility
+
+       PCRE2 supports an extension to Oniguruma: if a number is preceded by  a
+       plus or a minus sign it is taken as a relative reference. For example:
+
+         (abc)(?i:\g<-1>)
+
+       Note  that \g{...} (Perl syntax) and \g<...> (Oniguruma syntax) are not
+       synonymous. The former is a back reference; the latter is a  subroutine
+       call.
+
+
+CALLOUTS
+
+       Perl has a feature whereby using the sequence (?{...}) causes arbitrary
+       Perl code to be obeyed in the middle of matching a regular  expression.
+       This makes it possible, amongst other things, to extract different sub-
+       strings that match the same pair of parentheses when there is a repeti-
+       tion.
+
+       PCRE2  provides  a  similar feature, but of course it cannot obey arbi-
+       trary Perl code. The feature is called "callout". The caller  of  PCRE2
+       provides  an  external  function  by putting its entry point in a match
+       context using the function pcre2_set_callout(), and then  passing  that
+       context  to  pcre2_match() or pcre2_dfa_match(). If no match context is
+       passed, or if the callout entry point is set to NULL, callouts are dis-
+       abled.
+
+       Within  a  regular expression, (?C<arg>) indicates a point at which the
+       external function is to be called. There  are  two  kinds  of  callout:
+       those  with a numerical argument and those with a string argument. (?C)
+       on its own with no argument is treated as (?C0). A  numerical  argument
+       allows  the  application  to  distinguish  between  different callouts.
+       String arguments were added for release 10.20 to make it  possible  for
+       script  languages that use PCRE2 to embed short scripts within patterns
+       in a similar way to Perl.
+
+       During matching, when PCRE2 reaches a callout point, the external func-
+       tion  is  called.  It is provided with the number or string argument of
+       the callout, the position in the pattern, and one item of data that  is
+       also set in the match block. The callout function may cause matching to
+       proceed, to backtrack, or to fail.
+
+       By default, PCRE2 implements a  number  of  optimizations  at  matching
+       time,  and  one  side-effect is that sometimes callouts are skipped. If
+       you need all possible callouts to happen, you need to set options  that
+       disable  the relevant optimizations. More details, including a complete
+       description of the programming interface to the callout  function,  are
+       given in the pcre2callout documentation.
+
+   Callouts with numerical arguments
+
+       If  you  just  want  to  have  a means of identifying different callout
+       points, put a number less than 256 after the  letter  C.  For  example,
+       this pattern has two callout points:
+
+         (?C1)abc(?C2)def
+
+       If  the PCRE2_AUTO_CALLOUT flag is passed to pcre2_compile(), numerical
+       callouts are automatically installed before each item in  the  pattern.
+       They  are all numbered 255. If there is a conditional group in the pat-
+       tern whose condition is an assertion, an additional callout is inserted
+       just  before the condition. An explicit callout may also be set at this
+       position, as in this example:
+
+         (?(?C9)(?=a)abc|def)
+
+       Note that this applies only to assertion conditions, not to other types
+       of condition.
+
+   Callouts with string arguments
+
+       A  delimited  string may be used instead of a number as a callout argu-
+       ment. The starting delimiter must be one of ` ' " ^ % #  $  {  and  the
+       ending delimiter is the same as the start, except for {, where the end-
+       ing delimiter is }. If  the  ending  delimiter  is  needed  within  the
+       string, it must be doubled. For example:
+
+         (?C'ab ''c'' d')xyz(?C{any text})pqr
+
+       The  doubling  is  removed  before  the string is passed to the callout
+       function.
+
+
+BACKTRACKING CONTROL
+
+       Perl 5.10 introduced a number of "Special Backtracking Control  Verbs",
+       which  are  still  described in the Perl documentation as "experimental
+       and subject to change or removal in a future version of Perl". It  goes
+       on  to  say:  "Their  usage in production code should be noted to avoid
+       problems during upgrades." The same remarks apply to the PCRE2 features
+       described in this section.
+
+       The  new verbs make use of what was previously invalid syntax: an open-
+       ing parenthesis followed by an asterisk. They are generally of the form
+       (*VERB) or (*VERB:NAME). Some verbs take either form, possibly behaving
+       differently depending on whether or not a name is present.
+
+       By default, for compatibility with Perl, a  name  is  any  sequence  of
+       characters that does not include a closing parenthesis. The name is not
+       processed in any way, and it is  not  possible  to  include  a  closing
+       parenthesis in the name.  However, if the PCRE2_ALT_VERBNAMES option is
+       set, normal backslash processing is applied to verb names and  only  an
+       unescaped  closing parenthesis terminates the name. A closing parenthe-
+       sis can be included in a name either as \) or between \Q and \E. If the
+       PCRE2_EXTENDED  option  is  set,  unescaped whitespace in verb names is
+       skipped and #-comments are recognized, exactly as in the  rest  of  the
+       pattern.
+
+       The  maximum  length of a name is 255 in the 8-bit library and 65535 in
+       the 16-bit and 32-bit libraries. If the name is empty, that is, if  the
+       closing  parenthesis immediately follows the colon, the effect is as if
+       the colon were not there. Any number of these verbs may occur in a pat-
+       tern.
+
+       Since  these  verbs  are  specifically related to backtracking, most of
+       them can be used only when the pattern is to be matched using the  tra-
+       ditional matching function, because these use a backtracking algorithm.
+       With the exception of (*FAIL), which behaves like  a  failing  negative
+       assertion, the backtracking control verbs cause an error if encountered
+       by the DFA matching function.
+
+       The behaviour of these verbs in repeated  groups,  assertions,  and  in
+       subpatterns called as subroutines (whether or not recursively) is docu-
+       mented below.
+
+   Optimizations that affect backtracking verbs
+
+       PCRE2 contains some optimizations that are used to speed up matching by
+       running some checks at the start of each match attempt. For example, it
+       may know the minimum length of matching subject, or that  a  particular
+       character must be present. When one of these optimizations bypasses the
+       running of a match,  any  included  backtracking  verbs  will  not,  of
+       course, be processed. You can suppress the start-of-match optimizations
+       by setting the PCRE2_NO_START_OPTIMIZE option when  calling  pcre2_com-
+       pile(),  or by starting the pattern with (*NO_START_OPT). There is more
+       discussion of this option in the section entitled "Compiling a pattern"
+       in the pcre2api documentation.
+
+       Experiments  with  Perl  suggest that it too has similar optimizations,
+       sometimes leading to anomalous results.
+
+   Verbs that act immediately
+
+       The following verbs act as soon as they are encountered. They  may  not
+       be followed by a name.
+
+          (*ACCEPT)
+
+       This  verb causes the match to end successfully, skipping the remainder
+       of the pattern. However, when it is inside a subpattern that is  called
+       as  a  subroutine, only that subpattern is ended successfully. Matching
+       then continues at the outer level. If (*ACCEPT) in triggered in a posi-
+       tive  assertion,  the  assertion succeeds; in a negative assertion, the
+       assertion fails.
+
+       If (*ACCEPT) is inside capturing parentheses, the data so far  is  cap-
+       tured. For example:
+
+         A((?:A|B(*ACCEPT)|C)D)
+
+       This  matches  "AB", "AAD", or "ACD"; when it matches "AB", "B" is cap-
+       tured by the outer parentheses.
+
+         (*FAIL) or (*F)
+
+       This verb causes a matching failure, forcing backtracking to occur.  It
+       is  equivalent to (?!) but easier to read. The Perl documentation notes
+       that it is probably useful only when combined  with  (?{})  or  (??{}).
+       Those  are, of course, Perl features that are not present in PCRE2. The
+       nearest equivalent is the callout feature, as for example in this  pat-
+       tern:
+
+         a+(?C)(*FAIL)
+
+       A  match  with the string "aaaa" always fails, but the callout is taken
+       before each backtrack happens (in this example, 10 times).
+
+   Recording which path was taken
+
+       There is one verb whose main purpose  is  to  track  how  a  match  was
+       arrived  at,  though  it  also  has a secondary use in conjunction with
+       advancing the match starting point (see (*SKIP) below).
+
+         (*MARK:NAME) or (*:NAME)
+
+       A name is always  required  with  this  verb.  There  may  be  as  many
+       instances  of  (*MARK) as you like in a pattern, and their names do not
+       have to be unique.
+
+       When a match succeeds, the name of the  last-encountered  (*MARK:NAME),
+       (*PRUNE:NAME),  or  (*THEN:NAME) on the matching path is passed back to
+       the caller as described in  the  section  entitled  "Other  information
+       about  the  match" in the pcre2api documentation. Here is an example of
+       pcre2test output, where the "mark" modifier requests the retrieval  and
+       outputting of (*MARK) data:
+
+           re> /X(*MARK:A)Y|X(*MARK:B)Z/mark
+         data> XY
+          0: XY
+         MK: A
+         XZ
+          0: XZ
+         MK: B
+
+       The (*MARK) name is tagged with "MK:" in this output, and in this exam-
+       ple it indicates which of the two alternatives matched. This is a  more
+       efficient  way of obtaining this information than putting each alterna-
+       tive in its own capturing parentheses.
+
+       If a verb with a name is encountered in a positive  assertion  that  is
+       true,  the  name  is recorded and passed back if it is the last-encoun-
+       tered. This does not happen for negative assertions or failing positive
+       assertions.
+
+       After  a  partial match or a failed match, the last encountered name in
+       the entire match process is returned. For example:
+
+           re> /X(*MARK:A)Y|X(*MARK:B)Z/mark
+         data> XP
+         No match, mark = B
+
+       Note that in this unanchored example the  mark  is  retained  from  the
+       match attempt that started at the letter "X" in the subject. Subsequent
+       match attempts starting at "P" and then with an empty string do not get
+       as far as the (*MARK) item, but nevertheless do not reset it.
+
+       If  you  are  interested  in  (*MARK)  values after failed matches, you
+       should probably set the PCRE2_NO_START_OPTIMIZE option (see  above)  to
+       ensure that the match is always attempted.
+
+   Verbs that act after backtracking
+
+       The following verbs do nothing when they are encountered. Matching con-
+       tinues with what follows, but if there is no subsequent match,  causing
+       a  backtrack  to  the  verb, a failure is forced. That is, backtracking
+       cannot pass to the left of the verb. However, when one of  these  verbs
+       appears inside an atomic group (which includes any group that is called
+       as a subroutine) or in an assertion that is true, its  effect  is  con-
+       fined  to that group, because once the group has been matched, there is
+       never any backtracking into it. In this situation, backtracking has  to
+       jump to the left of the entire atomic group or assertion.
+
+       These  verbs  differ  in exactly what kind of failure occurs when back-
+       tracking reaches them. The behaviour described below  is  what  happens
+       when  the  verb is not in a subroutine or an assertion. Subsequent sec-
+       tions cover these special cases.
+
+         (*COMMIT)
+
+       This verb, which may not be followed by a name, causes the whole  match
+       to fail outright if there is a later matching failure that causes back-
+       tracking to reach it. Even if the pattern  is  unanchored,  no  further
+       attempts to find a match by advancing the starting point take place. If
+       (*COMMIT) is the only backtracking verb that is  encountered,  once  it
+       has  been  passed  pcre2_match() is committed to finding a match at the
+       current starting point, or not at all. For example:
+
+         a+(*COMMIT)b
+
+       This matches "xxaab" but not "aacaab". It can be thought of as  a  kind
+       of dynamic anchor, or "I've started, so I must finish." The name of the
+       most recently passed (*MARK) in the path is passed back when  (*COMMIT)
+       forces a match failure.
+
+       If  there  is more than one backtracking verb in a pattern, a different
+       one that follows (*COMMIT) may be triggered first,  so  merely  passing
+       (*COMMIT) during a match does not always guarantee that a match must be
+       at this starting point.
+
+       Note that (*COMMIT) at the start of a pattern is not  the  same  as  an
+       anchor,  unless PCRE2's start-of-match optimizations are turned off, as
+       shown in this output from pcre2test:
+
+           re> /(*COMMIT)abc/
+         data> xyzabc
+          0: abc
+         data>
+         re> /(*COMMIT)abc/no_start_optimize
+         data> xyzabc
+         No match
+
+       For the first pattern, PCRE2 knows that any match must start with  "a",
+       so  the optimization skips along the subject to "a" before applying the
+       pattern to the first set of data. The match attempt then succeeds.  The
+       second  pattern disables the optimization that skips along to the first
+       character. The pattern is now applied  starting  at  "x",  and  so  the
+       (*COMMIT)  causes  the  match to fail without trying any other starting
+       points.
+
+         (*PRUNE) or (*PRUNE:NAME)
+
+       This verb causes the match to fail at the current starting position  in
+       the subject if there is a later matching failure that causes backtrack-
+       ing to reach it. If the pattern is unanchored, the  normal  "bumpalong"
+       advance  to  the next starting character then happens. Backtracking can
+       occur as usual to the left of (*PRUNE), before it is reached,  or  when
+       matching  to  the  right  of  (*PRUNE), but if there is no match to the
+       right, backtracking cannot cross (*PRUNE). In simple cases, the use  of
+       (*PRUNE)  is just an alternative to an atomic group or possessive quan-
+       tifier, but there are some uses of (*PRUNE) that cannot be expressed in
+       any  other  way. In an anchored pattern (*PRUNE) has the same effect as
+       (*COMMIT).
+
+       The   behaviour   of   (*PRUNE:NAME)   is   the   not   the   same   as
+       (*MARK:NAME)(*PRUNE).   It  is  like  (*MARK:NAME)  in that the name is
+       remembered for  passing  back  to  the  caller.  However,  (*SKIP:NAME)
+       searches  only  for  names  set  with  (*MARK),  ignoring  those set by
+       (*PRUNE) or (*THEN).
+
+         (*SKIP)
+
+       This verb, when given without a name, is like (*PRUNE), except that  if
+       the  pattern  is unanchored, the "bumpalong" advance is not to the next
+       character, but to the position in the subject where (*SKIP) was encoun-
+       tered.  (*SKIP)  signifies that whatever text was matched leading up to
+       it cannot be part of a successful match. Consider:
+
+         a+(*SKIP)b
+
+       If the subject is "aaaac...",  after  the  first  match  attempt  fails
+       (starting  at  the  first  character in the string), the starting point
+       skips on to start the next attempt at "c". Note that a possessive quan-
+       tifer  does not have the same effect as this example; although it would
+       suppress backtracking  during  the  first  match  attempt,  the  second
+       attempt  would  start at the second character instead of skipping on to
+       "c".
+
+         (*SKIP:NAME)
+
+       When (*SKIP) has an associated name, its behaviour is modified. When it
+       is triggered, the previous path through the pattern is searched for the
+       most recent (*MARK) that has the  same  name.  If  one  is  found,  the
+       "bumpalong" advance is to the subject position that corresponds to that
+       (*MARK) instead of to where (*SKIP) was encountered. If no (*MARK) with
+       a matching name is found, the (*SKIP) is ignored.
+
+       Note  that (*SKIP:NAME) searches only for names set by (*MARK:NAME). It
+       ignores names that are set by (*PRUNE:NAME) or (*THEN:NAME).
+
+         (*THEN) or (*THEN:NAME)
+
+       This verb causes a skip to the next innermost  alternative  when  back-
+       tracking  reaches  it.  That  is,  it  cancels any further backtracking
+       within the current alternative. Its name  comes  from  the  observation
+       that it can be used for a pattern-based if-then-else block:
+
+         ( COND1 (*THEN) FOO | COND2 (*THEN) BAR | COND3 (*THEN) BAZ ) ...
+
+       If  the COND1 pattern matches, FOO is tried (and possibly further items
+       after the end of the group if FOO succeeds); on  failure,  the  matcher
+       skips  to  the second alternative and tries COND2, without backtracking
+       into COND1. If that succeeds and BAR fails, COND3 is tried.  If  subse-
+       quently  BAZ fails, there are no more alternatives, so there is a back-
+       track to whatever came before the  entire  group.  If  (*THEN)  is  not
+       inside an alternation, it acts like (*PRUNE).
+
+       The    behaviour   of   (*THEN:NAME)   is   the   not   the   same   as
+       (*MARK:NAME)(*THEN).  It is like  (*MARK:NAME)  in  that  the  name  is
+       remembered  for  passing  back  to  the  caller.  However, (*SKIP:NAME)
+       searches only for  names  set  with  (*MARK),  ignoring  those  set  by
+       (*PRUNE) and (*THEN).
+
+       A  subpattern that does not contain a | character is just a part of the
+       enclosing alternative; it is not a nested  alternation  with  only  one
+       alternative.  The effect of (*THEN) extends beyond such a subpattern to
+       the enclosing alternative. Consider this pattern, where A, B, etc.  are
+       complex  pattern fragments that do not contain any | characters at this
+       level:
+
+         A (B(*THEN)C) | D
+
+       If A and B are matched, but there is a failure in C, matching does  not
+       backtrack into A; instead it moves to the next alternative, that is, D.
+       However, if the subpattern containing (*THEN) is given an  alternative,
+       it behaves differently:
+
+         A (B(*THEN)C | (*FAIL)) | D
+
+       The  effect of (*THEN) is now confined to the inner subpattern. After a
+       failure in C, matching moves to (*FAIL), which causes the whole subpat-
+       tern  to  fail  because  there are no more alternatives to try. In this
+       case, matching does now backtrack into A.
+
+       Note that a conditional subpattern is  not  considered  as  having  two
+       alternatives,  because  only  one  is  ever used. In other words, the |
+       character in a conditional subpattern has a different meaning. Ignoring
+       white space, consider:
+
+         ^.*? (?(?=a) a | b(*THEN)c )
+
+       If  the  subject  is  "ba", this pattern does not match. Because .*? is
+       ungreedy, it initially matches zero  characters.  The  condition  (?=a)
+       then  fails,  the  character  "b"  is  matched, but "c" is not. At this
+       point, matching does not backtrack to .*? as might perhaps be  expected
+       from  the  presence  of  the | character. The conditional subpattern is
+       part of the single alternative that comprises the whole pattern, and so
+       the  match  fails.  (If  there was a backtrack into .*?, allowing it to
+       match "b", the match would succeed.)
+
+       The verbs just described provide four different "strengths" of  control
+       when subsequent matching fails. (*THEN) is the weakest, carrying on the
+       match at the next alternative. (*PRUNE) comes next, failing  the  match
+       at  the  current starting position, but allowing an advance to the next
+       character (for an unanchored pattern). (*SKIP) is similar, except  that
+       the advance may be more than one character. (*COMMIT) is the strongest,
+       causing the entire match to fail.
+
+   More than one backtracking verb
+
+       If more than one backtracking verb is present in  a  pattern,  the  one
+       that  is  backtracked  onto first acts. For example, consider this pat-
+       tern, where A, B, etc. are complex pattern fragments:
+
+         (A(*COMMIT)B(*THEN)C|ABD)
+
+       If A matches but B fails, the backtrack to (*COMMIT) causes the  entire
+       match to fail. However, if A and B match, but C fails, the backtrack to
+       (*THEN) causes the next alternative (ABD) to be tried.  This  behaviour
+       is  consistent,  but is not always the same as Perl's. It means that if
+       two or more backtracking verbs appear in succession, all the  the  last
+       of them has no effect. Consider this example:
+
+         ...(*COMMIT)(*PRUNE)...
+
+       If there is a matching failure to the right, backtracking onto (*PRUNE)
+       causes it to be triggered, and its action is taken. There can never  be
+       a backtrack onto (*COMMIT).
+
+   Backtracking verbs in repeated groups
+
+       PCRE2  differs  from  Perl  in  its  handling  of backtracking verbs in
+       repeated groups. For example, consider:
+
+         /(a(*COMMIT)b)+ac/
+
+       If the subject is "abac", Perl matches, but  PCRE2  fails  because  the
+       (*COMMIT) in the second repeat of the group acts.
+
+   Backtracking verbs in assertions
+
+       (*FAIL)  in  an assertion has its normal effect: it forces an immediate
+       backtrack.
+
+       (*ACCEPT) in a positive assertion causes the assertion to succeed with-
+       out  any  further processing. In a negative assertion, (*ACCEPT) causes
+       the assertion to fail without any further processing.
+
+       The other backtracking verbs are not treated specially if  they  appear
+       in  a  positive  assertion.  In  particular,  (*THEN) skips to the next
+       alternative in the innermost enclosing  group  that  has  alternations,
+       whether or not this is within the assertion.
+
+       Negative  assertions  are,  however, different, in order to ensure that
+       changing a positive assertion into a  negative  assertion  changes  its
+       result. Backtracking into (*COMMIT), (*SKIP), or (*PRUNE) causes a neg-
+       ative assertion to be true, without considering any further alternative
+       branches in the assertion.  Backtracking into (*THEN) causes it to skip
+       to the next enclosing alternative within the assertion (the normal  be-
+       haviour),  but  if  the  assertion  does  not have such an alternative,
+       (*THEN) behaves like (*PRUNE).
+
+   Backtracking verbs in subroutines
+
+       These behaviours occur whether or not the subpattern is  called  recur-
+       sively.  Perl's treatment of subroutines is different in some cases.
+
+       (*FAIL)  in  a subpattern called as a subroutine has its normal effect:
+       it forces an immediate backtrack.
+
+       (*ACCEPT) in a subpattern called as a subroutine causes the  subroutine
+       match  to succeed without any further processing. Matching then contin-
+       ues after the subroutine call.
+
+       (*COMMIT), (*SKIP), and (*PRUNE) in a subpattern called as a subroutine
+       cause the subroutine match to fail.
+
+       (*THEN)  skips to the next alternative in the innermost enclosing group
+       within the subpattern that has alternatives. If there is no such  group
+       within the subpattern, (*THEN) causes the subroutine match to fail.
+
+
+SEE ALSO
+
+       pcre2api(3),    pcre2callout(3),    pcre2matching(3),   pcre2syntax(3),
+       pcre2(3).
+
+
+AUTHOR
+
+       Philip Hazel
+       University Computing Service
+       Cambridge, England.
+
+
+REVISION
+
+       Last updated: 13 November 2015
+       Copyright (c) 1997-2015 University of Cambridge.
+------------------------------------------------------------------------------
+
+
+PCRE2PERFORM(3)            Library Functions Manual            PCRE2PERFORM(3)
+
+
+
+NAME
+       PCRE2 - Perl-compatible regular expressions (revised API)
+
+PCRE2 PERFORMANCE
+
+       Two  aspects  of performance are discussed below: memory usage and pro-
+       cessing time. The way you express your pattern as a regular  expression
+       can affect both of them.
+
+
+COMPILED PATTERN MEMORY USAGE
+
+       Patterns are compiled by PCRE2 into a reasonably efficient interpretive
+       code, so that most simple patterns do not  use  much  memory.  However,
+       there  is  one case where the memory usage of a compiled pattern can be
+       unexpectedly large. If a parenthesized subpattern has a quantifier with
+       a minimum greater than 1 and/or a limited maximum, the whole subpattern
+       is repeated in the compiled code. For example, the pattern
+
+         (abc|def){2,4}
+
+       is compiled as if it were
+
+         (abc|def)(abc|def)((abc|def)(abc|def)?)?
+
+       (Technical aside: It is done this way so that backtrack  points  within
+       each of the repetitions can be independently maintained.)
+
+       For  regular expressions whose quantifiers use only small numbers, this
+       is not usually a problem. However, if the numbers are large,  and  par-
+       ticularly  if  such repetitions are nested, the memory usage can become
+       an embarrassment. For example, the very simple pattern
+
+         ((ab){1,1000}c){1,3}
+
+       uses 51K bytes when compiled using the 8-bit  library.  When  PCRE2  is
+       compiled  with its default internal pointer size of two bytes, the size
+       limit on a compiled pattern is 64K code units in the 8-bit  and  16-bit
+       libraries, and this is reached with the above pattern if the outer rep-
+       etition is increased from 3 to 4. PCRE2 can be compiled to  use  larger
+       internal  pointers  and thus handle larger compiled patterns, but it is
+       better to try to rewrite your pattern to use less memory if you can.
+
+       One way of reducing the memory usage for such patterns is to  make  use
+       of PCRE2's "subroutine" facility. Re-writing the above pattern as
+
+         ((ab)(?2){0,999}c)(?1){0,2}
+
+       reduces the memory requirements to 18K, and indeed it remains under 20K
+       even with the outer repetition increased to 100. However, this  pattern
+       is  not  exactly equivalent, because the "subroutine" calls are treated
+       as atomic groups into which there can be no backtracking if there is  a
+       subsequent  matching  failure.  Therefore, PCRE2 cannot do this kind of
+       rewriting automatically.  Furthermore, there is a  noticeable  loss  of
+       speed  when executing the modified pattern. Nevertheless, if the atomic
+       grouping is not a problem and the loss of  speed  is  acceptable,  this
+       kind  of rewriting will allow you to process patterns that PCRE2 cannot
+       otherwise handle.
+
+
+STACK USAGE AT RUN TIME
+
+       When pcre2_match() is used for matching, certain kinds of  pattern  can
+       cause  it  to  use large amounts of the process stack. In some environ-
+       ments the default process stack is quite small, and if it runs out  the
+       result  is  often  SIGSEGV.  Rewriting your pattern can often help. The
+       pcre2stack documentation discusses this issue in detail.
+
+
+PROCESSING TIME
+
+       Certain items in regular expression patterns are processed  more  effi-
+       ciently than others. It is more efficient to use a character class like
+       [aeiou]  than  a  set  of   single-character   alternatives   such   as
+       (a|e|i|o|u).  In  general,  the simplest construction that provides the
+       required behaviour is usually the most efficient. Jeffrey Friedl's book
+       contains  a  lot  of useful general discussion about optimizing regular
+       expressions for efficient performance. This  document  contains  a  few
+       observations about PCRE2.
+
+       Using  Unicode  character  properties  (the  \p, \P, and \X escapes) is
+       slow, because PCRE2 has to use a multi-stage table lookup  whenever  it
+       needs  a  character's  property. If you can find an alternative pattern
+       that does not use character properties, it will probably be faster.
+
+       By default, the escape sequences \b, \d, \s,  and  \w,  and  the  POSIX
+       character  classes  such  as  [:alpha:]  do not use Unicode properties,
+       partly for backwards compatibility, and partly for performance reasons.
+       However,  you  can  set  the PCRE2_UCP option or start the pattern with
+       (*UCP) if you want Unicode character properties to be  used.  This  can
+       double  the  matching  time  for  items  such  as \d, when matched with
+       pcre2_match(); the performance loss is less with a DFA  matching  func-
+       tion, and in both cases there is not much difference for \b.
+
+       When  a pattern begins with .* not in atomic parentheses, nor in paren-
+       theses that are the subject of a backreference,  and  the  PCRE2_DOTALL
+       option  is  set,  the pattern is implicitly anchored by PCRE2, since it
+       can match only at the start of a subject string.  If  the  pattern  has
+       multiple top-level branches, they must all be anchorable. The optimiza-
+       tion can be disabled by  the  PCRE2_NO_DOTSTAR_ANCHOR  option,  and  is
+       automatically disabled if the pattern contains (*PRUNE) or (*SKIP).
+
+       If  PCRE2_DOTALL  is  not  set,  PCRE2  cannot  make this optimization,
+       because the dot metacharacter does not then match a newline, and if the
+       subject  string contains newlines, the pattern may match from the char-
+       acter immediately following one of them instead of from the very start.
+       For example, the pattern
+
+         .*second
+
+       matches  the subject "first\nand second" (where \n stands for a newline
+       character), with the match starting at the seventh character. In  order
+       to  do  this, PCRE2 has to retry the match starting after every newline
+       in the subject.
+
+       If you are using such a pattern with subject strings that do  not  con-
+       tain   newlines,   the   best   performance   is  obtained  by  setting
+       PCRE2_DOTALL, or starting the pattern with  ^.*  or  ^.*?  to  indicate
+       explicit anchoring. That saves PCRE2 from having to scan along the sub-
+       ject looking for a newline to restart at.
+
+       Beware of patterns that contain nested indefinite  repeats.  These  can
+       take  a  long time to run when applied to a string that does not match.
+       Consider the pattern fragment
+
+         ^(a+)*
+
+       This can match "aaaa" in 16 different ways, and this  number  increases
+       very  rapidly  as the string gets longer. (The * repeat can match 0, 1,
+       2, 3, or 4 times, and for each of those cases other than 0 or 4, the  +
+       repeats  can  match  different numbers of times.) When the remainder of
+       the pattern is such that the entire match is going to fail,  PCRE2  has
+       in  principle  to  try  every  possible variation, and this can take an
+       extremely long time, even for relatively short strings.
+
+       An optimization catches some of the more simple cases such as
+
+         (a+)*b
+
+       where a literal character follows. Before  embarking  on  the  standard
+       matching  procedure, PCRE2 checks that there is a "b" later in the sub-
+       ject string, and if there is not, it fails the match immediately.  How-
+       ever,  when  there  is no following literal this optimization cannot be
+       used. You can see the difference by comparing the behaviour of
+
+         (a+)*\d
+
+       with the pattern above. The former gives  a  failure  almost  instantly
+       when  applied  to  a  whole  line of "a" characters, whereas the latter
+       takes an appreciable time with strings longer than about 20 characters.
+
+       In many cases, the solution to this kind of performance issue is to use
+       an atomic group or a possessive quantifier.
+
+
+AUTHOR
+
+       Philip Hazel
+       University Computing Service
+       Cambridge, England.
+
+
+REVISION
+
+       Last updated: 02 January 2015
+       Copyright (c) 1997-2015 University of Cambridge.
+------------------------------------------------------------------------------
+
+
+PCRE2POSIX(3)              Library Functions Manual              PCRE2POSIX(3)
+
+
+
+NAME
+       PCRE2 - Perl-compatible regular expressions (revised API)
+
+SYNOPSIS
+
+       #include <pcre2posix.h>
+
+       int regcomp(regex_t *preg, const char *pattern,
+            int cflags);
+
+       int regexec(const regex_t *preg, const char *string,
+            size_t nmatch, regmatch_t pmatch[], int eflags);
+
+       size_t regerror(int errcode, const regex_t *preg,
+            char *errbuf, size_t errbuf_size);
+
+       void regfree(regex_t *preg);
+
+
+DESCRIPTION
+
+       This  set of functions provides a POSIX-style API for the PCRE2 regular
+       expression 8-bit library. See the pcre2api documentation for a descrip-
+       tion  of PCRE2's native API, which contains much additional functional-
+       ity. There is no POSIX-style wrapper  for  PCRE2's  16-bit  and  32-bit
+       libraries.
+
+       The functions described here are just wrapper functions that ultimately
+       call the  PCRE2  native  API.  Their  prototypes  are  defined  in  the
+       pcre2posix.h  header  file,  and  on Unix systems the library itself is
+       called libpcre2-posix.a, so can be accessed by adding -lpcre2-posix  to
+       the  command  for  linking  an  application that uses them. Because the
+       POSIX functions call the native ones,  it  is  also  necessary  to  add
+       -lpcre2-8.
+
+       Those  POSIX  option bits that can reasonably be mapped to PCRE2 native
+       options have been implemented. In addition, the option REG_EXTENDED  is
+       defined  with  the  value  zero. This has no effect, but since programs
+       that are written to the POSIX interface often use  it,  this  makes  it
+       easier  to  slot in PCRE2 as a replacement library. Other POSIX options
+       are not even defined.
+
+       There are also some other options that are not defined by POSIX.  These
+       have been added at the request of users who want to make use of certain
+       PCRE2-specific features via the POSIX calling interface.
+
+       When PCRE2 is called via these functions, it is only the  API  that  is
+       POSIX-like  in  style.  The syntax and semantics of the regular expres-
+       sions themselves are still those of Perl, subject  to  the  setting  of
+       various  PCRE2 options, as described below. "POSIX-like in style" means
+       that the API approximates to the POSIX  definition;  it  is  not  fully
+       POSIX-compatible,  and  in  multi-unit  encoding domains it is probably
+       even less compatible.
+
+       The header for these functions is supplied as pcre2posix.h to avoid any
+       potential  clash  with  other  POSIX  libraries.  It can, of course, be
+       renamed or aliased as regex.h, which is the "correct" name. It provides
+       two  structure  types,  regex_t  for  compiled internal forms, and reg-
+       match_t for returning captured substrings. It also  defines  some  con-
+       stants  whose  names  start  with  "REG_";  these  are used for setting
+       options and identifying error codes.
+
+
+COMPILING A PATTERN
+
+       The function regcomp() is called to compile a pattern into an  internal
+       form.  The  pattern  is  a C string terminated by a binary zero, and is
+       passed in the argument pattern. The preg argument is  a  pointer  to  a
+       regex_t  structure that is used as a base for storing information about
+       the compiled regular expression.
+
+       The argument cflags is either zero, or contains one or more of the bits
+       defined by the following macros:
+
+         REG_DOTALL
+
+       The  PCRE2_DOTALL  option  is set when the regular expression is passed
+       for compilation to the native function. Note  that  REG_DOTALL  is  not
+       part of the POSIX standard.
+
+         REG_ICASE
+
+       The  PCRE2_CASELESS option is set when the regular expression is passed
+       for compilation to the native function.
+
+         REG_NEWLINE
+
+       The PCRE2_MULTILINE option is set when the regular expression is passed
+       for  compilation  to the native function. Note that this does not mimic
+       the defined POSIX behaviour for REG_NEWLINE  (see  the  following  sec-
+       tion).
+
+         REG_NOSUB
+
+       The  PCRE2_NO_AUTO_CAPTURE option is set when the regular expression is
+       passed for compilation to the native function. In addition, when a pat-
+       tern  that is compiled with this flag is passed to regexec() for match-
+       ing, the nmatch and pmatch  arguments  are  ignored,  and  no  captured
+       strings are returned.
+
+         REG_UCP
+
+       The  PCRE2_UCP  option is set when the regular expression is passed for
+       compilation to the native function. This causes PCRE2  to  use  Unicode
+       properties  when  matchine  \d,  \w,  etc., instead of just recognizing
+       ASCII values. Note that REG_UCP is not part of the POSIX standard.
+
+         REG_UNGREEDY
+
+       The PCRE2_UNGREEDY option is set when the regular expression is  passed
+       for  compilation  to the native function. Note that REG_UNGREEDY is not
+       part of the POSIX standard.
+
+         REG_UTF
+
+       The PCRE2_UTF option is set when the regular expression is  passed  for
+       compilation  to the native function. This causes the pattern itself and
+       all data strings used for matching it to be treated as  UTF-8  strings.
+       Note that REG_UTF is not part of the POSIX standard.
+
+       In  the  absence  of  these  flags, no options are passed to the native
+       function.  This means the the regex  is  compiled  with  PCRE2  default
+       semantics.  In particular, the way it handles newline characters in the
+       subject string is the Perl way, not the POSIX way.  Note  that  setting
+       PCRE2_MULTILINE has only some of the effects specified for REG_NEWLINE.
+       It does not affect the way newlines are matched by the dot  metacharac-
+       ter (they are not) or by a negative class such as [^a] (they are).
+
+       The  yield of regcomp() is zero on success, and non-zero otherwise. The
+       preg structure is filled in on success, and one member of the structure
+       is  public: re_nsub contains the number of capturing subpatterns in the
+       regular expression. Various error codes are defined in the header file.
+
+       NOTE: If the yield of regcomp() is non-zero, you must  not  attempt  to
+       use the contents of the preg structure. If, for example, you pass it to
+       regexec(), the result is undefined and your program is likely to crash.
+
+
+MATCHING NEWLINE CHARACTERS
+
+       This area is not simple, because POSIX and Perl take different views of
+       things.   It  is not possible to get PCRE2 to obey POSIX semantics, but
+       then PCRE2 was never intended to be a POSIX engine. The following table
+       lists  the  different  possibilities for matching newline characters in
+       Perl and PCRE2:
+
+                                 Default   Change with
+
+         . matches newline          no     PCRE2_DOTALL
+         newline matches [^a]       yes    not changeable
+         $ matches \n at end        yes    PCRE2_DOLLAR_ENDONLY
+         $ matches \n in middle     no     PCRE2_MULTILINE
+         ^ matches \n in middle     no     PCRE2_MULTILINE
+
+       This is the equivalent table for a POSIX-compatible pattern matcher:
+
+                                 Default   Change with
+
+         . matches newline          yes    REG_NEWLINE
+         newline matches [^a]       yes    REG_NEWLINE
+         $ matches \n at end        no     REG_NEWLINE
+         $ matches \n in middle     no     REG_NEWLINE
+         ^ matches \n in middle     no     REG_NEWLINE
+
+       This behaviour is not what happens when PCRE2 is called via  its  POSIX
+       API.  By  default, PCRE2's behaviour is the same as Perl's, except that
+       there is no equivalent for PCRE2_DOLLAR_ENDONLY in Perl. In both  PCRE2
+       and Perl, there is no way to stop newline from matching [^a].
+
+       Default  POSIX newline handling can be obtained by setting PCRE2_DOTALL
+       and PCRE2_DOLLAR_ENDONLY when  calling  pcre2_compile()  directly,  but
+       there  is  no  way  to make PCRE2 behave exactly as for the REG_NEWLINE
+       action. When using the POSIX API, passing REG_NEWLINE to  PCRE2's  reg-
+       comp() function causes PCRE2_MULTILINE to be passed to pcre2_compile(),
+       and REG_DOTALL passes PCRE2_DOTALL. There is no way to pass  PCRE2_DOL-
+       LAR_ENDONLY.
+
+
+MATCHING A PATTERN
+
+       The  function  regexec()  is  called  to  match a compiled pattern preg
+       against a given string, which is by default terminated by a  zero  byte
+       (but  see  REG_STARTEND below), subject to the options in eflags. These
+       can be:
+
+         REG_NOTBOL
+
+       The PCRE2_NOTBOL option is set when calling the underlying PCRE2 match-
+       ing function.
+
+         REG_NOTEMPTY
+
+       The  PCRE2_NOTEMPTY  option  is  set  when calling the underlying PCRE2
+       matching function. Note that REG_NOTEMPTY is  not  part  of  the  POSIX
+       standard.  However, setting this option can give more POSIX-like behav-
+       iour in some situations.
+
+         REG_NOTEOL
+
+       The PCRE2_NOTEOL option is set when calling the underlying PCRE2 match-
+       ing function.
+
+         REG_STARTEND
+
+       The  string  is  considered to start at string + pmatch[0].rm_so and to
+       have a terminating NUL located at string + pmatch[0].rm_eo (there  need
+       not  actually  be  a  NUL at that location), regardless of the value of
+       nmatch. This is a BSD extension, compatible with but not  specified  by
+       IEEE  Standard  1003.2  (POSIX.2),  and  should be used with caution in
+       software intended to be portable to other systems. Note that a non-zero
+       rm_so does not imply REG_NOTBOL; REG_STARTEND affects only the location
+       of the string, not how it is matched. Setting REG_STARTEND and  passing
+       pmatch  as  NULL  are  mutually  exclusive;  the  error  REG_INVARG  is
+       returned.
+
+       If the pattern was compiled with the REG_NOSUB flag, no data about  any
+       matched  strings  is  returned.  The  nmatch  and  pmatch  arguments of
+       regexec() are ignored.
+
+       If the value of nmatch is zero, or if the value pmatch is NULL, no data
+       about any matched strings is returned.
+
+       Otherwise,the portion of the string that was matched, and also any cap-
+       tured substrings, are returned via the pmatch argument, which points to
+       an  array  of nmatch structures of type regmatch_t, containing the mem-
+       bers rm_so and rm_eo. These contain the byte offset to the first  char-
+       acter of each substring and the offset to the first character after the
+       end of each substring, respectively. The  0th  element  of  the  vector
+       relates  to  the  entire portion of string that was matched; subsequent
+       elements relate to the capturing subpatterns of the regular expression.
+       Unused entries in the array have both structure members set to -1.
+
+       A  successful  match  yields  a  zero  return;  various error codes are
+       defined in the header file, of  which  REG_NOMATCH  is  the  "expected"
+       failure code.
+
+
+ERROR MESSAGES
+
+       The regerror() function maps a non-zero errorcode from either regcomp()
+       or regexec() to a printable message. If preg is  not  NULL,  the  error
+       should have arisen from the use of that structure. A message terminated
+       by a binary zero is placed in errbuf. If the buffer is too short,  only
+       the first errbuf_size - 1 characters of the error message are used. The
+       yield of the function is the size of buffer needed to  hold  the  whole
+       message,  including  the  terminating  zero. This value is greater than
+       errbuf_size if the message was truncated.
+
+
+MEMORY USAGE
+
+       Compiling a regular expression causes memory to be allocated and  asso-
+       ciated  with  the preg structure. The function regfree() frees all such
+       memory, after which preg may no longer be used as  a  compiled  expres-
+       sion.
+
+
+AUTHOR
+
+       Philip Hazel
+       University Computing Service
+       Cambridge, England.
+
+
+REVISION
+
+       Last updated: 29 November 2015
+       Copyright (c) 1997-2015 University of Cambridge.
+------------------------------------------------------------------------------
+
+
+PCRE2SAMPLE(3)             Library Functions Manual             PCRE2SAMPLE(3)
+
+
+
+NAME
+       PCRE2 - Perl-compatible regular expressions (revised API)
+
+PCRE2 SAMPLE PROGRAM
+
+       A  simple, complete demonstration program to get you started with using
+       PCRE2 is supplied in the file pcre2demo.c in the src directory  in  the
+       PCRE2 distribution. A listing of this program is given in the pcre2demo
+       documentation. If you do not have a copy of the PCRE2 distribution, you
+       can save this listing to re-create the contents of pcre2demo.c.
+
+       The demonstration program, which uses the PCRE2 8-bit library, compiles
+       the regular expression that is  its  first  argument,  and  matches  it
+       against the subject string in its second argument. No PCRE2 options are
+       set, and default character tables are used. If matching  succeeds,  the
+       program  outputs the portion of the subject that matched, together with
+       the contents of any captured substrings.
+
+       If the -g option is given on the command line, the program then goes on
+       to check for further matches of the same regular expression in the same
+       subject string. The logic is a little bit tricky because of the  possi-
+       bility  of  matching an empty string. Comments in the code explain what
+       is going on.
+
+       If PCRE2 is installed in the standard include and  library  directories
+       for your operating system, you should be able to compile the demonstra-
+       tion program using this command:
+
+         gcc -o pcre2demo pcre2demo.c -lpcre2-8
+
+       If PCRE2 is installed elsewhere, you may need to add additional options
+       to  the command line. For example, on a Unix-like system that has PCRE2
+       installed in /usr/local, you  can  compile  the  demonstration  program
+       using a command like this:
+
+         gcc -o pcre2demo -I/usr/local/include pcre2demo.c \
+             -L/usr/local/lib -lpcre2-8
+
+
+       Once  you  have  compiled and linked the demonstration program, you can
+       run simple tests like this:
+
+         ./pcre2demo 'cat|dog' 'the cat sat on the mat'
+         ./pcre2demo -g 'cat|dog' 'the dog sat on the cat'
+
+       Note that there is a  much  more  comprehensive  test  program,  called
+       pcre2test,  which  supports  many  more  facilities for testing regular
+       expressions using the PCRE2 libraries. The pcre2demo  program  is  pro-
+       vided as a simple coding example.
+
+       If you try to run pcre2demo when PCRE2 is not installed in the standard
+       library directory, you may get an error like  this  on  some  operating
+       systems (e.g. Solaris):
+
+         ld.so.1:  a.out:  fatal:  libpcre2.so.0: open failed: No such file or
+       directory
+
+       This is caused by the way shared library support works  on  those  sys-
+       tems. You need to add
+
+         -R/usr/local/lib
+
+       (for example) to the compile command to get round this problem.
+
+
+AUTHOR
+
+       Philip Hazel
+       University Computing Service
+       Cambridge, England.
+
+
+REVISION
+
+       Last updated: 20 October 2014
+       Copyright (c) 1997-2014 University of Cambridge.
+------------------------------------------------------------------------------
+PCRE2SERIALIZE(3)          Library Functions Manual          PCRE2SERIALIZE(3)
+
+
+
+NAME
+       PCRE2 - Perl-compatible regular expressions (revised API)
+
+SAVING AND RE-USING PRECOMPILED PCRE2 PATTERNS
+
+       int32_t pcre2_serialize_decode(pcre2_code **codes,
+         int32_t number_of_codes, const uint32_t *bytes,
+         pcre2_general_context *gcontext);
+
+       int32_t pcre2_serialize_encode(pcre2_code **codes,
+         int32_t number_of_codes, uint32_t **serialized_bytes,
+         PCRE2_SIZE *serialized_size, pcre2_general_context *gcontext);
+
+       void pcre2_serialize_free(uint8_t *bytes);
+
+       int32_t pcre2_serialize_get_number_of_codes(const uint8_t *bytes);
+
+       If  you  are running an application that uses a large number of regular
+       expression patterns, it may be useful to store them  in  a  precompiled
+       form  instead  of  having to compile them every time the application is
+       run. However, if you are using the just-in-time  optimization  feature,
+       it is not possible to save and reload the JIT data, because it is posi-
+       tion-dependent. The host on which the patterns  are  reloaded  must  be
+       running  the  same version of PCRE2, with the same code unit width, and
+       must also have the same endianness, pointer width and PCRE2_SIZE  type.
+       For  example, patterns compiled on a 32-bit system using PCRE2's 16-bit
+       library cannot be reloaded on a 64-bit system, nor can they be reloaded
+       using the 8-bit library.
+
+
+SAVING COMPILED PATTERNS
+
+       Before compiled patterns can be saved they must be serialized, that is,
+       converted to a stream of bytes. A single byte stream  may  contain  any
+       number  of  compiled patterns, but they must all use the same character
+       tables. A single copy of the tables is included in the byte stream (its
+       size is 1088 bytes). For more details of character tables, see the sec-
+       tion on locale support in the pcre2api documentation.
+
+       The function pcre2_serialize_encode() creates a serialized byte  stream
+       from  a  list of compiled patterns. Its first two arguments specify the
+       list, being a pointer to a vector of pointers to compiled patterns, and
+       the length of the vector. The third and fourth arguments point to vari-
+       ables which are set to point to the created byte stream and its length,
+       respectively.  The  final  argument  is a pointer to a general context,
+       which can be used to specify custom memory  mangagement  functions.  If
+       this  argument  is NULL, malloc() is used to obtain memory for the byte
+       stream. The yield of the function is the number of serialized patterns,
+       or one of the following negative error codes:
+
+         PCRE2_ERROR_BADDATA      the number of patterns is zero or less
+         PCRE2_ERROR_BADMAGIC     mismatch of id bytes in one of the patterns
+         PCRE2_ERROR_MEMORY       memory allocation failed
+         PCRE2_ERROR_MIXEDTABLES  the patterns do not all use the same tables
+         PCRE2_ERROR_NULL         the 1st, 3rd, or 4th argument is NULL
+
+       PCRE2_ERROR_BADMAGIC  means  either that a pattern's code has been cor-
+       rupted, or that a slot in the vector does not point to a compiled  pat-
+       tern.
+
+       Once a set of patterns has been serialized you can save the data in any
+       appropriate manner. Here is sample code that compiles two patterns  and
+       writes them to a file. It assumes that the variable fd refers to a file
+       that is open for output. The error checking that should be present in a
+       real application has been omitted for simplicity.
+
+         int errorcode;
+         uint8_t *bytes;
+         PCRE2_SIZE erroroffset;
+         PCRE2_SIZE bytescount;
+         pcre2_code *list_of_codes[2];
+         list_of_codes[0] = pcre2_compile("first pattern",
+           PCRE2_ZERO_TERMINATED, 0, &errorcode, &erroroffset, NULL);
+         list_of_codes[1] = pcre2_compile("second pattern",
+           PCRE2_ZERO_TERMINATED, 0, &errorcode, &erroroffset, NULL);
+         errorcode = pcre2_serialize_encode(list_of_codes, 2, &bytes,
+           &bytescount, NULL);
+         errorcode = fwrite(bytes, 1, bytescount, fd);
+
+       Note  that  the  serialized data is binary data that may contain any of
+       the 256 possible byte  values.  On  systems  that  make  a  distinction
+       between binary and non-binary data, be sure that the file is opened for
+       binary output.
+
+       Serializing a set of patterns leaves the original  data  untouched,  so
+       they  can  still  be used for matching. Their memory must eventually be
+       freed in the usual way by calling pcre2_code_free(). When you have fin-
+       ished with the byte stream, it too must be freed by calling pcre2_seri-
+       alize_free().
+
+
+RE-USING PRECOMPILED PATTERNS
+
+       In order to re-use a set of saved patterns  you  must  first  make  the
+       serialized  byte stream available in main memory (for example, by read-
+       ing from a file). The management of this memory  block  is  up  to  the
+       application.  You  can  use  the  pcre2_serialize_get_number_of_codes()
+       function to find out how many compiled patterns are in  the  serialized
+       data without actually decoding the patterns:
+
+         uint8_t *bytes = <serialized data>;
+         int32_t number_of_codes = pcre2_serialize_get_number_of_codes(bytes);
+
+       The pcre2_serialize_decode() function reads a byte stream and recreates
+       the compiled patterns in new memory blocks, setting pointers to them in
+       a  vector.  The  first two arguments are a pointer to a suitable vector
+       and its length, and the third argument points to  a  byte  stream.  The
+       final  argument is a pointer to a general context, which can be used to
+       specify custom memory mangagement functions for the  decoded  patterns.
+       If this argument is NULL, malloc() and free() are used. After deserial-
+       ization, the byte stream is no longer needed and can be discarded.
+
+         int32_t number_of_codes;
+         pcre2_code *list_of_codes[2];
+         uint8_t *bytes = <serialized data>;
+         int32_t number_of_codes =
+           pcre2_serialize_decode(list_of_codes, 2, bytes, NULL);
+
+       If the vector is not large enough for all  the  patterns  in  the  byte
+       stream,  it  is  filled  with  those  that  fit,  and the remainder are
+       ignored. The yield of the function is the number of  decoded  patterns,
+       or one of the following negative error codes:
+
+         PCRE2_ERROR_BADDATA   second argument is zero or less
+         PCRE2_ERROR_BADMAGIC  mismatch of id bytes in the data
+         PCRE2_ERROR_BADMODE   mismatch of variable unit size or PCRE2 version
+         PCRE2_ERROR_MEMORY    memory allocation failed
+         PCRE2_ERROR_NULL      first or third argument is NULL
+
+       PCRE2_ERROR_BADMAGIC  may mean that the data is corrupt, or that it was
+       compiled on a system with different endianness.
+
+       Decoded patterns can be used for matching in the usual way, and must be
+       freed  by  calling pcre2_code_free(). However, be aware that there is a
+       potential race issue if you  are  using  multiple  patterns  that  were
+       decoded  from  a  single  byte stream in a multithreaded application. A
+       single copy of the character tables is used by all the decoded patterns
+       and a reference count is used to arrange for its memory to be automati-
+       cally freed when the last pattern is freed, but there is no locking  on
+       this  reference count. Therefore, if you want to call pcre2_code_free()
+       for these patterns in different threads,  you  must  arrange  your  own
+       locking,  and  ensure  that  pcre2_code_free()  cannot be called by two
+       threads at the same time.
+
+       If a pattern was processed by pcre2_jit_compile() before being  serial-
+       ized,  the  JIT data is discarded and so is no longer available after a
+       save/restore cycle. You can, however, process a restored  pattern  with
+       pcre2_jit_compile() if you wish.
+
+
+AUTHOR
+
+       Philip Hazel
+       University Computing Service
+       Cambridge, England.
+
+
+REVISION
+
+       Last updated: 03 November 2015
+       Copyright (c) 1997-2015 University of Cambridge.
+------------------------------------------------------------------------------
+
+
+PCRE2STACK(3)              Library Functions Manual              PCRE2STACK(3)
+
+
+
+NAME
+       PCRE2 - Perl-compatible regular expressions (revised API)
+
+PCRE2 DISCUSSION OF STACK USAGE
+
+       When  you  call  pcre2_match(),  it  makes  use of an internal function
+       called match(). This calls itself recursively at branch points  in  the
+       pattern,  in  order  to  remember the state of the match so that it can
+       back up and try a different alternative after a  failure.  As  matching
+       proceeds  deeper  and deeper into the tree of possibilities, the recur-
+       sion depth increases. The match() function is also called in other cir-
+       cumstances,  for  example,  whenever  a  parenthesized  sub-pattern  is
+       entered, and in certain cases of repetition.
+
+       Not all calls of match() increase the recursion depth; for an item such
+       as  a* it may be called several times at the same level, after matching
+       different numbers of a's. Furthermore, in a number of cases  where  the
+       result  of  the  recursive call would immediately be passed back as the
+       result of the current call (a "tail recursion"), the function  is  just
+       restarted instead.
+
+       Each  time the internal match() function is called recursively, it uses
+       memory from the process stack. For certain kinds of pattern  and  data,
+       very  large  amounts of stack may be needed, despite the recognition of
+       "tail recursion". Note that if  PCRE2  is  compiled  with  the  -fsani-
+       tize=address  option  of  the  GCC compiler, the stack requirements are
+       greatly increased.
+
+       The above comments apply when pcre2_match() is run in its normal inter-
+       pretive manner. If the compiled pattern was processed by pcre2_jit_com-
+       pile(), and just-in-time compiling  was  successful,  and  the  options
+       passed  to  pcre2_match()  were  not incompatible, the matching process
+       uses the JIT-compiled code instead of the  match()  function.  In  this
+       case, the memory requirements are handled entirely differently. See the
+       pcre2jit documentation for details.
+
+       The  pcre2_dfa_match()  function  operates  in  a  different   way   to
+       pcre2_match(),  and uses recursion only when there is a regular expres-
+       sion recursion or subroutine call in the  pattern.  This  includes  the
+       processing  of assertion and "once-only" subpatterns, which are handled
+       like subroutine calls.  Normally, these are never very  deep,  and  the
+       limit  on  the  complexity  of  pcre2_dfa_match()  is controlled by the
+       amount of workspace it is given.  However, it is possible to write pat-
+       terns  with  runaway  infinite  recursions;  such  patterns  will cause
+       pcre2_dfa_match() to run out of stack. At present, there is no  protec-
+       tion against this.
+
+       The  comments  that  follow do NOT apply to pcre2_dfa_match(); they are
+       relevant only for pcre2_match() without the JIT optimization.
+
+   Reducing pcre2_match()'s stack usage
+
+       You can often reduce the amount of recursion, and therefore the  amount
+       of  stack  used,  by  modifying the pattern that is being matched. Con-
+       sider, for example, this pattern:
+
+         ([^<]|<(?!inet))+
+
+       It matches from wherever it starts until it encounters "<inet"  or  the
+       end  of  the  data,  and is the kind of pattern that might be used when
+       processing an XML file. Each iteration of the outer parentheses matches
+       either  one  character that is not "<" or a "<" that is not followed by
+       "inet". However, each time a  parenthesis  is  processed,  a  recursion
+       occurs, so this formulation uses a stack frame for each matched charac-
+       ter. For a long string, a lot of stack is required. Consider  now  this
+       rewritten pattern, which matches exactly the same strings:
+
+         ([^<]++|<(?!inet))+
+
+       This  uses very much less stack, because runs of characters that do not
+       contain "<" are "swallowed" in one item inside the parentheses.  Recur-
+       sion  happens  only when a "<" character that is not followed by "inet"
+       is encountered (and we assume this is relatively  rare).  A  possessive
+       quantifier  is  used  to stop any backtracking into the runs of non-"<"
+       characters, but that is not related to stack usage.
+
+       This example shows that one way of avoiding stack problems when  match-
+       ing long subject strings is to write repeated parenthesized subpatterns
+       to match more than one character whenever possible.
+
+   Compiling PCRE2 to use heap instead of stack for pcre2_match()
+
+       In environments where stack memory is constrained, you  might  want  to
+       compile PCRE2 to use heap memory instead of stack for remembering back-
+       up points when pcre2_match() is running. This makes it run more slowly,
+       however. Details of how to do this are given in the pcre2build documen-
+       tation. When built in this way, instead of using the stack, PCRE2  gets
+       memory  for  remembering  backup  points from the heap. By default, the
+       memory is obtained by calling the system malloc() function, but you can
+       arrange to supply your own memory management function. For details, see
+       the section entitled "The match context" in the pcre2api documentation.
+       Since the block sizes are always the same, it may be possible to imple-
+       ment customized a memory handler that is more efficient than the  stan-
+       dard function. The memory blocks obtained for this purpose are retained
+       and re-used if possible while pcre2_match() is running.  They  are  all
+       freed just before it exits.
+
+   Limiting pcre2_match()'s stack usage
+
+       You can set limits on the number of times the internal match() function
+       is called, both in total and  recursively.  If  a  limit  is  exceeded,
+       pcre2_match()  returns  an  error  code. Setting suitable limits should
+       prevent it from running out of stack. The default values of the  limits
+       are  very large, and unlikely ever to operate. They can be changed when
+       PCRE2 is built, and they can also be set when pcre2_match() is  called.
+       For  details  of these interfaces, see the pcre2build documentation and
+       the section entitled "The match context" in the pcre2api documentation.
+
+       As a very rough rule of thumb, you should reckon on about 500 bytes per
+       recursion.  Thus,  if  you  want  to limit your stack usage to 8Mb, you
+       should set the limit at 16000 recursions. A 64Mb stack,  on  the  other
+       hand, can support around 128000 recursions.
+
+       The  pcre2test  test program has a modifier called "find_limits" which,
+       if applied to a subject line, causes it to  find  the  smallest  limits
+       that  allow a a pattern to match. This is done by calling pcre2_match()
+       repeatedly with different limits.
+
+   Changing stack size in Unix-like systems
+
+       In Unix-like environments, there is not often a problem with the  stack
+       unless  very  long  strings  are  involved, though the default limit on
+       stack size varies from system to system. Values from 8Mb  to  64Mb  are
+       common. You can find your default limit by running the command:
+
+         ulimit -s
+
+       Unfortunately,  the  effect  of  running out of stack is often SIGSEGV,
+       though sometimes a more explicit error message is given. You  can  nor-
+       mally increase the limit on stack size by code such as this:
+
+         struct rlimit rlim;
+         getrlimit(RLIMIT_STACK, &rlim);
+         rlim.rlim_cur = 100*1024*1024;
+         setrlimit(RLIMIT_STACK, &rlim);
+
+       This  reads  the current limits (soft and hard) using getrlimit(), then
+       attempts to increase the soft limit to  100Mb  using  setrlimit().  You
+       must do this before calling pcre2_match().
+
+   Changing stack size in Mac OS X
+
+       Using setrlimit(), as described above, should also work on Mac OS X. It
+       is also possible to set a stack size when linking a program. There is a
+       discussion   about   stack  sizes  in  Mac  OS  X  at  this  web  site:
+       http://developer.apple.com/qa/qa2005/qa1419.html.
+
+
+AUTHOR
+
+       Philip Hazel
+       University Computing Service
+       Cambridge, England.
+
+
+REVISION
+
+       Last updated: 21 November 2014
+       Copyright (c) 1997-2014 University of Cambridge.
+------------------------------------------------------------------------------
+
+
+PCRE2SYNTAX(3)             Library Functions Manual             PCRE2SYNTAX(3)
+
+
+
+NAME
+       PCRE2 - Perl-compatible regular expressions (revised API)
+
+PCRE2 REGULAR EXPRESSION SYNTAX SUMMARY
+
+       The  full syntax and semantics of the regular expressions that are sup-
+       ported by PCRE2 are described in the pcre2pattern  documentation.  This
+       document contains a quick-reference summary of the syntax.
+
+
+QUOTING
+
+         \x         where x is non-alphanumeric is a literal x
+         \Q...\E    treat enclosed characters as literal
+
+
+ESCAPED CHARACTERS
+
+       This table applies to ASCII and Unicode environments.
+
+         \a         alarm, that is, the BEL character (hex 07)
+         \cx        "control-x", where x is any ASCII printing character
+         \e         escape (hex 1B)
+         \f         form feed (hex 0C)
+         \n         newline (hex 0A)
+         \r         carriage return (hex 0D)
+         \t         tab (hex 09)
+         \0dd       character with octal code 0dd
+         \ddd       character with octal code ddd, or backreference
+         \o{ddd..}  character with octal code ddd..
+         \U         "U" if PCRE2_ALT_BSUX is set (otherwise is an error)
+         \uhhhh     character with hex code hhhh (if PCRE2_ALT_BSUX is set)
+         \xhh       character with hex code hh
+         \x{hhh..}  character with hex code hhh..
+
+       Note that \0dd is always an octal code. The treatment of backslash fol-
+       lowed by a non-zero digit is complicated; for details see  the  section
+       "Non-printing  characters"  in  the  pcre2pattern  documentation, where
+       details of escape processing in EBCDIC environments are also given.
+
+       When \x is not followed by {, from zero to two hexadecimal  digits  are
+       read, but if PCRE2_ALT_BSUX is set, \x must be followed by two hexadec-
+       imal digits to be recognized as  a  hexadecimal  escape;  otherwise  it
+       matches  a literal "x".  Likewise, if \u (in ALT_BSUX mode) is not fol-
+       lowed by four hexadecimal digits, it matches a literal "u".
+
+
+CHARACTER TYPES
+
+         .          any character except newline;
+                      in dotall mode, any character whatsoever
+         \C         one code unit, even in UTF mode (best avoided)
+         \d         a decimal digit
+         \D         a character that is not a decimal digit
+         \h         a horizontal white space character
+         \H         a character that is not a horizontal white space character
+         \N         a character that is not a newline
+         \p{xx}     a character with the xx property
+         \P{xx}     a character without the xx property
+         \R         a newline sequence
+         \s         a white space character
+         \S         a character that is not a white space character
+         \v         a vertical white space character
+         \V         a character that is not a vertical white space character
+         \w         a "word" character
+         \W         a "non-word" character
+         \X         a Unicode extended grapheme cluster
+
+       \C is dangerous because it may leave the current matching point in  the
+       middle of a UTF-8 or UTF-16 character. The application can lock out the
+       use of \C by setting the PCRE2_NEVER_BACKSLASH_C  option.  It  is  also
+       possible to build PCRE2 with the use of \C permanently disabled.
+
+       By  default,  \d, \s, and \w match only ASCII characters, even in UTF-8
+       mode or in the 16-bit and 32-bit libraries. However, if locale-specific
+       matching  is  happening,  \s and \w may also match characters with code
+       points in the range 128-255. If the PCRE2_UCP option is set, the behav-
+       iour of these escape sequences is changed to use Unicode properties and
+       they match many more characters.
+
+
+GENERAL CATEGORY PROPERTIES FOR \p and \P
+
+         C          Other
+         Cc         Control
+         Cf         Format
+         Cn         Unassigned
+         Co         Private use
+         Cs         Surrogate
+
+         L          Letter
+         Ll         Lower case letter
+         Lm         Modifier letter
+         Lo         Other letter
+         Lt         Title case letter
+         Lu         Upper case letter
+         L&         Ll, Lu, or Lt
+
+         M          Mark
+         Mc         Spacing mark
+         Me         Enclosing mark
+         Mn         Non-spacing mark
+
+         N          Number
+         Nd         Decimal number
+         Nl         Letter number
+         No         Other number
+
+         P          Punctuation
+         Pc         Connector punctuation
+         Pd         Dash punctuation
+         Pe         Close punctuation
+         Pf         Final punctuation
+         Pi         Initial punctuation
+         Po         Other punctuation
+         Ps         Open punctuation
+
+         S          Symbol
+         Sc         Currency symbol
+         Sk         Modifier symbol
+         Sm         Mathematical symbol
+         So         Other symbol
+
+         Z          Separator
+         Zl         Line separator
+         Zp         Paragraph separator
+         Zs         Space separator
+
+
+PCRE2 SPECIAL CATEGORY PROPERTIES FOR \p and \P
+
+         Xan        Alphanumeric: union of properties L and N
+         Xps        POSIX space: property Z or tab, NL, VT, FF, CR
+         Xsp        Perl space: property Z or tab, NL, VT, FF, CR
+         Xuc        Univerally-named character: one that can be
+                      represented by a Universal Character Name
+         Xwd        Perl word: property Xan or underscore
+
+       Perl and POSIX space are now the same. Perl added VT to its space char-
+       acter set at release 5.18.
+
+
+SCRIPT NAMES FOR \p AND \P
+
+       Ahom,   Anatolian_Hieroglyphs,  Arabic,  Armenian,  Avestan,  Balinese,
+       Bamum, Bassa_Vah, Batak, Bengali, Bopomofo, Brahmi, Braille,  Buginese,
+       Buhid,  Canadian_Aboriginal,  Carian, Caucasian_Albanian, Chakma, Cham,
+       Cherokee,  Common,  Coptic,  Cuneiform,  Cypriot,  Cyrillic,   Deseret,
+       Devanagari,  Duployan,  Egyptian_Hieroglyphs,  Elbasan, Ethiopic, Geor-
+       gian, Glagolitic, Gothic,  Grantha,  Greek,  Gujarati,  Gurmukhi,  Han,
+       Hangul, Hanunoo, Hatran, Hebrew, Hiragana, Imperial_Aramaic, Inherited,
+       Inscriptional_Pahlavi, Inscriptional_Parthian, Javanese,  Kaithi,  Kan-
+       nada,  Katakana,  Kayah_Li,  Kharoshthi, Khmer, Khojki, Khudawadi, Lao,
+       Latin, Lepcha, Limbu, Linear_A, Linear_B, Lisu, Lycian,  Lydian,  Maha-
+       jani,  Malayalam,  Mandaic,  Manichaean,  Meetei_Mayek,  Mende_Kikakui,
+       Meroitic_Cursive, Meroitic_Hieroglyphs,  Miao,  Modi,  Mongolian,  Mro,
+       Multani,   Myanmar,   Nabataean,  New_Tai_Lue,  Nko,  Ogham,  Ol_Chiki,
+       Old_Hungarian, Old_Italic, Old_North_Arabian, Old_Permic,  Old_Persian,
+       Old_South_Arabian, Old_Turkic, Oriya, Osmanya, Pahawh_Hmong, Palmyrene,
+       Pau_Cin_Hau,  Phags_Pa,  Phoenician,  Psalter_Pahlavi,  Rejang,  Runic,
+       Samaritan, Saurashtra, Sharada, Shavian, Siddham, SignWriting, Sinhala,
+       Sora_Sompeng,  Sundanese,  Syloti_Nagri,  Syriac,  Tagalog,   Tagbanwa,
+       Tai_Le,   Tai_Tham,  Tai_Viet,  Takri,  Tamil,  Telugu,  Thaana,  Thai,
+       Tibetan, Tifinagh, Tirhuta, Ugaritic, Vai, Warang_Citi, Yi.
+
+
+CHARACTER CLASSES
+
+         [...]       positive character class
+         [^...]      negative character class
+         [x-y]       range (can be used for hex characters)
+         [[:xxx:]]   positive POSIX named set
+         [[:^xxx:]]  negative POSIX named set
+
+         alnum       alphanumeric
+         alpha       alphabetic
+         ascii       0-127
+         blank       space or tab
+         cntrl       control character
+         digit       decimal digit
+         graph       printing, excluding space
+         lower       lower case letter
+         print       printing, including space
+         punct       printing, excluding alphanumeric
+         space       white space
+         upper       upper case letter
+         word        same as \w
+         xdigit      hexadecimal digit
+
+       In PCRE2, POSIX character set names recognize only ASCII characters  by
+       default,  but  some of them use Unicode properties if PCRE2_UCP is set.
+       You can use \Q...\E inside a character class.
+
+
+QUANTIFIERS
+
+         ?           0 or 1, greedy
+         ?+          0 or 1, possessive
+         ??          0 or 1, lazy
+         *           0 or more, greedy
+         *+          0 or more, possessive
+         *?          0 or more, lazy
+         +           1 or more, greedy
+         ++          1 or more, possessive
+         +?          1 or more, lazy
+         {n}         exactly n
+         {n,m}       at least n, no more than m, greedy
+         {n,m}+      at least n, no more than m, possessive
+         {n,m}?      at least n, no more than m, lazy
+         {n,}        n or more, greedy
+         {n,}+       n or more, possessive
+         {n,}?       n or more, lazy
+
+
+ANCHORS AND SIMPLE ASSERTIONS
+
+         \b          word boundary
+         \B          not a word boundary
+         ^           start of subject
+                       also after an internal newline in multiline mode
+                       (after any newline if PCRE2_ALT_CIRCUMFLEX is set)
+         \A          start of subject
+         $           end of subject
+                       also before newline at end of subject
+                       also before internal newline in multiline mode
+         \Z          end of subject
+                       also before newline at end of subject
+         \z          end of subject
+         \G          first matching position in subject
+
+
+MATCH POINT RESET
+
+         \K          reset start of match
+
+       \K is honoured in positive assertions, but ignored in negative ones.
+
+
+ALTERNATION
+
+         expr|expr|expr...
+
+
+CAPTURING
+
+         (...)           capturing group
+         (?<name>...)    named capturing group (Perl)
+         (?'name'...)    named capturing group (Perl)
+         (?P<name>...)   named capturing group (Python)
+         (?:...)         non-capturing group
+         (?|...)         non-capturing group; reset group numbers for
+                          capturing groups in each alternative
+
+
+ATOMIC GROUPS
+
+         (?>...)         atomic, non-capturing group
+
+
+COMMENT
+
+         (?#....)        comment (not nestable)
+
+
+OPTION SETTING
+
+         (?i)            caseless
+         (?J)            allow duplicate names
+         (?m)            multiline
+         (?s)            single line (dotall)
+         (?U)            default ungreedy (lazy)
+         (?x)            extended (ignore white space)
+         (?-...)         unset option(s)
+
+       The following are recognized only at the very start  of  a  pattern  or
+       after  one  of the newline or \R options with similar syntax. More than
+       one of them may appear.
+
+         (*LIMIT_MATCH=d) set the match limit to d (decimal number)
+         (*LIMIT_RECURSION=d) set the recursion limit to d (decimal number)
+         (*NOTEMPTY)     set PCRE2_NOTEMPTY when matching
+         (*NOTEMPTY_ATSTART) set PCRE2_NOTEMPTY_ATSTART when matching
+         (*NO_AUTO_POSSESS) no auto-possessification (PCRE2_NO_AUTO_POSSESS)
+         (*NO_DOTSTAR_ANCHOR) no .* anchoring (PCRE2_NO_DOTSTAR_ANCHOR)
+         (*NO_JIT)       disable JIT optimization
+         (*NO_START_OPT) no start-match optimization (PCRE2_NO_START_OPTIMIZE)
+         (*UTF)          set appropriate UTF mode for the library in use
+         (*UCP)          set PCRE2_UCP (use Unicode properties for \d etc)
+
+       Note that LIMIT_MATCH and LIMIT_RECURSION can only reduce the value  of
+       the  limits  set by the caller of pcre2_match(), not increase them. The
+       application can lock out the use of (*UTF) and (*UCP)  by  setting  the
+       PCRE2_NEVER_UTF  or  PCRE2_NEVER_UCP  options, respectively, at compile
+       time.
+
+
+NEWLINE CONVENTION
+
+       These are recognized only at the very start of  the  pattern  or  after
+       option settings with a similar syntax.
+
+         (*CR)           carriage return only
+         (*LF)           linefeed only
+         (*CRLF)         carriage return followed by linefeed
+         (*ANYCRLF)      all three of the above
+         (*ANY)          any Unicode newline sequence
+
+
+WHAT \R MATCHES
+
+       These  are  recognized  only  at the very start of the pattern or after
+       option setting with a similar syntax.
+
+         (*BSR_ANYCRLF)  CR, LF, or CRLF
+         (*BSR_UNICODE)  any Unicode newline sequence
+
+
+LOOKAHEAD AND LOOKBEHIND ASSERTIONS
+
+         (?=...)         positive look ahead
+         (?!...)         negative look ahead
+         (?<=...)        positive look behind
+         (?<!...)        negative look behind
+
+       Each top-level branch of a look behind must be of a fixed length.
+
+
+BACKREFERENCES
+
+         \n              reference by number (can be ambiguous)
+         \gn             reference by number
+         \g{n}           reference by number
+         \g{-n}          relative reference by number
+         \k<name>        reference by name (Perl)
+         \k'name'        reference by name (Perl)
+         \g{name}        reference by name (Perl)
+         \k{name}        reference by name (.NET)
+         (?P=name)       reference by name (Python)
+
+
+SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)
+
+         (?R)            recurse whole pattern
+         (?n)            call subpattern by absolute number
+         (?+n)           call subpattern by relative number
+         (?-n)           call subpattern by relative number
+         (?&name)        call subpattern by name (Perl)
+         (?P>name)       call subpattern by name (Python)
+         \g<name>        call subpattern by name (Oniguruma)
+         \g'name'        call subpattern by name (Oniguruma)
+         \g<n>           call subpattern by absolute number (Oniguruma)
+         \g'n'           call subpattern by absolute number (Oniguruma)
+         \g<+n>          call subpattern by relative number (PCRE2 extension)
+         \g'+n'          call subpattern by relative number (PCRE2 extension)
+         \g<-n>          call subpattern by relative number (PCRE2 extension)
+         \g'-n'          call subpattern by relative number (PCRE2 extension)
+
+
+CONDITIONAL PATTERNS
+
+         (?(condition)yes-pattern)
+         (?(condition)yes-pattern|no-pattern)
+
+         (?(n)               absolute reference condition
+         (?(+n)              relative reference condition
+         (?(-n)              relative reference condition
+         (?(<name>)          named reference condition (Perl)
+         (?('name')          named reference condition (Perl)
+         (?(name)            named reference condition (PCRE2)
+         (?(R)               overall recursion condition
+         (?(Rn)              specific group recursion condition
+         (?(R&name)          specific recursion condition
+         (?(DEFINE)          define subpattern for reference
+         (?(VERSION[>]=n.m)  test PCRE2 version
+         (?(assert)          assertion condition
+
+
+BACKTRACKING CONTROL
+
+       The following act immediately they are reached:
+
+         (*ACCEPT)       force successful match
+         (*FAIL)         force backtrack; synonym (*F)
+         (*MARK:NAME)    set name to be passed back; synonym (*:NAME)
+
+       The following act only when a subsequent match failure causes  a  back-
+       track to reach them. They all force a match failure, but they differ in
+       what happens afterwards. Those that advance the start-of-match point do
+       so only if the pattern is not anchored.
+
+         (*COMMIT)       overall failure, no advance of starting point
+         (*PRUNE)        advance to next starting character
+         (*PRUNE:NAME)   equivalent to (*MARK:NAME)(*PRUNE)
+         (*SKIP)         advance to current matching position
+         (*SKIP:NAME)    advance to position corresponding to an earlier
+                         (*MARK:NAME); if not found, the (*SKIP) is ignored
+         (*THEN)         local failure, backtrack to next alternation
+         (*THEN:NAME)    equivalent to (*MARK:NAME)(*THEN)
+
+
+CALLOUTS
+
+         (?C)            callout (assumed number 0)
+         (?Cn)           callout with numerical data n
+         (?C"text")      callout with string data
+
+       The allowed string delimiters are ` ' " ^ % # $ (which are the same for
+       the start and the end), and the starting delimiter { matched  with  the
+       ending  delimiter  }. To encode the ending delimiter within the string,
+       double it.
+
+
+SEE ALSO
+
+       pcre2pattern(3),   pcre2api(3),   pcre2callout(3),    pcre2matching(3),
+       pcre2(3).
+
+
+AUTHOR
+
+       Philip Hazel
+       University Computing Service
+       Cambridge, England.
+
+
+REVISION
+
+       Last updated: 16 October 2015
+       Copyright (c) 1997-2015 University of Cambridge.
+------------------------------------------------------------------------------
+
+
+PCRE2UNICODE(3)            Library Functions Manual            PCRE2UNICODE(3)
+
+
+
+NAME
+       PCRE - Perl-compatible regular expressions (revised API)
+
+UNICODE AND UTF SUPPORT
+
+       When PCRE2 is built with Unicode support (which is the default), it has
+       knowledge of Unicode character properties and can process text  strings
+       in  UTF-8, UTF-16, or UTF-32 format (depending on the code unit width).
+       However, by default, PCRE2 assumes that one code unit is one character.
+       To  process  a  pattern  as a UTF string, where a character may require
+       more than one  code  unit,  you  must  call  pcre2_compile()  with  the
+       PCRE2_UTF  option  flag,  or  the  pattern must start with the sequence
+       (*UTF). When either of these is the case, both the pattern and any sub-
+       ject  strings  that  are  matched against it are treated as UTF strings
+       instead of strings of individual one-code-unit characters.
+
+       If you do not need Unicode support you can build PCRE2 without  it,  in
+       which case the library will be smaller.
+
+
+UNICODE PROPERTY SUPPORT
+
+       When  PCRE2 is built with Unicode support, the escape sequences \p{..},
+       \P{..}, and \X can be used. The Unicode properties that can  be  tested
+       are  limited to the general category properties such as Lu for an upper
+       case letter or Nd for a decimal number, the Unicode script  names  such
+       as Arabic or Han, and the derived properties Any and L&. Full lists are
+       given in the pcre2pattern and pcre2syntax documentation. Only the short
+       names  for  properties are supported. For example, \p{L} matches a let-
+       ter. Its Perl synonym, \p{Letter}, is not supported.   Furthermore,  in
+       Perl,  many properties may optionally be prefixed by "Is", for compati-
+       bility with Perl 5.6. PCRE does not support this.
+
+
+WIDE CHARACTERS AND UTF MODES
+
+       Codepoints less than 256 can be specified in patterns by either  braced
+       or unbraced hexadecimal escape sequences (for example, \x{b3} or \xb3).
+       Larger values have to use braced sequences. Unbraced octal code  points
+       up to \777 are also recognized; larger ones can be coded using \o{...}.
+
+       In  UTF modes, repeat quantifiers apply to complete UTF characters, not
+       to individual code units.
+
+       In UTF modes, the dot metacharacter matches one UTF  character  instead
+       of a single code unit.
+
+       The  escape  sequence  \C can be used to match a single code unit, in a
+       UTF mode, but its use can lead  to  some  strange  effects  because  it
+       breaks  up  multi-unit  characters  (see  the  description of \C in the
+       pcre2pattern documentation). The use of \C  is  not  supported  by  the
+       alternative  matching  function pcre2_dfa_match() when in UTF mode. Its
+       use provokes a match-time error. The JIT  optimization  also  does  not
+       support  \C  in  UTF  mode.  If JIT optimization is requested for a UTF
+       pattern that contains \C, it will not succeed, and so the matching will
+       be carried out by the normal interpretive function.
+
+       The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly test
+       characters of any code value, but,  by  default,  the  characters  that
+       PCRE2  recognizes as digits, spaces, or word characters remain the same
+       set as in non-UTF mode, all  with  code  points  less  than  256.  This
+       remains  true  even  when  PCRE2  is  built to include Unicode support,
+       because to do otherwise would slow down matching in many common  cases.
+       Note  that  this also applies to \b and \B, because they are defined in
+       terms of \w and \W. If you want to test for  a  wider  sense  of,  say,
+       "digit",  you  can  use explicit Unicode property tests such as \p{Nd}.
+       Alternatively, if you set the PCRE2_UCP option, the way that the  char-
+       acter  escapes  work  is changed so that Unicode properties are used to
+       determine which characters match. There are more details in the section
+       on generic character types in the pcre2pattern documentation.
+
+       Similarly,  characters that match the POSIX named character classes are
+       all low-valued characters, unless the PCRE2_UCP option is set.
+
+       However, the special  horizontal  and  vertical  white  space  matching
+       escapes (\h, \H, \v, and \V) do match all the appropriate Unicode char-
+       acters, whether or not PCRE2_UCP is set.
+
+       Case-insensitive matching in UTF mode makes use of Unicode  properties.
+       A  few  Unicode characters such as Greek sigma have more than two code-
+       points that are case-equivalent, and these are treated as such.
+
+
+VALIDITY OF UTF STRINGS
+
+       When the PCRE2_UTF option is set, the strings passed  as  patterns  and
+       subjects are (by default) checked for validity on entry to the relevant
+       functions.  If an invalid UTF string is passed, an negative error  code
+       is  returned.  The  code  unit offset to the offending character can be
+       extracted from the match data block by  calling  pcre2_get_startchar(),
+       which is used for this purpose after a UTF error.
+
+       UTF-16 and UTF-32 strings can indicate their endianness by special code
+       knows as a byte-order mark (BOM). The PCRE2  functions  do  not  handle
+       this, expecting strings to be in host byte order.
+
+       A UTF string is checked before any other processing takes place. In the
+       case of pcre2_match()  and  pcre2_dfa_match()  calls  with  a  non-zero
+       starting  offset, the check is applied only to that part of the subject
+       that could be inspected during matching, and there is a check that  the
+       starting  offset points to the first code unit of a character or to the
+       end of the subject. If there are no lookbehind assertions in  the  pat-
+       tern,  the check starts at the starting offset. Otherwise, it starts at
+       the length of the longest lookbehind before the starting offset, or  at
+       the  start  of the subject if there are not that many characters before
+       the starting offset. Note that the sequences \b and \B are  one-charac-
+       ter lookbehinds.
+
+       In  addition  to checking the format of the string, there is a check to
+       ensure that all code points lie in the range U+0 to U+10FFFF, excluding
+       the  surrogate  area. The so-called "non-character" code points are not
+       excluded because Unicode corrigendum #9 makes it clear that they should
+       not be.
+
+       Characters  in  the "Surrogate Area" of Unicode are reserved for use by
+       UTF-16, where they are used in pairs to encode code points with  values
+       greater  than  0xFFFF. The code points that are encoded by UTF-16 pairs
+       are available independently in the  UTF-8  and  UTF-32  encodings.  (In
+       other  words,  the  whole  surrogate  thing is a fudge for UTF-16 which
+       unfortunately messes up UTF-8 and UTF-32.)
+
+       In some situations, you may already know that your strings  are  valid,
+       and  therefore  want  to  skip these checks in order to improve perfor-
+       mance, for example in the case of a long subject string that  is  being
+       scanned  repeatedly.   If you set the PCRE2_NO_UTF_CHECK option at com-
+       pile time or at match time, PCRE2 assumes that the pattern  or  subject
+       it is given (respectively) contains only valid UTF code unit sequences.
+
+       Passing  PCRE2_NO_UTF_CHECK  to pcre2_compile() just disables the check
+       for the pattern; it does not also apply to subject strings. If you want
+       to  disable the check for a subject string you must pass this option to
+       pcre2_match() or pcre2_dfa_match().
+
+       If you pass an invalid UTF string when PCRE2_NO_UTF_CHECK is  set,  the
+       result is undefined and your program may crash or loop indefinitely.
+
+   Errors in UTF-8 strings
+
+       The following negative error codes are given for invalid UTF-8 strings:
+
+         PCRE2_ERROR_UTF8_ERR1
+         PCRE2_ERROR_UTF8_ERR2
+         PCRE2_ERROR_UTF8_ERR3
+         PCRE2_ERROR_UTF8_ERR4
+         PCRE2_ERROR_UTF8_ERR5
+
+       The  string  ends  with a truncated UTF-8 character; the code specifies
+       how many bytes are missing (1 to 5). Although RFC 3629 restricts  UTF-8
+       characters  to  be  no longer than 4 bytes, the encoding scheme (origi-
+       nally defined by RFC 2279) allows for  up  to  6  bytes,  and  this  is
+       checked first; hence the possibility of 4 or 5 missing bytes.
+
+         PCRE2_ERROR_UTF8_ERR6
+         PCRE2_ERROR_UTF8_ERR7
+         PCRE2_ERROR_UTF8_ERR8
+         PCRE2_ERROR_UTF8_ERR9
+         PCRE2_ERROR_UTF8_ERR10
+
+       The two most significant bits of the 2nd, 3rd, 4th, 5th, or 6th byte of
+       the character do not have the binary value 0b10 (that  is,  either  the
+       most significant bit is 0, or the next bit is 1).
+
+         PCRE2_ERROR_UTF8_ERR11
+         PCRE2_ERROR_UTF8_ERR12
+
+       A  character that is valid by the RFC 2279 rules is either 5 or 6 bytes
+       long; these code points are excluded by RFC 3629.
+
+         PCRE2_ERROR_UTF8_ERR13
+
+       A 4-byte character has a value greater than 0x10fff; these code  points
+       are excluded by RFC 3629.
+
+         PCRE2_ERROR_UTF8_ERR14
+
+       A  3-byte  character  has  a  value in the range 0xd800 to 0xdfff; this
+       range of code points are reserved by RFC 3629 for use with UTF-16,  and
+       so are excluded from UTF-8.
+
+         PCRE2_ERROR_UTF8_ERR15
+         PCRE2_ERROR_UTF8_ERR16
+         PCRE2_ERROR_UTF8_ERR17
+         PCRE2_ERROR_UTF8_ERR18
+         PCRE2_ERROR_UTF8_ERR19
+
+       A  2-, 3-, 4-, 5-, or 6-byte character is "overlong", that is, it codes
+       for a value that can be represented by fewer bytes, which  is  invalid.
+       For  example,  the two bytes 0xc0, 0xae give the value 0x2e, whose cor-
+       rect coding uses just one byte.
+
+         PCRE2_ERROR_UTF8_ERR20
+
+       The two most significant bits of the first byte of a character have the
+       binary  value 0b10 (that is, the most significant bit is 1 and the sec-
+       ond is 0). Such a byte can only validly occur as the second  or  subse-
+       quent byte of a multi-byte character.
+
+         PCRE2_ERROR_UTF8_ERR21
+
+       The  first byte of a character has the value 0xfe or 0xff. These values
+       can never occur in a valid UTF-8 string.
+
+   Errors in UTF-16 strings
+
+       The following  negative  error  codes  are  given  for  invalid  UTF-16
+       strings:
+
+         PCRE_UTF16_ERR1  Missing low surrogate at end of string
+         PCRE_UTF16_ERR2  Invalid low surrogate follows high surrogate
+         PCRE_UTF16_ERR3  Isolated low surrogate
+
+
+   Errors in UTF-32 strings
+
+       The  following  negative  error  codes  are  given  for  invalid UTF-32
+       strings:
+
+         PCRE_UTF32_ERR1  Surrogate character (range from 0xd800 to 0xdfff)
+         PCRE_UTF32_ERR2  Code point is greater than 0x10ffff
+
+
+AUTHOR
+
+       Philip Hazel
+       University Computing Service
+       Cambridge, England.
+
+
+REVISION
+
+       Last updated: 16 October 2015
+       Copyright (c) 1997-2015 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
index 3a1c7d8853ef32d7e85930fb3e708ed99c84a0f5..5127081e38f536ba63492ec48e8b4e5e0c7c40e6 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_CODE_FREE 3 "21 October 2014" "PCRE2 10.00"
+.TH PCRE2_CODE_FREE 3 "29 July 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -7,7 +7,7 @@ PCRE2 - Perl-compatible regular expressions (revised API)
 .B #include <pcre2.h>
 .PP
 .nf
-.B pcre2_code_free(pcre2_code *\fIcode\fP);
+.B void pcre2_code_free(pcre2_code *\fIcode\fP);
 .fi
 .
 .SH DESCRIPTION
index 2a92f0bcb737b41052d30665cf9fc8c60fd9c1b9..3b0a29e1932f80a2ce6382a7a74d785978f2bf26 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_MATCH_DATA_CREATE 3 "22 October 2014" "PCRE2 10.00"
+.TH PCRE2_MATCH_DATA_CREATE 3 "29 July 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -7,7 +7,7 @@ PCRE2 - Perl-compatible regular expressions (revised API)
 .B #include <pcre2.h>
 .PP
 .nf
-.B pcre2_match_data_create(uint32_t \fIovecsize\fP,
+.B pcre2_match_data *pcre2_match_data_create(uint32_t \fIovecsize\fP,
 .B "  pcre2_general_context *\fIgcontext\fP);"
 .fi
 .
index 83267d6f7650d3bfeb3b5b5b536810be695191b3..60bf77cc67db438ee86c1639381043d46b893b17 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_MATCH_DATA_CREATE_FROM_PATTERN 3 "24 October 2014" "PCRE2 10.00"
+.TH PCRE2_MATCH_DATA_CREATE_FROM_PATTERN 3 "29 July 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -7,8 +7,8 @@ PCRE2 - Perl-compatible regular expressions (revised API)
 .B #include <pcre2.h>
 .PP
 .nf
-.B pcre2_match_data_create_from_pattern(const pcre2_code *\fIcode\fP,
-.B "  pcre2_general_context *\fIgcontext\fP);"
+.B pcre2_match_data *pcre2_match_data_create_from_pattern(
+.B "  const pcre2_code *\fIcode\fP, pcre2_general_context *\fIgcontext\fP);"
 .fi
 .
 .SH DESCRIPTION
index 8424e6f5819d14e44cd7e1aae5361f8b1afa28c8..575840bbf36041798590b0a9076849ab866d4d5c 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_PATTERN_INFO 3 "01 December 2014" "PCRE2 10.00"
+.TH PCRE2_PATTERN_INFO 3 "21 November 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -30,19 +30,20 @@ request are as follows:
                                PCRE2_BSR_ANYCRLF: CR, LF, or CRLF only
   PCRE2_INFO_CAPTURECOUNT    Number of capturing subpatterns
   PCRE2_INFO_FIRSTBITMAP     Bitmap of first code units, or NULL
-  PCRE2_INFO_FIRSTCODEUNIT   First code unit when type is 1
   PCRE2_INFO_FIRSTCODETYPE   Type of start-of-match information
                                0 nothing set
                                1 first code unit is set
                                2 start of string or after newline
+  PCRE2_INFO_FIRSTCODEUNIT   First code unit when type is 1
+  PCRE2_INFO_HASBACKSLASHC   Return 1 if pattern contains \eC
   PCRE2_INFO_HASCRORLF       Return 1 if explicit CR or LF matches
                                exist in the pattern
   PCRE2_INFO_JCHANGED        Return 1 if (?J) or (?-J) was used
   PCRE2_INFO_JITSIZE         Size of JIT compiled code, or 0
-  PCRE2_INFO_LASTCODEUNIT    Last code unit when type is 1
   PCRE2_INFO_LASTCODETYPE    Type of must-be-present information
                                0 nothing set
                                1 code unit is set
+  PCRE2_INFO_LASTCODEUNIT    Last code unit when type is 1
   PCRE2_INFO_MATCHEMPTY      1 if the pattern can match an
                                empty string, 0 otherwise
   PCRE2_INFO_MATCHLIMIT      Match limit if set,
@@ -50,8 +51,8 @@ request are as follows:
   PCRE2_INFO_MAXLOOKBEHIND   Length (in characters) of the longest
                                lookbehind assertion
   PCRE2_INFO_MINLENGTH       Lower bound length of matching strings
-  PCRE2_INFO_NAMEENTRYSIZE   Size of name table entries
   PCRE2_INFO_NAMECOUNT       Number of named subpatterns
+  PCRE2_INFO_NAMEENTRYSIZE   Size of name table entries
   PCRE2_INFO_NAMETABLE       Pointer to name table
   PCRE2_CONFIG_NEWLINE       Code for the newline sequence:
                                PCRE2_NEWLINE_CR
index b362fcdff5a793f5bddd0d2f4215d64f185fc029..57304a59cd55312df098c911eab6637e88ff91ce 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_SERIALIZE_DECODE 3 "19 January 2015" "PCRE2 10.10"
+.TH PCRE2_SERIALIZE_DECODE 3 "02 September 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -8,7 +8,7 @@ PCRE2 - Perl-compatible regular expressions (revised API)
 .PP
 .nf
 .B int32_t pcre2_serialize_decode(pcre2_code **\fIcodes\fP,
-.B "  int32_t \fInumber_of_codes\fP, const uint32_t *\fIbytes\fP,"
+.B "  int32_t \fInumber_of_codes\fP, const uint8_t *\fIbytes\fP,"
 .B "  pcre2_general_context *\fIgcontext\fP);"
 .fi
 .
index 57077eb1ed55b757c5cd8c61570b277bf27977f1..9c29633187e7abbcb95c1761d14157387f24e28c 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_SERIALIZE_ENCODE 3 "19 January 2015" "PCRE2 10.10"
+.TH PCRE2_SERIALIZE_ENCODE 3 "02 September 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -7,8 +7,8 @@ PCRE2 - Perl-compatible regular expressions (revised API)
 .B #include <pcre2.h>
 .PP
 .nf
-.B int32_t pcre2_serialize_encode(pcre2_code **\fIcodes\fP,
-.B "  int32_t \fInumber_of_codes\fP, uint32_t **\fIserialized_bytes\fP,"
+.B int32_t pcre2_serialize_encode(const pcre2_code **\fIcodes\fP,
+.B "  int32_t \fInumber_of_codes\fP, uint8_t **\fIserialized_bytes\fP,"
 .B "  PCRE2_SIZE *\fIserialized_size\fP, pcre2_general_context *\fIgcontext\fP);"
 .fi
 .
diff --git a/doc/pcre2_set_offset_limit.3 b/doc/pcre2_set_offset_limit.3
new file mode 100644 (file)
index 0000000..20fa104
--- /dev/null
@@ -0,0 +1,28 @@
+.TH PCRE2_SET_OFFSET_LIMIT 3 "22 September 2015" "PCRE2 10.21"
+.SH NAME
+PCRE2 - Perl-compatible regular expressions (revised API)
+.SH SYNOPSIS
+.rs
+.sp
+.B #include <pcre2.h>
+.PP
+.nf
+.B int pcre2_set_offset_limit(pcre2_match_context *\fImcontext\fP,
+.B "  PCRE2_SIZE \fIvalue\fP);"
+.fi
+.
+.SH DESCRIPTION
+.rs
+.sp
+This function sets the offset limit field in a match context. The result is
+always zero.
+.P
+There is a complete description of the PCRE2 native API in the
+.\" HREF
+\fBpcre2api\fP
+.\"
+page and a description of the POSIX API in the
+.\" HREF
+\fBpcre2posix\fP
+.\"
+page.
index edfcb0432e2e89be1ae8c15dbd14536f64dea44c..e69e0ccc04ef890f8e9662a14acd754b8fa85a72 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_SUBSTITUTE 3 "11 November 2014" "PCRE2 10.00"
+.TH PCRE2_SUBSTITUTE 3 "12 December 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -47,20 +47,25 @@ units, not characters, as is the contents of the variable pointed at by
 \fIoutlengthptr\fP, which is updated to the actual length of the new string.
 The options are:
 .sp
-  PCRE2_ANCHORED          Match only at the first position
-  PCRE2_NOTBOL            Subject string is not the beginning of a line
-  PCRE2_NOTEOL            Subject string is not the end of a line
-  PCRE2_NOTEMPTY          An empty string is not a valid match
-  PCRE2_NOTEMPTY_ATSTART  An empty string at the start of the subject
-                           is not a valid match
-  PCRE2_NO_UTF_CHECK      Do not check the subject or replacement for
-                           UTF validity (only relevant if PCRE2_UTF
-                           was set at compile time)
-  PCRE2_SUBSTITUTE_GLOBAL Replace all occurrences in the subject
+  PCRE2_ANCHORED             Match only at the first position
+  PCRE2_NOTBOL               Subject is not the beginning of a line
+  PCRE2_NOTEOL               Subject is not the end of a line
+  PCRE2_NOTEMPTY             An empty string is not a valid match
+  PCRE2_NOTEMPTY_ATSTART     An empty string at the start of the
+                              subject is not a valid match
+  PCRE2_NO_UTF_CHECK         Do not check the subject or replacement
+                              for UTF validity (only relevant if
+                              PCRE2_UTF was set at compile time)
+  PCRE2_SUBSTITUTE_EXTENDED  Do extended replacement processing
+  PCRE2_SUBSTITUTE_GLOBAL    Replace all occurrences in the subject
+  PCRE2_SUBSTITUTE_OVERFLOW_LENGTH  If overflow, compute needed length
+  PCRE2_SUBSTITUTE_UNKNOWN_UNSET  Treat unknown group as unset
+  PCRE2_SUBSTITUTE_UNSET_EMPTY  Simple unset insert = empty string
 .sp
 The function returns the number of substitutions, which may be zero if there
 were no matches. The result can be greater than one only when
-PCRE2_SUBSTITUTE_GLOBAL is set.
+PCRE2_SUBSTITUTE_GLOBAL is set. In the event of an error, a negative error code
+is returned.
 .P
 There is a complete description of the PCRE2 native API in the
 .\" HREF
index 1147f89d4ad2c8c887437e00892d16c183105770..b29f7b0bcb35557bb50afea7d080e2d937951eca 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2API 3 "22 April 2015" "PCRE2 10.20"
+.TH PCRE2API 3 "16 December 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .sp
@@ -20,13 +20,13 @@ document for an overview of all the PCRE2 documentation.
 .B "  uint32_t \fIoptions\fP, int *\fIerrorcode\fP, PCRE2_SIZE *\fIerroroffset,\fP"
 .B "  pcre2_compile_context *\fIccontext\fP);"
 .sp
-.B pcre2_code_free(pcre2_code *\fIcode\fP);
+.B void pcre2_code_free(pcre2_code *\fIcode\fP);
 .sp
-.B pcre2_match_data_create(uint32_t \fIovecsize\fP,
+.B pcre2_match_data *pcre2_match_data_create(uint32_t \fIovecsize\fP,
 .B "  pcre2_general_context *\fIgcontext\fP);"
 .sp
-.B pcre2_match_data_create_from_pattern(const pcre2_code *\fIcode\fP,
-.B "  pcre2_general_context *\fIgcontext\fP);"
+.B pcre2_match_data *pcre2_match_data_create_from_pattern(
+.B "  const pcre2_code *\fIcode\fP, pcre2_general_context *\fIgcontext\fP);"
 .sp
 .B int pcre2_match(const pcre2_code *\fIcode\fP, PCRE2_SPTR \fIsubject\fP,
 .B "  PCRE2_SIZE \fIlength\fP, PCRE2_SIZE \fIstartoffset\fP,"
@@ -90,6 +90,9 @@ document for an overview of all the PCRE2 documentation.
 .B int pcre2_set_character_tables(pcre2_compile_context *\fIccontext\fP,
 .B "  const unsigned char *\fItables\fP);"
 .sp
+.B int pcre2_set_max_pattern_length(pcre2_compile_context *\fIccontext\fP,
+.B "  PCRE2_SIZE \fIvalue\fP);"
+.sp
 .B int pcre2_set_newline(pcre2_compile_context *\fIccontext\fP,
 .B "  uint32_t \fIvalue\fP);"
 .sp
@@ -120,6 +123,9 @@ document for an overview of all the PCRE2 documentation.
 .B int pcre2_set_match_limit(pcre2_match_context *\fImcontext\fP,
 .B "  uint32_t \fIvalue\fP);"
 .sp
+.B int pcre2_set_offset_limit(pcre2_match_context *\fImcontext\fP,
+.B "  PCRE2_SIZE \fIvalue\fP);"
+.sp
 .B int pcre2_set_recursion_limit(pcre2_match_context *\fImcontext\fP,
 .B "  uint32_t \fIvalue\fP);"
 .sp
@@ -210,11 +216,11 @@ document for an overview of all the PCRE2 documentation.
 .sp
 .nf
 .B int32_t pcre2_serialize_decode(pcre2_code **\fIcodes\fP,
-.B "  int32_t \fInumber_of_codes\fP, const uint32_t *\fIbytes\fP,"
+.B "  int32_t \fInumber_of_codes\fP, const uint8_t *\fIbytes\fP,"
 .B "  pcre2_general_context *\fIgcontext\fP);"
 .sp
-.B int32_t pcre2_serialize_encode(pcre2_code **\fIcodes\fP,
-.B "  int32_t \fInumber_of_codes\fP, uint32_t **\fIserialized_bytes\fP,"
+.B int32_t pcre2_serialize_encode(const pcre2_code **\fIcodes\fP,
+.B "  int32_t \fInumber_of_codes\fP, uint8_t **\fIserialized_bytes\fP,"
 .B "  PCRE2_SIZE *\fIserialized_size\fP, pcre2_general_context *\fIgcontext\fP);"
 .sp
 .B void pcre2_serialize_free(uint8_t *\fIbytes\fP);
@@ -564,6 +570,7 @@ of the following compile-time parameters:
   PCRE2's character tables
   The newline character sequence
   The compile time nested parentheses limit
+  The maximum length of the pattern string
   An external function for stack checking
 .sp
 A compile context is also required if you are using custom memory management.
@@ -607,6 +614,17 @@ argument is a general context. This function builds a set of character tables
 in the current locale.
 .sp
 .nf
+.B int pcre2_set_max_pattern_length(pcre2_compile_context *\fIccontext\fP,
+.B "  PCRE2_SIZE \fIvalue\fP);"
+.fi
+.sp
+This sets a maximum length, in code units, for the pattern string that is to be
+compiled. If the pattern is longer, an error is generated. This facility is
+provided so that applications that accept patterns from external sources can
+limit their size. The default is the largest number that a PCRE2_SIZE variable
+can hold, which is effectively unlimited.
+.sp
+.nf
 .B int pcre2_set_newline(pcre2_compile_context *\fIccontext\fP,
 .B "  uint32_t \fIvalue\fP);"
 .fi
@@ -659,8 +677,9 @@ A match context is required if you want to change the default values of any
 of the following match-time parameters:
 .sp
   A callout function
-  The limit for calling \fImatch()\fP
-  The limit for calling \fImatch()\fP recursively
+  The offset limit for matching an unanchored pattern
+  The limit for calling \fBmatch()\fP (see below)
+  The limit for calling \fBmatch()\fP recursively
 .sp
 A match context is also required if you are using custom memory management.
 If none of these apply, just pass NULL as the context argument of
@@ -696,6 +715,32 @@ during a matching operation. Details are given in the
 documentation.
 .sp
 .nf
+.B int pcre2_set_offset_limit(pcre2_match_context *\fImcontext\fP,
+.B "  PCRE2_SIZE \fIvalue\fP);"
+.fi
+.sp
+The \fIoffset_limit\fP parameter limits how far an unanchored search can
+advance in the subject string. The default value is PCRE2_UNSET. The
+\fBpcre2_match()\fP and \fBpcre2_dfa_match()\fP functions return
+PCRE2_ERROR_NOMATCH if a match with a starting point before or at the given
+offset is not found. For example, if the pattern /abc/ is matched against
+"123abc" with an offset limit less than 3, the result is PCRE2_ERROR_NO_MATCH.
+A match can never be found if the \fIstartoffset\fP argument of
+\fBpcre2_match()\fP or \fBpcre2_dfa_match()\fP is greater than the offset
+limit.
+.P
+When using this facility, you must set PCRE2_USE_OFFSET_LIMIT when calling
+\fBpcre2_compile()\fP so that when JIT is in use, different code can be
+compiled. If a match is started with a non-default match limit when
+PCRE2_USE_OFFSET_LIMIT is not set, an error is generated.
+.P
+The offset limit facility can be used to track progress when searching large
+subject strings. See also the PCRE2_FIRSTLINE option, which requires a match to
+start within the first line of the subject. If this is set with an offset
+limit, a match must occur in the first line and also within the offset limit.
+In other words, whichever limit comes first is used.
+.sp
+.nf
 .B int pcre2_set_match_limit(pcre2_match_context *\fImcontext\fP,
 .B "  uint32_t \fIvalue\fP);"
 .fi
@@ -905,7 +950,7 @@ The \fIwhere\fP argument should point to a buffer that is at least 24 code
 units long. (The exact length required can be found by calling
 \fBpcre2_config()\fP with \fBwhere\fP set to NULL.) If PCRE2 has been compiled
 without Unicode support, the buffer is filled with the text "Unicode not
-supported". Otherwise, the Unicode version string (for example, "7.0.0") is
+supported". Otherwise, the Unicode version string (for example, "8.0.0") is
 inserted. The number of code units used is returned. This is the length of the
 string plus one unit for the terminating zero.
 .sp
@@ -933,7 +978,7 @@ zero.
 .B "  uint32_t \fIoptions\fP, int *\fIerrorcode\fP, PCRE2_SIZE *\fIerroroffset,\fP"
 .B "  pcre2_compile_context *\fIccontext\fP);"
 .sp
-.B pcre2_code_free(pcre2_code *\fIcode\fP);
+.B void pcre2_code_free(pcre2_code *\fIcode\fP);
 .fi
 .P
 The \fBpcre2_compile()\fP function compiles a pattern into an internal form.
@@ -1052,6 +1097,18 @@ after any internal newline. However, it does not match after a newline at the
 end of the subject, for compatibility with Perl. If you want a multiline
 circumflex also to match after a terminating newline, you must set
 PCRE2_ALT_CIRCUMFLEX.
+.sp
+  PCRE2_ALT_VERBNAMES
+.sp
+By default, for compatibility with Perl, the name in any verb sequence such as
+(*MARK:NAME) is any sequence of characters that does not include a closing
+parenthesis. The name is not processed in any way, and it is not possible to
+include a closing parenthesis in the name. However, if the PCRE2_ALT_VERBNAMES
+option is set, normal backslash processing is applied to verb names and only an
+unescaped closing parenthesis terminates the name. A closing parenthesis can be
+included in a name either as \e) or between \eQ and \eE. If the PCRE2_EXTENDED
+option is set, unescaped whitespace in verb names is skipped and #-comments are
+recognized, exactly as in the rest of the pattern.
 .sp
   PCRE2_AUTO_CALLOUT
 .sp
@@ -1130,7 +1187,10 @@ built.
 .sp
 If this option is set, an unanchored pattern is required to match before or at
 the first newline in the subject string, though the matched text may continue
-over the newline.
+over the newline. See also PCRE2_USE_OFFSET_LIMIT, which provides a more
+general limiting facility. If PCRE2_FIRSTLINE is set with an offset limit, a
+match must occur in the first line and also within the offset limit. In other
+words, whichever limit comes first is used.
 .sp
   PCRE2_MATCH_UNSET_BACKREF
 .sp
@@ -1168,7 +1228,8 @@ This option locks out the use of \eC in the pattern that is being compiled.
 This escape can cause unpredictable behaviour in UTF-8 or UTF-16 modes, because
 it may leave the current matching point in the middle of a multi-code-unit
 character. This option may be useful in applications that process patterns from
-external sources.
+external sources. Note that there is also a build-time option that permanently
+locks out the use of \eC.
 .sp
   PCRE2_NEVER_UCP
 .sp
@@ -1323,6 +1384,20 @@ support.
 This option inverts the "greediness" of the quantifiers so that they are not
 greedy by default, but become greedy if followed by "?". It is not compatible
 with Perl. It can also be set by a (?U) option setting within the pattern.
+.sp
+  PCRE2_USE_OFFSET_LIMIT
+.sp
+This option must be set for \fBpcre2_compile()\fP if
+\fBpcre2_set_offset_limit()\fP is going to be used to set a non-default offset
+limit in a match context for matches that use this pattern. An error is
+generated if an offset limit is set without this option. For more details, see
+the description of \fBpcre2_set_offset_limit()\fP in the
+.\" HTML <a href="#matchcontext">
+.\" </a>
+section
+.\"
+that describes match contexts. See also the PCRE2_FIRSTLINE
+option above.
 .sp
   PCRE2_UTF
 .sp
@@ -1490,11 +1565,10 @@ are as follows:
 Return a copy of the pattern's options. The third argument should point to a
 \fBuint32_t\fP variable. PCRE2_INFO_ARGOPTIONS returns exactly the options that
 were passed to \fBpcre2_compile()\fP, whereas PCRE2_INFO_ALLOPTIONS returns
-the compile options as modified by any top-level option settings at the start
-of the pattern itself. In other words, they are the options that will be in
-force when matching starts. For example, if the pattern /(?im)abc(?-i)d/ is
-compiled with the PCRE2_EXTENDED option, the result is PCRE2_CASELESS,
-PCRE2_MULTILINE, and PCRE2_EXTENDED.
+the compile options as modified by any top-level option settings such as (*UTF)
+at the start of the pattern itself. For example, if the pattern /(*UTF)abc/ is
+compiled with the PCRE2_EXTENDED option, the result is PCRE2_EXTENDED and
+PCRE2_UTF.
 .P
 A pattern compiled without PCRE2_ANCHORED is automatically anchored by PCRE2 if
 the first significant item in every top-level branch is one of the following:
@@ -1537,17 +1611,27 @@ matches only CR, LF, or CRLF.
 .sp
   PCRE2_INFO_CAPTURECOUNT
 .sp
-Return the number of capturing subpatterns in the pattern. The third argument
-should point to an \fBuint32_t\fP variable.
+Return the highest capturing subpattern number in the pattern. In patterns
+where (?| is not used, this is also the total number of capturing subpatterns.
+The third argument should point to an \fBuint32_t\fP variable.
+.sp
+  PCRE2_INFO_FIRSTBITMAP
+.sp
+In the absence of a single first code unit for a non-anchored pattern,
+\fBpcre2_compile()\fP may construct a 256-bit table that defines a fixed set of
+values for the first code unit in any match. For example, a pattern that starts
+with [abc] results in a table with three bits set. When code unit values
+greater than 255 are supported, the flag bit for 255 means "any code unit of
+value 255 or above". If such a table was constructed, a pointer to it is
+returned. Otherwise NULL is returned. The third argument should point to an
+\fBconst uint8_t *\fP variable.
 .sp
   PCRE2_INFO_FIRSTCODETYPE
 .sp
 Return information about the first code unit of any matched string, for a
 non-anchored pattern. The third argument should point to an \fBuint32_t\fP
-variable.
-.P
-If there is a fixed first value, for example, the letter "c" from a pattern
-such as (cat|cow|coyote), 1 is returned, and the character value can be
+variable. If there is a fixed first value, for example, the letter "c" from a
+pattern such as (cat|cow|coyote), 1 is returned, and the character value can be
 retrieved using PCRE2_INFO_FIRSTCODEUNIT. If there is no fixed first value, but
 it is known that a match can occur only at the start of the subject or
 following a newline in the subject, 2 is returned. Otherwise, and for anchored
@@ -1562,16 +1646,10 @@ value is always less than 256. In the 16-bit library the value can be up to
 0xffff. In the 32-bit library in UTF-32 mode the value can be up to 0x10ffff,
 and up to 0xffffffff when not using UTF-32 mode.
 .sp
-  PCRE2_INFO_FIRSTBITMAP
+  PCRE2_INFO_HASBACKSLASHC
 .sp
-In the absence of a single first code unit for a non-anchored pattern,
-\fBpcre2_compile()\fP may construct a 256-bit table that defines a fixed set of
-values for the first code unit in any match. For example, a pattern that starts
-with [abc] results in a table with three bits set. When code unit values
-greater than 255 are supported, the flag bit for 255 means "any code unit of
-value 255 or above". If such a table was constructed, a pointer to it is
-returned. Otherwise NULL is returned. The third argument should point to an
-\fBconst uint8_t *\fP variable.
+Return 1 if the pattern contains any instances of \eC, otherwise 0. The third
+argument should point to an \fBuint32_t\fP variable.
 .sp
   PCRE2_INFO_HASCRORLF
 .sp
@@ -1597,12 +1675,10 @@ Returns 1 if there is a rightmost literal code unit that must exist in any
 matched string, other than at its start. The third argument should  point to an
 \fBuint32_t\fP variable. If there is no such value, 0 is returned. When 1 is
 returned, the code unit value itself can be retrieved using
-PCRE2_INFO_LASTCODEUNIT.
-.P
-For anchored patterns, a last literal value is recorded only if it follows
-something of variable length. For example, for the pattern /^a\ed+z\ed+/ the
-returned value is 1 (with "z" returned from PCRE2_INFO_LASTCODEUNIT), but for
-/^a\edz\ed/ the returned value is 0.
+PCRE2_INFO_LASTCODEUNIT. For anchored patterns, a last literal value is
+recorded only if it follows something of variable length. For example, for the
+pattern /^a\ed+z\ed+/ the returned value is 1 (with "z" returned from
+PCRE2_INFO_LASTCODEUNIT), but for /^a\edz\ed/ the returned value is 0.
 .sp
   PCRE2_INFO_LASTCODEUNIT
 .sp
@@ -1613,8 +1689,11 @@ value, 0 is returned.
 .sp
   PCRE2_INFO_MATCHEMPTY
 .sp
-Return 1 if the pattern can match an empty string, otherwise 0. The third
-argument should point to an \fBuint32_t\fP variable.
+Return 1 if the pattern might match an empty string, otherwise 0. The third
+argument should point to an \fBuint32_t\fP variable. When a pattern contains
+recursive subroutine calls it is not always possible to determine whether or
+not it can match an empty string. PCRE2 takes a cautious approach and returns 1
+in such cases.
 .sp
   PCRE2_INFO_MATCHLIMIT
 .sp
@@ -1788,11 +1867,11 @@ documentation.
 .rs
 .sp
 .nf
-.B pcre2_match_data_create(uint32_t \fIovecsize\fP,
+.B pcre2_match_data *pcre2_match_data_create(uint32_t \fIovecsize\fP,
 .B "  pcre2_general_context *\fIgcontext\fP);"
 .sp
-.B pcre2_match_data_create_from_pattern(const pcre2_code *\fIcode\fP,
-.B "  pcre2_general_context *\fIgcontext\fP);"
+.B pcre2_match_data *pcre2_match_data_create_from_pattern(
+.B "  const pcre2_code *\fIcode\fP, pcre2_general_context *\fIgcontext\fP);"
 .sp
 .B void pcre2_match_data_free(pcre2_match_data *\fImatch_data\fP);
 .fi
@@ -2022,12 +2101,19 @@ If the pattern is anchored, such a match can occur only if the pattern contains
 .sp
 When PCRE2_UTF is set at compile time, the validity of the subject as a UTF
 string is checked by default when \fBpcre2_match()\fP is subsequently called.
-The entire string is checked before any other processing takes place, and a
+If a non-zero starting offset is given, the check is applied only to that part
+of the subject that could be inspected during matching, and there is a check
+that the starting offset points to the first code unit of a character or to the
+end of the subject. If there are no lookbehind assertions in the pattern, the
+check starts at the starting offset. Otherwise, it starts at the length of the
+longest lookbehind before the starting offset, or at the start of the subject
+if there are not that many characters before the starting offset. Note that the
+sequences \eb and \eB are one-character lookbehinds.
+.P
+The check is carried out before any other processing takes place, and a
 negative error code is returned if the check fails. There are several UTF error
 codes for each code unit width, corresponding to different problems with the
-code unit sequence. The value of \fIstartoffset\fP is also checked, to ensure
-that it points to the start of a character or to the end of the subject. There
-are discussions about the validity of
+code unit sequence. There are discussions about the validity of
 .\" HTML <a href="pcre2unicode.html#utf8strings">
 .\" </a>
 UTF-8 strings,
@@ -2092,9 +2178,19 @@ standard convention for the operating system. The default can be overridden in
 a
 .\" HTML <a href="#compilecontext">
 .\" </a>
-compile context.
+compile context
+.\"
+by calling \fBpcre2_set_newline()\fP. It can also be overridden by starting a
+pattern string with, for example, (*CRLF), as described in the
+.\" HTML <a href="pcre2pattern.html#newlines">
+.\" </a>
+section on newline conventions
 .\"
-During matching, the newline choice affects the behaviour of the dot,
+in the
+.\" HREF
+\fBpcre2pattern\fP
+.\"
+page. During matching, the newline choice affects the behaviour of the dot,
 circumflex, and dollar metacharacters. It may also alter the way the match
 starting position is advanced after a match failure for an unanchored pattern.
 .P
@@ -2140,18 +2236,7 @@ that do not cause substrings to be captured. The \fBpcre2_pattern_info()\fP
 function can be used to find out how many capturing subpatterns there are in a
 compiled pattern.
 .P
-A successful match returns the overall matched string and any captured
-substrings to the caller via a vector of PCRE2_SIZE values. This is called the
-\fBovector\fP, and is contained within the
-.\" HTML <a href="#matchdatablock">
-.\" </a>
-match data block.
-.\"
-You can obtain direct access to the ovector by calling
-\fBpcre2_get_ovector_pointer()\fP to find its address, and
-\fBpcre2_get_ovector_count()\fP to find the number of pairs of values it
-contains. Alternatively, you can use the auxiliary functions for accessing
-captured substrings
+You can use auxiliary functions for accessing captured substrings
 .\" HTML <a href="#extractbynumber">
 .\" </a>
 by number
@@ -2159,9 +2244,20 @@ by number
 or
 .\" HTML <a href="#extractbyname">
 .\" </a>
-by name
+by name,
+.\"
+as described in sections below.
+.P
+Alternatively, you can make direct use of the vector of PCRE2_SIZE values,
+called the \fBovector\fP, which contains the offsets of captured strings. It is
+part of the
+.\" HTML <a href="#matchdatablock">
+.\" </a>
+match data block.
 .\"
-(see below).
+The function \fBpcre2_get_ovector_pointer()\fP returns the address of the
+ovector, and \fBpcre2_get_ovector_count()\fP returns the number of pairs of
+values it contains.
 .P
 Within the ovector, the first in each pair of values is set to the offset of
 the first code unit of a substring, and the second is set to the offset of the
@@ -2245,7 +2341,12 @@ After a successful match, a partial match (PCRE2_ERROR_PARTIAL), or a failure
 to match (PCRE2_ERROR_NOMATCH), a (*MARK) name may be available, and
 \fBpcre2_get_mark()\fP can be called. It returns a pointer to the
 zero-terminated name, which is within the compiled pattern. Otherwise NULL is
-returned. After a successful match, the (*MARK) name that is returned is the
+returned. The length of the (*MARK) name (excluding the terminating zero) is
+stored in the code unit that preceeds the name. You should use this instead of
+relying on the terminating zero if the (*MARK) name might contain a binary
+zero.
+.P
+After a successful match, the (*MARK) name that is returned is the
 last one encountered on the matching path through the pattern. After a "no
 match" or a partial match, the last encountered (*MARK) name is returned. For
 example, consider this pattern:
@@ -2264,7 +2365,7 @@ different to the value of \fIovector[0]\fP if the pattern contains the \eK
 escape sequence. After a partial match, however, this value is always the same
 as \fIovector[0]\fP because \eK does not affect the result of a partial match.
 .P
-After a UTF check failure, \fBpcre2_get_startchar()\fB can be used to obtain
+After a UTF check failure, \fBpcre2_get_startchar()\fP can be used to obtain
 the code unit offset of the invalid UTF character. Details are given in the
 .\" HREF
 \fBpcre2unicode\fP
@@ -2595,32 +2696,17 @@ same number causes an error at compile time.
 .B int pcre2_substitute(const pcre2_code *\fIcode\fP, PCRE2_SPTR \fIsubject\fP,
 .B "  PCRE2_SIZE \fIlength\fP, PCRE2_SIZE \fIstartoffset\fP,"
 .B "  uint32_t \fIoptions\fP, pcre2_match_data *\fImatch_data\fP,"
-.B "  pcre2_match_context *\fImcontext\fP, PCRE2_SPTR \fIreplacementzfP,"
+.B "  pcre2_match_context *\fImcontext\fP, PCRE2_SPTR \fIreplacement\fP,"
 .B "  PCRE2_SIZE \fIrlength\fP, PCRE2_UCHAR *\fIoutputbuffer\zfP,"
 .B "  PCRE2_SIZE *\fIoutlengthptr\fP);"
 .fi
+.P
 This function calls \fBpcre2_match()\fP and then makes a copy of the subject
 string in \fIoutputbuffer\fP, replacing the part that was matched with the
 \fIreplacement\fP string, whose length is supplied in \fBrlength\fP. This can
-be given as PCRE2_ZERO_TERMINATED for a zero-terminated string.
-.P
-In the replacement string, which is interpreted as a UTF string in UTF mode,
-and is checked for UTF validity unless the PCRE2_NO_UTF_CHECK option is set, a
-dollar character is an escape character that can specify the insertion of
-characters from capturing groups in the pattern. The following forms are
-recognized:
-.sp
-  $$      insert a dollar character
-  $<n>    insert the contents of group <n>
-  ${<n>}  insert the contents of group <n>
-.sp
-Either a group number or a group name can be given for <n>. Curly brackets are
-required only if the following character would be interpreted as part of the
-number or name. The number may be zero to include the entire matched string.
-For example, if the pattern a(b)c is matched with "=abc=" and the replacement
-string "+$1$0$1+", the result is "=+babcb+=". Group insertion is done by
-calling \fBpcre2_copy_byname()\fP or \fBpcre2_copy_bynumber()\fP as
-appropriate.
+be given as PCRE2_ZERO_TERMINATED for a zero-terminated string. Matches in
+which a \eK item in a lookahead in the pattern causes the match to end before
+it starts are not supported, and give rise to an error return.
 .P
 The first seven arguments of \fBpcre2_substitute()\fP are the same as for
 \fBpcre2_match()\fP, except that the partial matching options are not
@@ -2629,23 +2715,164 @@ data block is obtained and freed within this function, using memory management
 functions from the match context, if provided, or else those that were used to
 allocate memory for the compiled code.
 .P
-There is one additional option, PCRE2_SUBSTITUTE_GLOBAL, which causes the
-function to iterate over the subject string, replacing every matching
-substring. If this is not set, only the first matching substring is replaced.
-.P
 The \fIoutlengthptr\fP argument must point to a variable that contains the
-length, in code units, of the output buffer. It is updated to contain the
-length of the new string, excluding the trailing zero that is automatically
-added.
+length, in code units, of the output buffer. If the function is successful, the
+value is updated to contain the length of the new string, excluding the
+trailing zero that is automatically added.
+.P
+If the function is not successful, the value set via \fIoutlengthptr\fP depends
+on the type of error. For syntax errors in the replacement string, the value is
+the offset in the replacement string where the error was detected. For other
+errors, the value is PCRE2_UNSET by default. This includes the case of the
+output buffer being too small, unless PCRE2_SUBSTITUTE_OVERFLOW_LENGTH is set
+(see below), in which case the value is the minimum length needed, including
+space for the trailing zero. Note that in order to compute the required length,
+\fBpcre2_substitute()\fP has to simulate all the matching and copying, instead
+of giving an error return as soon as the buffer overflows. Note also that the
+length is in code units, not bytes.
 .P
-The function returns the number of replacements that were made. This may be
-zero if no matches were found, and is never greater than 1 unless
-PCRE2_SUBSTITUTE_GLOBAL is set. In the event of an error, a negative error code
-is returned. Except for PCRE2_ERROR_NOMATCH (which is never returned), any
-errors from \fBpcre2_match()\fP or the substring copying functions are passed
-straight back. PCRE2_ERROR_BADREPLACEMENT is returned for an invalid
-replacement string (unrecognized sequence following a dollar sign), and
-PCRE2_ERROR_NOMEMORY is returned if the output buffer is not big enough.
+In the replacement string, which is interpreted as a UTF string in UTF mode,
+and is checked for UTF validity unless the PCRE2_NO_UTF_CHECK option is set, a
+dollar character is an escape character that can specify the insertion of
+characters from capturing groups or (*MARK) items in the pattern. The following
+forms are always recognized:
+.sp
+  $$                  insert a dollar character
+  $<n> or ${<n>}      insert the contents of group <n>
+  $*MARK or ${*MARK}  insert the name of the last (*MARK) encountered
+.sp
+Either a group number or a group name can be given for <n>. Curly brackets are
+required only if the following character would be interpreted as part of the
+number or name. The number may be zero to include the entire matched string.
+For example, if the pattern a(b)c is matched with "=abc=" and the replacement
+string "+$1$0$1+", the result is "=+babcb+=".
+.P
+The facility for inserting a (*MARK) name can be used to perform simple
+simultaneous substitutions, as this \fBpcre2test\fP example shows:
+.sp
+  /(*:pear)apple|(*:orange)lemon/g,replace=${*MARK}
+      apple lemon
+   2: pear orange
+.sp
+As well as the usual options for \fBpcre2_match()\fP, a number of additional
+options can be set in the \fIoptions\fP argument.
+.P
+PCRE2_SUBSTITUTE_GLOBAL causes the function to iterate over the subject string,
+replacing every matching substring. If this is not set, only the first matching
+substring is replaced. If any matched substring has zero length, after the
+substitution has happened, an attempt to find a non-empty match at the same
+position is performed. If this is not successful, the current position is
+advanced by one character except when CRLF is a valid newline sequence and the
+next two characters are CR, LF. In this case, the current position is advanced
+by two characters.
+.P
+PCRE2_SUBSTITUTE_OVERFLOW_LENGTH changes what happens when the output buffer is
+too small. The default action is to return PCRE2_ERROR_NOMEMORY immediately. If
+this option is set, however, \fBpcre2_substitute()\fP continues to go through
+the motions of matching and substituting (without, of course, writing anything)
+in order to compute the size of buffer that is needed. This value is passed
+back via the \fIoutlengthptr\fP variable, with the result of the function still
+being PCRE2_ERROR_NOMEMORY.
+.P
+Passing a buffer size of zero is a permitted way of finding out how much memory
+is needed for given substitution. However, this does mean that the entire
+operation is carried out twice. Depending on the application, it may be more
+efficient to allocate a large buffer and free the excess afterwards, instead of
+using PCRE2_SUBSTITUTE_OVERFLOW_LENGTH.
+.P
+PCRE2_SUBSTITUTE_UNKNOWN_UNSET causes references to capturing groups that do
+not appear in the pattern to be treated as unset groups. This option should be
+used with care, because it means that a typo in a group name or number no
+longer causes the PCRE2_ERROR_NOSUBSTRING error.
+.P
+PCRE2_SUBSTITUTE_UNSET_EMPTY causes unset capturing groups (including unknown
+groups when PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set) to be treated as empty
+strings when inserted as described above. If this option is not set, an attempt
+to insert an unset group causes the PCRE2_ERROR_UNSET error. This option does
+not influence the extended substitution syntax described below.
+.P
+PCRE2_SUBSTITUTE_EXTENDED causes extra processing to be applied to the
+replacement string. Without this option, only the dollar character is special,
+and only the group insertion forms listed above are valid. When
+PCRE2_SUBSTITUTE_EXTENDED is set, two things change:
+.P
+Firstly, backslash in a replacement string is interpreted as an escape
+character. The usual forms such as \en or \ex{ddd} can be used to specify
+particular character codes, and backslash followed by any non-alphanumeric
+character quotes that character. Extended quoting can be coded using \eQ...\eE,
+exactly as in pattern strings.
+.P
+There are also four escape sequences for forcing the case of inserted letters.
+The insertion mechanism has three states: no case forcing, force upper case,
+and force lower case. The escape sequences change the current state: \eU and
+\eL change to upper or lower case forcing, respectively, and \eE (when not
+terminating a \eQ quoted sequence) reverts to no case forcing. The sequences
+\eu and \el force the next character (if it is a letter) to upper or lower
+case, respectively, and then the state automatically reverts to no case
+forcing. Case forcing applies to all inserted  characters, including those from
+captured groups and letters within \eQ...\eE quoted sequences.
+.P
+Note that case forcing sequences such as \eU...\eE do not nest. For example,
+the result of processing "\eUaa\eLBB\eEcc\eE" is "AAbbcc"; the final \eE has no
+effect.
+.P
+The second effect of setting PCRE2_SUBSTITUTE_EXTENDED is to add more
+flexibility to group substitution. The syntax is similar to that used by Bash:
+.sp
+  ${<n>:-<string>}
+  ${<n>:+<string1>:<string2>}
+.sp
+As before, <n> may be a group number or a name. The first form specifies a
+default value. If group <n> is set, its value is inserted; if not, <string> is
+expanded and the result inserted. The second form specifies strings that are
+expanded and inserted when group <n> is set or unset, respectively. The first
+form is just a convenient shorthand for
+.sp
+  ${<n>:+${<n>}:<string>}
+.sp
+Backslash can be used to escape colons and closing curly brackets in the
+replacement strings. A change of the case forcing state within a replacement
+string remains in force afterwards, as shown in this \fBpcre2test\fP example:
+.sp
+  /(some)?(body)/substitute_extended,replace=${1:+\eU:\eL}HeLLo
+      body
+   1: hello
+      somebody
+   1: HELLO
+.sp
+The PCRE2_SUBSTITUTE_UNSET_EMPTY option does not affect these extended
+substitutions. However, PCRE2_SUBSTITUTE_UNKNOWN_UNSET does cause unknown
+groups in the extended syntax forms to be treated as unset.
+.P
+If successful, \fBpcre2_substitute()\fP returns the number of replacements that
+were made. This may be zero if no matches were found, and is never greater than
+1 unless PCRE2_SUBSTITUTE_GLOBAL is set.
+.P
+In the event of an error, a negative error code is returned. Except for
+PCRE2_ERROR_NOMATCH (which is never returned), errors from \fBpcre2_match()\fP
+are passed straight back.
+.P
+PCRE2_ERROR_NOSUBSTRING is returned for a non-existent substring insertion,
+unless PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set.
+.P
+PCRE2_ERROR_UNSET is returned for an unset substring insertion (including an
+unknown substring when PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set) when the simple
+(non-extended) syntax is used and PCRE2_SUBSTITUTE_UNSET_EMPTY is not set.
+.P
+PCRE2_ERROR_NOMEMORY is returned if the output buffer is not big enough. If the
+PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option is set, the size of buffer that is
+needed is returned via \fIoutlengthptr\fP. Note that this does not happen by
+default.
+.P
+PCRE2_ERROR_BADREPLACEMENT is used for miscellaneous syntax errors in the
+replacement string, with more particular errors being PCRE2_ERROR_BADREPESCAPE
+(invalid escape sequence), PCRE2_ERROR_REPMISSING_BRACE (closing curly bracket
+not found), PCRE2_BADSUBSTITUTION (syntax error in extended group
+substitution), and PCRE2_BADSUBPATTERN (the pattern match ended before it
+started, which can happen if \eK is used in an assertion).
+.P
+As for all PCRE2 errors, a text message that describes the error can be
+obtained by calling \fBpcre2_get_error_message()\fP.
 .
 .
 .SH "DUPLICATE SUBPATTERN NAMES"
@@ -2686,14 +2913,14 @@ first and last entries in the name-to-number table for the given name, and the
 function returns the length of each entry in code units. In both cases,
 PCRE2_ERROR_NOSUBSTRING is returned if there are no entries for the given name.
 .P
-The format of the name table is described above in the section entitled
-\fIInformation about a pattern\fP
+The format of the name table is described
 .\" HTML <a href="#infoaboutpattern">
 .\" </a>
-above.
+above
 .\"
-Given all the relevant entries for the name, you can extract each of their
-numbers, and hence the captured data.
+in the section entitled \fIInformation about a pattern\fP. Given all the
+relevant entries for the name, you can extract each of their numbers, and hence
+the captured data.
 .
 .
 .SH "FINDING ALL POSSIBLE MATCHES AT ONE POSITION"
@@ -2888,8 +3115,8 @@ There are in addition the following errors that are specific to
   PCRE2_ERROR_DFA_UITEM
 .sp
 This return is given if \fBpcre2_dfa_match()\fP encounters an item in the
-pattern that it does not support, for instance, the use of \eC or a back
-reference.
+pattern that it does not support, for instance, the use of \eC in a UTF mode or
+a back reference.
 .sp
   PCRE2_ERROR_DFA_UCOND
 .sp
@@ -2939,6 +3166,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 22 April 2015
+Last updated: 16 December 2015
 Copyright (c) 1997-2015 University of Cambridge.
 .fi
index 8f74e9b6bcce29608bdc8b200cac15af685f93a1..a90f1b2f0ca7eccb9e8ec81ccd6bb69598722a0c 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2BUILD 3 "23 April 2015" "PCRE2 10.20"
+.TH PCRE2BUILD 3 "16 October 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .
@@ -132,11 +132,20 @@ Pattern escapes such as \ed and \ew do not by default make use of Unicode
 properties. The application can request that they do by setting the PCRE2_UCP
 option. Unless the application has set PCRE2_NEVER_UCP, a pattern may also
 request this by starting with (*UCP).
-.P
+.
+.
+.SH "DISABLING THE USE OF \eC"
+.rs
+.sp
 The \eC escape sequence, which matches a single code unit, even in a UTF mode,
 can cause unpredictable behaviour because it may leave the current matching
-point in the middle of a multi-code-unit character. It can be locked out by
-setting the PCRE2_NEVER_BACKSLASH_C option.
+point in the middle of a multi-code-unit character. The application can lock it
+out by setting the PCRE2_NEVER_BACKSLASH_C option when calling
+\fBpcre2_compile()\fP. There is also a build-time option
+.sp
+  --enable-never-backslash-C
+.sp
+(note the upper case C) which locks out the use of \eC entirely.
 .
 .
 .SH "JUST-IN-TIME COMPILER SUPPORT"
@@ -510,6 +519,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 24 April 2015
+Last updated: 16 October 2015
 Copyright (c) 1997-2015 University of Cambridge.
 .fi
index 3f2071ba2046947528f8f99380bdc658e884c03c..a2117ea0faadc80a994a60d09790c9b2ced89f0f 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2JIT 3 "27 November 2014" "PCRE2 10.00"
+.TH PCRE2JIT 3 "14 November 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "PCRE2 JUST-IN-TIME COMPILER SUPPORT"
@@ -61,6 +61,12 @@ much faster than the normal interpretive code, but yields exactly the same
 results. The returned value from \fBpcre2_jit_compile()\fP is zero on success,
 or a negative error code.
 .P
+There is a limit to the size of pattern that JIT supports, imposed by the size
+of machine stack that it uses. The exact rules are not documented because they
+may change at any time, in particular, when new optimizations are introduced.
+If a pattern is too big, a call to \fBpcre2_jit_compile()\fB returns
+PCRE2_ERROR_NOMEMORY.
+.P
 PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for complete
 matches. If you want to run partial matches using the PCRE2_PARTIAL_HARD or
 PCRE2_PARTIAL_SOFT options of \fBpcre2_match()\fP, you should set one or both
@@ -207,8 +213,13 @@ for JIT matching. A callback function can therefore be used to determine
 whether a match operation was executed by JIT or by the interpreter.
 .P
 You may safely use the same JIT stack for more than one pattern (either by
-assigning directly or by callback), as long as the patterns are all matched
-sequentially in the same thread. In a multithread application, if you do not
+assigning directly or by callback), as long as the patterns are matched
+sequentially in the same thread. Currently, the only way to set up
+non-sequential matches in one thread is to use callouts: if a callout function
+starts another match, that match must use a different JIT stack to the one used
+for currently suspended match(es).
+.P
+In a multithread application, if you do not
 specify a JIT stack, or if you assign or pass back NULL from a callback, that
 is thread-safe, because each thread has its own machine stack. However, if you
 assign or pass back a non-NULL JIT stack, this must be a different stack for
@@ -399,6 +410,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 27 November 2014
-Copyright (c) 1997-2014 University of Cambridge.
+Last updated: 14 November 2015
+Copyright (c) 1997-2015 University of Cambridge.
 .fi
index 8982546180abbcbdd9df27384d3e4f3e93abca9c..a5bab8151dc349c0b0264790f4ab2b08ec6e601f 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2LIMITS 3 "25 November 2014" "PCRE2 10.00"
+.TH PCRE2LIMITS 3 "05 November 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "SIZE AND OTHER LIMITATIONS"
@@ -20,6 +20,10 @@ documentation for details. In these cases the limit is substantially larger.
 However, the speed of execution is slower. In the 32-bit library, the internal
 linkage size is always 4.
 .P
+The maximum length of a source pattern string is essentially unlimited; it is
+the largest number a PCRE2_SIZE variable can hold. However, the program that
+calls \fBpcre2_compile()\fP can specify a smaller limit.
+.P
 The maximum length (in code units) of a subject string is one less than the
 largest number a PCRE2_SIZE variable can hold. PCRE2_SIZE is an unsigned
 integer type, usually defined as size_t. Its maximum value (that is
@@ -37,6 +41,8 @@ documentation.
 .P
 All values in repeating quantifiers must be less than 65536.
 .P
+The maximum length of a lookbehind assertion is 65535 characters.
+.P
 There is no limit to the number of parenthesized subpatterns, but there can be
 no more than 65535 capturing subpatterns. There is, however, a limit to the
 depth of nesting of parenthesized subpatterns of all kinds. This is imposed in
@@ -69,6 +75,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 25 November 2014
-Copyright (c) 1997-2014 University of Cambridge.
+Last updated: 05 November 2015
+Copyright (c) 1997-2015 University of Cambridge.
 .fi
index 192859dd3cc500edf412f9be042f7054ebedb339..8d0e9dfc7ea335b617ae456e7bdcb3e8b0c03b0e 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2PATTERN 3 "13 June 2015" "PCRE2 10.20"
+.TH PCRE2PATTERN 3 "13 November 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "PCRE2 REGULAR EXPRESSION DETAILS"
@@ -671,8 +671,8 @@ below.
 This particular group matches either the two-character sequence CR followed by
 LF, or one of the single characters LF (linefeed, U+000A), VT (vertical tab,
 U+000B), FF (form feed, U+000C), CR (carriage return, U+000D), or NEL (next
-line, U+0085). The two-character sequence is treated as a single unit that
-cannot be split.
+line, U+0085). Because this is an atomic group, the two-character sequence is
+treated as a single unit that cannot be split.
 .P
 In other modes, two additional characters whose codepoints are greater than 255
 are added: LS (line separator, U+2028) and PS (paragraph separator, U+2029).
@@ -738,6 +738,8 @@ example:
 Those that are not part of an identified script are lumped together as
 "Common". The current list of scripts is:
 .P
+Ahom,
+Anatolian_Hieroglyphs,
 Arabic,
 Armenian,
 Avestan,
@@ -778,6 +780,7 @@ Gurmukhi,
 Han,
 Hangul,
 Hanunoo,
+Hatran,
 Hebrew,
 Hiragana,
 Imperial_Aramaic,
@@ -814,12 +817,14 @@ Miao,
 Modi,
 Mongolian,
 Mro,
+Multani,
 Myanmar,
 Nabataean,
 New_Tai_Lue,
 Nko,
 Ogham,
 Ol_Chiki,
+Old_Hungarian,
 Old_Italic,
 Old_North_Arabian,
 Old_Permic,
@@ -841,6 +846,7 @@ Saurashtra,
 Sharada,
 Shavian,
 Siddham,
+SignWriting,
 Sinhala,
 Sora_Sompeng,
 Sundanese,
@@ -1177,6 +1183,18 @@ patterns that are anchored in single line mode because all branches start with
 when the \fIstartoffset\fP argument of \fBpcre2_match()\fP is non-zero. The
 PCRE2_DOLLAR_ENDONLY option is ignored if PCRE2_MULTILINE is set.
 .P
+When the newline convention (see
+.\" HTML <a href="#newlines">
+.\" </a>
+"Newline conventions"
+.\"
+below) recognizes the two-character sequence CRLF as a newline, this is
+preferred, even if the single characters CR and LF are also recognized as
+newlines. For example, if the newline convention is "any", a multiline mode
+circumflex matches before "xyz" in the string "abc\er\enxyz" rather than after
+CR, even though CR on its own is a valid newline. (It also matches at the very
+start of the string, of course.)
+.P
 Note that the sequences \eA, \eZ, and \ez can be used to match the start and
 end of the subject in both modes, and if all branches of a pattern start with
 \eA it is always anchored, whether or not PCRE2_MULTILINE is set.
@@ -1227,8 +1245,11 @@ with \eC in UTF-8 or UTF-16 mode means that the rest of the string may start
 with a malformed UTF character. This has undefined results, because PCRE2
 assumes that it is matching character by character in a valid UTF string (by
 default it checks the subject string's validity at the start of processing
-unless the PCRE2_NO_UTF_CHECK option is used). An application can lock out the
-use of \eC by setting the PCRE2_NEVER_BACKSLASH_C option.
+unless the PCRE2_NO_UTF_CHECK option is used).
+.P
+An application can lock out the use of \eC by setting the
+PCRE2_NEVER_BACKSLASH_C option when compiling a pattern. It is also possible to
+build PCRE2 with the use of \eC permanently disabled.
 .P
 PCRE2 does not allow \eC to appear in lookbehind assertions
 .\" HTML <a href="#lookbehind">
@@ -1236,7 +1257,10 @@ PCRE2 does not allow \eC to appear in lookbehind assertions
 (described below)
 .\"
 in a UTF mode, because this would make it impossible to calculate the length of
-the lookbehind.
+the lookbehind. Neither the alternative matching function
+\fBpcre2_dfa_match()\fP not the JIT optimizer support \eC in a UTF mode. The
+former gives a match-time error; the latter fails to optimize and so the match
+is always run using the interpreter.
 .P
 In general, the \eC escape sequence is best avoided. However, one way of using
 it that avoids the problem of malformed UTF characters is to use a lookahead to
@@ -1318,9 +1342,18 @@ sequence other than one that defines a single character appears at a point
 where a range ending character is expected. For example, [z-\exff] is valid,
 but [A-\ed] and [A-[:digit:]] are not.
 .P
-Ranges operate in the collating sequence of character values. They can also be
-used for characters specified numerically, for example [\e000-\e037]. Ranges
-can include any characters that are valid for the current mode.
+Ranges normally include all code points between the start and end characters,
+inclusive. They can also be used for code points specified numerically, for
+example [\e000-\e037]. Ranges can include any characters that are valid for the
+current mode.
+.P
+There is a special case in EBCDIC environments for ranges whose end points are
+both specified as literal letters in the same case. For compatibility with
+Perl, EBCDIC code points within the range that are not letters are omitted. For
+example, [h-k] matches only four characters, even though the codes for h and k
+are 0x88 and 0x92, a range of 11 code points. However, if the range is
+specified numerically, for example, [\ex88-\ex92] or [h-\ex92], all code points
+are included.
 .P
 If a range that includes letters is used when caseless matching is set, it
 matches the letters in either case. For example, [W-c] is equivalent to
@@ -1650,6 +1683,9 @@ first one in the pattern with the given number. The following pattern matches
 .sp
   /(?|(abc)|(def))(?1)/
 .sp
+A relative reference such as (?-1) is no different: it is just a convenient way
+of computing an absolute group number.
+.P
 If a
 .\" HTML <a href="#conditions">
 .\" </a>
@@ -2513,7 +2549,8 @@ For example:
   (?(VERSION>=10.4)yes|no)
 .sp
 This pattern matches "yes" if the PCRE2 version is greater or equal to 10.4, or
-"no" otherwise.
+"no" otherwise. The fractional part of the version number may not contain more
+than two digits.
 .
 .
 .SS "Assertion conditions"
@@ -2630,6 +2667,23 @@ pattern above you can write (?-2) to refer to the second most recently opened
 parentheses preceding the recursion. In other words, a negative number counts
 capturing parentheses leftwards from the point at which it is encountered.
 .P
+Be aware however, that if
+.\" HTML <a href="#dupsubpatternnumber">
+.\" </a>
+duplicate subpattern numbers
+.\"
+are in use, relative references refer to the earliest subpattern with the
+appropriate number. Consider, for example:
+.sp
+  (?|(a)|(b)) (c) (?-2)
+.sp
+The first two capturing groups (a) and (b) are both numbered 1, and group (c)
+is number 2. When the reference (?-2) is encountered, the second most recently
+opened parentheses has the number 1, but it is the first such group (the (a)
+group) to which the recursion refers. This would be the same if an absolute
+reference (?1) was used. In other words, relative references are just a
+shorthand for computing a group number.
+.P
 It is also possible to refer to subsequently opened parentheses, by writing
 references such as (?+2). However, these cannot be recursive because the
 reference is not inside the parentheses that are referenced. They are always
@@ -2929,14 +2983,24 @@ in production code should be noted to avoid problems during upgrades." The same
 remarks apply to the PCRE2 features described in this section.
 .P
 The new verbs make use of what was previously invalid syntax: an opening
-parenthesis followed by an asterisk. They are generally of the form
-(*VERB) or (*VERB:NAME). Some may take either form, possibly behaving
-differently depending on whether or not a name is present. A name is any
-sequence of characters that does not include a closing parenthesis. The maximum
-length of name is 255 in the 8-bit library and 65535 in the 16-bit and 32-bit
-libraries. If the name is empty, that is, if the closing parenthesis
-immediately follows the colon, the effect is as if the colon were not there.
-Any number of these verbs may occur in a pattern.
+parenthesis followed by an asterisk. They are generally of the form (*VERB) or
+(*VERB:NAME). Some verbs take either form, possibly behaving differently
+depending on whether or not a name is present.
+.P
+By default, for compatibility with Perl, a name is any sequence of characters
+that does not include a closing parenthesis. The name is not processed in
+any way, and it is not possible to include a closing parenthesis in the name.
+However, if the PCRE2_ALT_VERBNAMES option is set, normal backslash processing
+is applied to verb names and only an unescaped closing parenthesis terminates
+the name. A closing parenthesis can be included in a name either as \e) or
+between \eQ and \eE. If the PCRE2_EXTENDED option is set, unescaped whitespace
+in verb names is skipped and #-comments are recognized, exactly as in the rest
+of the pattern.
+.P
+The maximum length of a name is 255 in the 8-bit library and 65535 in the
+16-bit and 32-bit libraries. If the name is empty, that is, if the closing
+parenthesis immediately follows the colon, the effect is as if the colon were
+not there. Any number of these verbs may occur in a pattern.
 .P
 Since these verbs are specifically related to backtracking, most of them can be
 used only when the pattern is to be matched using the traditional matching
@@ -3361,6 +3425,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 13 June 2015
+Last updated: 13 November 2015
 Copyright (c) 1997-2015 University of Cambridge.
 .fi
index b6669752ffe6c109901e4e04d27e4084a6e495d6..833e96cba1f9ab3ed380cb751d314a5615ed7664 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2POSIX 3 "20 October 2014" "PCRE2 10.00"
+.TH PCRE2POSIX 3 "29 November 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "SYNOPSIS"
@@ -145,7 +145,7 @@ use the contents of the \fIpreg\fP structure. If, for example, you pass it to
 This area is not simple, because POSIX and Perl take different views of things.
 It is not possible to get PCRE2 to obey POSIX semantics, but then PCRE2 was
 never intended to be a POSIX engine. The following table lists the different
-possibilities for matching newline characters in PCRE2:
+possibilities for matching newline characters in Perl and PCRE2:
 .sp
                           Default   Change with
 .sp
@@ -155,7 +155,7 @@ possibilities for matching newline characters in PCRE2:
   $ matches \en in middle     no     PCRE2_MULTILINE
   ^ matches \en in middle     no     PCRE2_MULTILINE
 .sp
-This is the equivalent table for POSIX:
+This is the equivalent table for a POSIX-compatible pattern matcher:
 .sp
                           Default   Change with
 .sp
@@ -165,13 +165,17 @@ This is the equivalent table for POSIX:
   $ matches \en in middle     no     REG_NEWLINE
   ^ matches \en in middle     no     REG_NEWLINE
 .sp
-PCRE2's behaviour is the same as Perl's, except that there is no equivalent for
-PCRE2_DOLLAR_ENDONLY in Perl. In both PCRE2 and Perl, there is no way to stop
-newline from matching [^a].
+This behaviour is not what happens when PCRE2 is called via its POSIX
+API. By default, PCRE2's behaviour is the same as Perl's, except that there is
+no equivalent for PCRE2_DOLLAR_ENDONLY in Perl. In both PCRE2 and Perl, there
+is no way to stop newline from matching [^a].
 .P
-The default POSIX newline handling can be obtained by setting PCRE2_DOTALL and
-PCRE2_DOLLAR_ENDONLY, but there is no way to make PCRE2 behave exactly as for
-the REG_NEWLINE action.
+Default POSIX newline handling can be obtained by setting PCRE2_DOTALL and
+PCRE2_DOLLAR_ENDONLY when calling \fBpcre2_compile()\fP directly, but there is
+no way to make PCRE2 behave exactly as for the REG_NEWLINE action. When using
+the POSIX API, passing REG_NEWLINE to PCRE2's \fBregcomp()\fP function
+causes PCRE2_MULTILINE to be passed to \fBpcre2_compile()\fP, and REG_DOTALL
+passes PCRE2_DOTALL. There is no way to pass PCRE2_DOLLAR_ENDONLY.
 .
 .
 .SH "MATCHING A PATTERN"
@@ -207,7 +211,8 @@ to have a terminating NUL located at \fIstring\fP + \fIpmatch[0].rm_eo\fP
 IEEE Standard 1003.2 (POSIX.2), and should be used with caution in software
 intended to be portable to other systems. Note that a non-zero \fIrm_so\fP does
 not imply REG_NOTBOL; REG_STARTEND affects only the location of the string, not
-how it is matched.
+how it is matched. Setting REG_STARTEND and passing \fIpmatch\fP as NULL are
+mutually exclusive; the error REG_INVARG is returned.
 .P
 If the pattern was compiled with the REG_NOSUB flag, no data about any matched
 strings is returned. The \fInmatch\fP and \fIpmatch\fP arguments of
@@ -236,9 +241,11 @@ header file, of which REG_NOMATCH is the "expected" failure code.
 The \fBregerror()\fP function maps a non-zero errorcode from either
 \fBregcomp()\fP or \fBregexec()\fP to a printable message. If \fIpreg\fP is not
 NULL, the error should have arisen from the use of that structure. A message
-terminated by a binary zero is placed in \fIerrbuf\fP. The length of the
-message, including the zero, is limited to \fIerrbuf_size\fP. The yield of the
-function is the size of buffer needed to hold the whole message.
+terminated by a binary zero is placed in \fIerrbuf\fP. If the buffer is too
+short, only the first \fIerrbuf_size\fP - 1 characters of the error message are
+used. The yield of the function is the size of buffer needed to hold the whole
+message, including the terminating zero. This value is greater than
+\fIerrbuf_size\fP if the message was truncated.
 .
 .
 .SH MEMORY USAGE
@@ -263,6 +270,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 20 October 2014
-Copyright (c) 1997-2014 University of Cambridge.
+Last updated: 29 November 2015
+Copyright (c) 1997-2015 University of Cambridge.
 .fi
index a76272b70365e77e941b96f0897f348b948bda1a..69bcb181dd7560efc730a0c96c4e696bcf2ca306 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2SERIALIZE 3 "20 January 2015" "PCRE2 10.10"
+.TH PCRE2SERIALIZE 3 "03 November 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "SAVING AND RE-USING PRECOMPILED PCRE2 PATTERNS"
@@ -22,12 +22,12 @@ If you are running an application that uses a large number of regular
 expression patterns, it may be useful to store them in a precompiled form
 instead of having to compile them every time the application is run. However,
 if you are using the just-in-time optimization feature, it is not possible to
-save and reload the JIT data, because it is position-dependent. In addition,
-the host on which the patterns are reloaded must be running the same version of
-PCRE2, with the same code unit width, and must also have the same endianness,
-pointer width and PCRE2_SIZE type. For example, patterns compiled on a 32-bit
-system using PCRE2's 16-bit library cannot be reloaded on a 64-bit system, nor
-can they be reloaded using the 8-bit library.
+save and reload the JIT data, because it is position-dependent. The host on
+which the patterns are reloaded must be running the same version of PCRE2, with
+the same code unit width, and must also have the same endianness, pointer width
+and PCRE2_SIZE type. For example, patterns compiled on a 32-bit system using
+PCRE2's 16-bit library cannot be reloaded on a 64-bit system, nor can they be
+reloaded using the 8-bit library.
 .
 .
 .SH "SAVING COMPILED PATTERNS"
@@ -139,10 +139,15 @@ PCRE2_ERROR_BADMAGIC may mean that the data is corrupt, or that it was compiled
 on a system with different endianness.
 .P
 Decoded patterns can be used for matching in the usual way, and must be freed
-by calling \fBpcre2_code_free()\fP as normal. A single copy of the character
-tables is used by all the decoded patterns. A reference count is used to
+by calling \fBpcre2_code_free()\fP. However, be aware that there is a potential
+race issue if you are using multiple patterns that were decoded from a single
+byte stream in a multithreaded application. A single copy of the character
+tables is used by all the decoded patterns and a reference count is used to
 arrange for its memory to be automatically freed when the last pattern is
-freed.
+freed, but there is no locking on this reference count. Therefore, if you want
+to call \fBpcre2_code_free()\fP for these patterns in different threads, you
+must arrange your own locking, and ensure that \fBpcre2_code_free()\fP cannot
+be called by two threads at the same time.
 .P
 If a pattern was processed by \fBpcre2_jit_compile()\fP before being
 serialized, the JIT data is discarded and so is no longer available after a
@@ -165,6 +170,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 20 January 2015
+Last updated: 03 November 2015
 Copyright (c) 1997-2015 University of Cambridge.
 .fi
index dc34538cc2bd761b84024777779e3d255ceca9d4..8be8b926c6f512f69a8c16bab84593dab27c725d 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2SYNTAX 3 "13 June 2015" "PCRE2 10.20"
+.TH PCRE2SYNTAX 3 "16 October 2015" "PCRE2 10.21"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "PCRE2 REGULAR EXPRESSION SYNTAX SUMMARY"
@@ -81,9 +81,10 @@ it matches a literal "u".
   \eW         a "non-word" character
   \eX         a Unicode extended grapheme cluster
 .sp
-The application can lock out the use of \eC by setting the
-PCRE2_NEVER_BACKSLASH_C option. It is dangerous because it may leave the
-current matching point in the middle of a UTF-8 or UTF-16 character.
+\eC is dangerous because it may leave the current matching point in the middle
+of a UTF-8 or UTF-16 character. The application can lock out the use of \eC by
+setting the PCRE2_NEVER_BACKSLASH_C option. It is also possible to build PCRE2
+with the use of \eC permanently disabled.
 .P
 By default, \ed, \es, and \ew match only ASCII characters, even in UTF-8 mode
 or in the 16-bit and 32-bit libraries. However, if locale-specific matching is
@@ -159,6 +160,8 @@ at release 5.18.
 .SH "SCRIPT NAMES FOR \ep AND \eP"
 .rs
 .sp
+Ahom,
+Anatolian_Hieroglyphs,
 Arabic,
 Armenian,
 Avestan,
@@ -199,6 +202,7 @@ Gurmukhi,
 Han,
 Hangul,
 Hanunoo,
+Hatran,
 Hebrew,
 Hiragana,
 Imperial_Aramaic,
@@ -235,12 +239,14 @@ Miao,
 Modi,
 Mongolian,
 Mro,
+Multani,
 Myanmar,
 Nabataean,
 New_Tai_Lue,
 Nko,
 Ogham,
 Ol_Chiki,
+Old_Hungarian,
 Old_Italic,
 Old_North_Arabian,
 Old_Permic,
@@ -262,6 +268,7 @@ Saurashtra,
 Sharada,
 Shavian,
 Siddham,
+SignWriting,
 Sinhala,
 Sora_Sompeng,
 Sundanese,
@@ -570,6 +577,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 13 June 2015
+Last updated: 16 October 2015
 Copyright (c) 1997-2015 University of Cambridge.
 .fi
index 857adc3543e5ff1b6c884bcc02ae7100778c347f..b8eef93890ac3e1958db050d84b6d1ce174aec17 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2TEST 1 "20 May 2015" "PCRE 10.20"
+.TH PCRE2TEST 1 "12 December 2015" "PCRE 10.21"
 .SH NAME
 pcre2test - a program for testing Perl-compatible regular expressions.
 .SH SYNOPSIS
@@ -122,12 +122,13 @@ following options output the value and set the exit code as indicated:
 The following options output 1 for true or 0 for false, and set the exit code
 to the same value:
 .sp
-  ebcdic     compiled for an EBCDIC environment
-  jit        just-in-time support is available
-  pcre2-16   the 16-bit library was built
-  pcre2-32   the 32-bit library was built
-  pcre2-8    the 8-bit library was built
-  unicode    Unicode support is available
+  backslash-C  \eC is supported (not locked out)
+  ebcdic       compiled for an EBCDIC environment
+  jit          just-in-time support is available
+  pcre2-16     the 16-bit library was built
+  pcre2-32     the 32-bit library was built
+  pcre2-8      the 8-bit library was built
+  unicode      Unicode support is available
 .sp
 If an unknown option is given, an error message is output; the exit code is 0.
 .TP 10
@@ -217,9 +218,9 @@ Each subject line is matched separately and independently. If you want to do
 multi-line matches, you have to use the \en escape sequence (or \er or \er\en,
 etc., depending on the newline setting) in a single line of input to encode the
 newline sequences. There is no limit on the length of subject lines; the input
-buffer is automatically extended if it is too small. There is a replication
-feature that makes it possible to generate long subject lines without having to
-supply them explicitly.
+buffer is automatically extended if it is too small. There are replication
+features that makes it possible to generate long repetitive pattern or subject
+lines without having to supply them explicitly.
 .P
 An empty line or the end of the file signals the end of the subject lines for a
 test, at which point a new pattern or command line is expected if there is
@@ -259,6 +260,34 @@ described in the section entitled "Saving and restoring compiled patterns"
 .\" </a>
 below.
 .\"
+.sp
+  #newline_default [<newline-list>]
+.sp
+When PCRE2 is built, a default newline convention can be specified. This
+determines which characters and/or character pairs are recognized as indicating
+a newline in a pattern or subject string. The default can be overridden when a
+pattern is compiled. The standard test files contain tests of various newline
+conventions, but the majority of the tests expect a single linefeed to be
+recognized as a newline by default. Without special action the tests would fail
+when PCRE2 is compiled with either CR or CRLF as the default newline.
+.P
+The #newline_default command specifies a list of newline types that are
+acceptable as the default. The types must be one of CR, LF, CRLF, ANYCRLF, or
+ANY (in upper or lower case), for example:
+.sp
+  #newline_default LF Any anyCRLF
+.sp
+If the default newline is in the list, this command has no effect. Otherwise,
+except when testing the POSIX API, a \fBnewline\fP modifier that specifies the
+first newline convention in the list (LF in the above example) is added to any
+pattern that does not already have a \fBnewline\fP modifier. If the newline
+list is empty, the feature is turned off. This command is present in a number
+of the standard test input files.
+.P
+When the POSIX API is being tested there is no way to override the default
+newline convention, though it is possible to set the newline convention from
+within the pattern. A warning is given if the \fBposix\fP modifier is used when
+\fB#newline_default\fP would set a default for the non-POSIX API.
 .sp
   #pattern <modifier-list>
 .sp
@@ -303,12 +332,13 @@ subject lines. Modifiers on a subject line can change these settings.
 .rs
 .sp
 Modifier lists are used with both pattern and subject lines. Items in a list
-are separated by commas and optional white space. Some modifiers may be given
-for both patterns and subject lines, whereas others are valid for one or the
-other only. Each modifier has a long name, for example "anchored", and some of
-them must be followed by an equals sign and a value, for example, "offset=12".
-Modifiers that do not take values may be preceded by a minus sign to turn off a
-previous setting.
+are separated by commas followed by optional white space. Trailing whitespace
+in a modifier list is ignored. Some modifiers may be given for both patterns
+and subject lines, whereas others are valid only for one or the other. Each
+modifier has a long name, for example "anchored", and some of them must be
+followed by an equals sign and a value, for example, "offset=12". Values cannot
+contain comma characters, but may contain spaces. Modifiers that do not take
+values may be preceded by a minus sign to turn off a previous setting.
 .P
 A few of the more common modifiers can also be specified as single letters, for
 example "i" for "caseless". In documentation, following the Perl convention,
@@ -414,6 +444,12 @@ the start of a modifier list. For example:
 .sp
   abc\e=notbol,notempty
 .sp
+If the subject string is empty and \e= is followed by whitespace, the line is
+treated as a comment line, and is not used for matching. For example:
+.sp
+  \e= This is a comment.
+  abc\e= This is an invalid modifier list.
+.sp
 A backslash followed by any other non-alphanumeric character just escapes that
 character. A backslash followed by anything else causes an error. However, if
 the very last character in the line is a backslash (and there is no modifier
@@ -424,10 +460,10 @@ a real empty line terminates the data input.
 .SH "PATTERN MODIFIERS"
 .rs
 .sp
-There are three types of modifier that can appear in pattern lines, two of
-which may also be used in a \fB#pattern\fP command. A pattern's modifier list
-can add to or override default modifiers that were set by a previous
-\fB#pattern\fP command.
+There are several types of modifier that can appear in pattern lines. Except
+where noted below, they may also be used in \fB#pattern\fP commands. A
+pattern's modifier list can add to or override default modifiers that were set
+by a previous \fB#pattern\fP command.
 .
 .
 .\" HTML <a name="optionmodifiers"></a>
@@ -437,13 +473,14 @@ can add to or override default modifiers that were set by a previous
 The following modifiers set options for \fBpcre2_compile()\fP. The most common
 ones have single-letter abbreviations. See
 .\" HREF
-\fBpcreapi\fP
+\fBpcre2api\fP
 .\"
 for a description of their effects.
 .sp
       allow_empty_class         set PCRE2_ALLOW_EMPTY_CLASS
       alt_bsux                  set PCRE2_ALT_BSUX
       alt_circumflex            set PCRE2_ALT_CIRCUMFLEX
+      alt_verbnames             set PCRE2_ALT_VERBNAMES
       anchored                  set PCRE2_ANCHORED
       auto_callout              set PCRE2_AUTO_CALLOUT
   /i  caseless                  set PCRE2_CASELESS
@@ -464,6 +501,7 @@ for a description of their effects.
       no_utf_check              set PCRE2_NO_UTF_CHECK
       ucp                       set PCRE2_UCP
       ungreedy                  set PCRE2_UNGREEDY
+      use_offset_limit          set PCRE2_USE_OFFSET_LIMIT
       utf                       set PCRE2_UTF
 .sp
 As well as turning on the PCRE2_UTF option, the \fButf\fP modifier causes all
@@ -490,8 +528,10 @@ about the pattern:
       jitfast                   use JIT fast path
       jitverify                 verify JIT use
       locale=<name>             use this locale
+      max_pattern_length=<n>    set the maximum pattern length
       memory                    show memory used
       newline=<type>            set newline type
+      null_context              compile with a NULL context
       parens_nest_limit=<n>     set maximum parentheses depth
       posix                     use the POSIX API
       push                      push compiled pattern onto the stack
@@ -565,6 +605,15 @@ is requested. For each callout, either its number or string is given, followed
 by the item that follows it in the pattern.
 .
 .
+.SS "Passing a NULL context"
+.rs
+.sp
+Normally, \fBpcre2test\fP passes a context block to \fBpcre2_compile()\fP. If
+the \fBnull_context\fP modifier is set, however, NULL is passed. This is for
+testing that \fBpcre2_compile()\fP behaves correctly in this case (it uses
+default values).
+.
+.
 .SS "Specifying a pattern in hex"
 .rs
 .sp
@@ -581,24 +630,83 @@ PCRE2_ZERO_TERMINATED. However, for patterns specified in hexadecimal, the
 actual length of the pattern is passed.
 .
 .
+.SS "Generating long repetitive patterns"
+.rs
+.sp
+Some tests use long patterns that are very repetitive. Instead of creating a
+very long input line for such a pattern, you can use a special repetition
+feature, similar to the one described for subject lines above. If the
+\fBexpand\fP modifier is present on a pattern, parts of the pattern that have
+the form
+.sp
+  \e[<characters>]{<count>}
+.sp
+are expanded before the pattern is passed to \fBpcre2_compile()\fP. For
+example, \e[AB]{6000} is expanded to "ABAB..." 6000 times. This construction
+cannot be nested. An initial "\e[" sequence is recognized only if "]{" followed
+by decimal digits and "}" is found later in the pattern. If not, the characters
+remain in the pattern unaltered.
+.P
+If part of an expanded pattern looks like an expansion, but is really part of
+the actual pattern, unwanted expansion can be avoided by giving two values in
+the quantifier. For example, \e[AB]{6000,6000} is not recognized as an
+expansion item.
+.P
+If the \fBinfo\fP modifier is set on an expanded pattern, the result of the
+expansion is included in the information that is output.
+.
+.
 .SS "JIT compilation"
 .rs
 .sp
-The \fB/jit\fP modifier may optionally be followed by an equals sign and a
-number in the range 0 to 7:
+Just-in-time (JIT) compiling is a heavyweight optimization that can greatly
+speed up pattern matching. See the
+.\" HREF
+\fBpcre2jit\fP
+.\"
+documentation for details. JIT compiling happens, optionally, after a pattern
+has been successfully compiled into an internal form. The JIT compiler converts
+this to optimized machine code. It needs to know whether the match-time options
+PCRE2_PARTIAL_HARD and PCRE2_PARTIAL_SOFT are going to be used, because
+different code is generated for the different cases. See the \fBpartial\fP
+modifier in "Subject Modifiers"
+.\" HTML <a href="#subjectmodifiers">
+.\" </a>
+below
+.\"
+for details of how these options are specified for each match attempt.
+.P
+JIT compilation is requested by the \fB/jit\fP pattern modifier, which may
+optionally be followed by an equals sign and a number in the range 0 to 7.
+The three bits that make up the number specify which of the three JIT operating
+modes are to be compiled:
+.sp
+  1  compile JIT code for non-partial matching
+  2  compile JIT code for soft partial matching
+  4  compile JIT code for hard partial matching
+.sp
+The possible values for the \fB/jit\fP modifier are therefore:
 .sp
   0  disable JIT
-  1  use JIT for normal match only
-  2  use JIT for soft partial match only
-  3  use JIT for normal match and soft partial match
-  4  use JIT for hard partial match only
-  6  use JIT for soft and hard partial match
+  1  normal matching only
+  2  soft partial matching only
+  3  normal and soft partial matching
+  4  hard partial matching only
+  6  soft and hard partial matching only
   7  all three modes
 .sp
-If no number is given, 7 is assumed. If JIT compilation is successful, the
-compiled JIT code will automatically be used when \fBpcre2_match()\fP is run
-for the appropriate type of match, except when incompatible run-time options
-are specified. For more details, see the
+If no number is given, 7 is assumed. The phrase "partial matching" means a call
+to \fBpcre2_match()\fP with either the PCRE2_PARTIAL_SOFT or the
+PCRE2_PARTIAL_HARD option set. Note that such a call may return a complete
+match; the options enable the possibility of a partial match, but do not
+require it. Note also that if you request JIT compilation only for partial
+matching (for example, /jit=2) but do not set the \fBpartial\fP modifier on a
+subject line, that match will not use JIT code because none was compiled for
+non-partial matching.
+.P
+If JIT compilation is successful, the compiled JIT code will automatically be
+used when an appropriate type of match is run, except when incompatible
+run-time options are specified. For more details, see the
 .\" HREF
 \fBpcre2jit\fP
 .\"
@@ -660,13 +768,26 @@ sets its own default of 220, which is required for running the standard test
 suite.
 .
 .
+.SS "Limiting the pattern length"
+.rs
+.sp
+The \fBmax_pattern_length\fP modifier sets a limit, in code units, to the
+length of pattern that \fBpcre2_compile()\fP will accept. Breaching the limit
+causes a compilation error. The default is the largest number a PCRE2_SIZE
+variable can hold (essentially unlimited).
+.
+.
 .SS "Using the POSIX wrapper API"
 .rs
 .sp
 The \fB/posix\fP modifier causes \fBpcre2test\fP to call PCRE2 via the POSIX
 wrapper API rather than its native API. This supports only the 8-bit library.
-When the POSIX API is being used, the following pattern modifiers set options
-for the \fBregcomp()\fP function:
+Note that it does not imply POSIX matching semantics; for more detail see the
+.\" HREF
+\fBpcre2posix\fP
+.\"
+documentation. When the POSIX API is being used, the following pattern
+modifiers set options for the \fBregcomp()\fP function:
 .sp
   caseless           REG_ICASE
   multiline          REG_NEWLINE
@@ -676,6 +797,15 @@ for the \fBregcomp()\fP function:
   ucp                REG_UCP        )   the POSIX standard
   utf                REG_UTF8       )
 .sp
+The \fBregerror_buffsize\fP modifier specifies a size for the error buffer that
+is passed to \fBregerror()\fP in the event of a compilation error. For example:
+.sp
+  /abc/posix,regerror_buffsize=20
+.sp
+This provides a means of testing the behaviour of \fBregerror()\fP when the
+buffer is too small for the error message. If this modifier has not been set, a
+large buffer is used.
+.P
 The \fBaftertext\fP and \fBallaftertext\fP subject modifiers work as described
 below. All other modifiers cause an error.
 .
@@ -720,17 +850,22 @@ are mutually exclusive.
 .sp
 The following modifiers are really subject modifiers, and are described below.
 However, they may be included in a pattern's modifier list, in which case they
-are applied to every subject line that is processed with that pattern. They do
-not affect the compilation process.
-.sp
-      aftertext           show text after match
-      allaftertext        show text after captures
-      allcaptures         show all captures
-      allusedtext         show all consulted text
-  /g  global              global matching
-      mark                show mark values
-      replace=<string>    specify a replacement string
-      startchar           show starting character when relevant
+are applied to every subject line that is processed with that pattern. They may
+not appear in \fB#pattern\fP commands. These modifiers do not affect the
+compilation process.
+.sp
+      aftertext                  show text after match
+      allaftertext               show text after captures
+      allcaptures                show all captures
+      allusedtext                show all consulted text
+  /g  global                     global matching
+      mark                       show mark values
+      replace=<string>           specify a replacement string
+      startchar                  show starting character when relevant
+      substitute_extended        use PCRE2_SUBSTITUTE_EXTENDED
+      substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+      substitute_unknown_unset   use PCRE2_SUBSTITUTE_UNKNOWN_UNSET
+      substitute_unset_empty     use PCRE2_SUBSTITUTE_UNSET_EMPTY
 .sp
 These modifiers may not appear in a \fB#pattern\fP command. If you want them as
 defaults, set them in a \fB#subject\fP command.
@@ -755,6 +890,7 @@ warning message, except for \fBreplace\fP, which causes an error. Note that,
 matching that uses this pattern.
 .
 .
+.\" HTML <a name="subjectmodifiers"></a>
 .SH "SUBJECT MODIFIERS"
 .rs
 .sp
@@ -801,31 +937,38 @@ information. Some of them may also be specified on a pattern line (see above),
 in which case they apply to every subject line that is matched against that
 pattern.
 .sp
-      aftertext                 show text after match
-      allaftertext              show text after captures
-      allcaptures               show all captures
-      allusedtext               show all consulted text (non-JIT only)
-      altglobal                 alternative global matching
-      callout_capture           show captures at callout time
-      callout_data=<n>          set a value to pass via callouts
-      callout_fail=<n>[:<m>]    control callout failure
-      callout_none              do not supply a callout function
-      copy=<number or name>     copy captured substring
-      dfa                       use \fBpcre2_dfa_match()\fP
-      find_limits               find match and recursion limits
-      get=<number or name>      extract captured substring
-      getall                    extract all captured substrings
-  /g  global                    global matching
-      jitstack=<n>              set size of JIT stack
-      mark                      show mark values
-      match_limit=>n>           set a match limit
-      memory                    show memory usage
-      offset=<n>                set starting offset
-      ovector=<n>               set size of output vector
-      recursion_limit=<n>       set a recursion limit
-      replace=<string>          specify a replacement string
-      startchar                 show startchar when relevant
-      zero_terminate            pass the subject as zero-terminated
+      aftertext                  show text after match
+      allaftertext               show text after captures
+      allcaptures                show all captures
+      allusedtext                show all consulted text (non-JIT only)
+      altglobal                  alternative global matching
+      callout_capture            show captures at callout time
+      callout_data=<n>           set a value to pass via callouts
+      callout_fail=<n>[:<m>]     control callout failure
+      callout_none               do not supply a callout function
+      copy=<number or name>      copy captured substring
+      dfa                        use \fBpcre2_dfa_match()\fP
+      find_limits                find match and recursion limits
+      get=<number or name>       extract captured substring
+      getall                     extract all captured substrings
+  /g  global                     global matching
+      jitstack=<n>               set size of JIT stack
+      mark                       show mark values
+      match_limit=<n>            set a match limit
+      memory                     show memory usage
+      null_context               match with a NULL context
+      offset=<n>                 set starting offset
+      offset_limit=<n>           set offset limit
+      ovector=<n>                set size of output vector
+      recursion_limit=<n>        set a recursion limit
+      replace=<string>           specify a replacement string
+      startchar                  show startchar when relevant
+      startoffset=<n>            same as offset=<n>
+      substitute_extedded        use PCRE2_SUBSTITUTE_EXTENDED
+      substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+      substitute_unknown_unset   use PCRE2_SUBSTITUTE_UNKNOWN_UNSET
+      substitute_unset_empty     use PCRE2_SUBSTITUTE_UNSET_EMPTY
+      zero_terminate             pass the subject as zero-terminated
 .sp
 The effects of these modifiers are described in the following sections.
 .
@@ -957,18 +1100,30 @@ by name.
 .rs
 .sp
 If the \fBreplace\fP modifier is set, the \fBpcre2_substitute()\fP function is
-called instead of one of the matching functions. Unlike subject strings,
-\fBpcre2test\fP does not process replacement strings for escape sequences. In
-UTF mode, a replacement string is checked to see if it is a valid UTF-8 string.
-If so, it is correctly converted to a UTF string of the appropriate code unit
-width. If it is not a valid UTF-8 string, the individual code units are copied
-directly. This provides a means of passing an invalid UTF-8 string for testing
-purposes.
+called instead of one of the matching functions. Note that replacement strings
+cannot contain commas, because a comma signifies the end of a modifier. This is
+not thought to be an issue in a test program.
+.P
+Unlike subject strings, \fBpcre2test\fP does not process replacement strings
+for escape sequences. In UTF mode, a replacement string is checked to see if it
+is a valid UTF-8 string. If so, it is correctly converted to a UTF string of
+the appropriate code unit width. If it is not a valid UTF-8 string, the
+individual code units are copied directly. This provides a means of passing an
+invalid UTF-8 string for testing purposes.
 .P
-If the \fBglobal\fP modifier is set, PCRE2_SUBSTITUTE_GLOBAL is passed to
-\fBpcre2_substitute()\fP. After a successful substitution, the modified string
-is output, preceded by the number of replacements. This may be zero if there
-were no matches. Here is a simple example of a substitution test:
+The following modifiers set options (in additional to the normal match options)
+for \fBpcre2_substitute()\fP:
+.sp
+  global                      PCRE2_SUBSTITUTE_GLOBAL
+  substitute_extended         PCRE2_SUBSTITUTE_EXTENDED
+  substitute_overflow_length  PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+  substitute_unknown_unset    PCRE2_SUBSTITUTE_UNKNOWN_UNSET
+  substitute_unset_empty      PCRE2_SUBSTITUTE_UNSET_EMPTY
+.sp
+.P
+After a successful substitution, the modified string is output, preceded by the
+number of replacements. This may be zero if there were no matches. Here is a
+simple example of a substitution test:
 .sp
   /abc/replace=xxx
       =abc=abc=
@@ -976,12 +1131,12 @@ were no matches. Here is a simple example of a substitution test:
       =abc=abc=\e=global
    2: =xxx=xxx=
 .sp
-Subject and replacement strings should be kept relatively short for
-substitution tests, as fixed-size buffers are used. To make it easy to test for
-buffer overflow, if the replacement string starts with a number in square
-brackets, that number is passed to \fBpcre2_substitute()\fP as the size of the
-output buffer, with the replacement string starting at the next character. Here
-is an example that tests the edge case:
+Subject and replacement strings should be kept relatively short (fewer than 256
+characters) for substitution tests, as fixed-size buffers are used. To make it
+easy to test for buffer overflow, if the replacement string starts with a
+number in square brackets, that number is passed to \fBpcre2_substitute()\fP as
+the size of the output buffer, with the replacement string starting at the next
+character. Here is an example that tests the edge case:
 .sp
   /abc/
       123abc123\e=replace=[10]XYZ
@@ -989,6 +1144,19 @@ is an example that tests the edge case:
       123abc123\e=replace=[9]XYZ
   Failed: error -47: no more memory
 .sp
+The default action of \fBpcre2_substitute()\fP is to return
+PCRE2_ERROR_NOMEMORY when the output buffer is too small. However, if the
+PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option is set (by using the
+\fBsubstitute_overflow_length\fP modifier), \fBpcre2_substitute()\fP continues
+to go through the motions of matching and substituting, in order to compute the
+size of buffer that is required. When this happens, \fBpcre2test\fP shows the
+required buffer length (which includes space for the trailing zero) as part of
+the error message. For example:
+.sp
+  /abc/substitute_overflow_length
+      123abc123\e=replace=[9]XYZ
+  Failed: error -47: no more memory: 10 code units are needed
+.sp
 A replacement string is ignored with POSIX and DFA matching. Specifying partial
 matching provokes an error return ("bad option value") from
 \fBpcre2_substitute()\fP.
@@ -1059,6 +1227,16 @@ The \fBoffset\fP modifier sets an offset in the subject string at which
 matching starts. Its value is a number of code units, not characters.
 .
 .
+.SS "Setting an offset limit"
+.rs
+.sp
+The \fBoffset_limit\fP modifier sets a limit for unanchored matches. If a match
+cannot be found starting at or before this offset in the subject, a "no match"
+return is given. The data value is a number of code units, not characters. When
+this modifier is used, the \fBuse_offset_limit\fP modifier must have been set
+for the pattern; if not, an error is generated.
+.
+.
 .SS "Setting the size of the output vector"
 .rs
 .sp
@@ -1089,6 +1267,17 @@ When testing \fBpcre2_substitute()\fP, this modifier also has the effect of
 passing the replacement string as zero-terminated.
 .
 .
+.SS "Passing a NULL context"
+.rs
+.sp
+Normally, \fBpcre2test\fP passes a context block to \fBpcre2_match()\fP,
+\fBpcre2_dfa_match()\fP or \fBpcre2_jit_match()\fP. If the \fBnull_context\fP
+modifier is set, however, NULL is passed. This is for testing that the matching
+functions behave correctly in this case (they use default values). This
+modifier cannot be used with the \fBfind_limits\fP modifier or when testing the
+substitution function.
+.
+.
 .SH "THE ALTERNATIVE MATCHING FUNCTION"
 .rs
 .sp
@@ -1451,6 +1640,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 20 May 2015
+Last updated: 12 December 2015
 Copyright (c) 1997-2015 University of Cambridge.
 .fi
index c022a9ce5858c00d3b02c8413ab81075198c1064..d9dbc4df657cb3c4a9666539b1b3645dfab85e5c 100644 (file)
@@ -119,12 +119,13 @@ COMMAND LINE OPTIONS
                  The following options output 1 for true or 0 for  false,  and
                  set the exit code to the same value:
 
-                   ebcdic     compiled for an EBCDIC environment
-                   jit        just-in-time support is available
-                   pcre2-16   the 16-bit library was built
-                   pcre2-32   the 32-bit library was built
-                   pcre2-8    the 8-bit library was built
-                   unicode    Unicode support is available
+                   backslash-C  \C is supported (not locked out)
+                   ebcdic       compiled for an EBCDIC environment
+                   jit          just-in-time support is available
+                   pcre2-16     the 16-bit library was built
+                   pcre2-32     the 32-bit library was built
+                   pcre2-8      the 8-bit library was built
+                   unicode      Unicode support is available
 
                  If  an  unknown  option is given, an error message is output;
                  the exit code is 0.
@@ -208,134 +209,167 @@ DESCRIPTION
        or  \r\n,  etc.,  depending on the newline setting) in a single line of
        input to encode the newline sequences. There is no limit on the  length
        of  subject  lines; the input buffer is automatically extended if it is
-       too small. There is a replication feature that  makes  it  possible  to
-       generate long subject lines without having to supply them explicitly.
+       too small. There are replication features that  makes  it  possible  to
+       generate  long  repetitive  pattern  or subject lines without having to
+       supply them explicitly.
 
-       An  empty  line  or  the end of the file signals the end of the subject
-       lines for a test, at which point a  new  pattern  or  command  line  is
+       An empty line or the end of the file signals the  end  of  the  subject
+       lines  for  a  test,  at  which  point a new pattern or command line is
        expected if there is still input to be read.
 
 
 COMMAND LINES
 
-       In  between sets of test data, a line that begins with # is interpreted
+       In between sets of test data, a line that begins with # is  interpreted
        as a command line. If the first character is followed by white space or
-       an  exclamation  mark,  the  line is treated as a comment, and ignored.
+       an exclamation mark, the line is treated as  a  comment,  and  ignored.
        Otherwise, the following commands are recognized:
 
          #forbid_utf
 
-       Subsequent  patterns  automatically  have   the   PCRE2_NEVER_UTF   and
-       PCRE2_NEVER_UCP  options  set, which locks out the use of the PCRE2_UTF
-       and PCRE2_UCP options and the use of (*UTF) and (*UCP) at the start  of
-       patterns.  This  command  also  forces an error if a subsequent pattern
-       contains any occurrences of \P, \p, or \X, which  are  still  supported
-       when  PCRE2_UTF  is not set, but which require Unicode property support
+       Subsequent   patterns   automatically   have  the  PCRE2_NEVER_UTF  and
+       PCRE2_NEVER_UCP options set, which locks out the use of  the  PCRE2_UTF
+       and  PCRE2_UCP options and the use of (*UTF) and (*UCP) at the start of
+       patterns. This command also forces an error  if  a  subsequent  pattern
+       contains  any  occurrences  of \P, \p, or \X, which are still supported
+       when PCRE2_UTF is not set, but which require Unicode  property  support
        to be included in the library.
 
-       This is a trigger guard that is used in test files to ensure  that  UTF
-       or  Unicode property tests are not accidentally added to files that are
-       used when Unicode support is  not  included  in  the  library.  Setting
-       PCRE2_NEVER_UTF  and  PCRE2_NEVER_UCP as a default can also be obtained
-       by the use of #pattern; the difference is that  #forbid_utf  cannot  be
-       unset,  and the automatic options are not displayed in pattern informa-
+       This  is  a trigger guard that is used in test files to ensure that UTF
+       or Unicode property tests are not accidentally added to files that  are
+       used  when  Unicode  support  is  not  included in the library. Setting
+       PCRE2_NEVER_UTF and PCRE2_NEVER_UCP as a default can also  be  obtained
+       by  the  use  of #pattern; the difference is that #forbid_utf cannot be
+       unset, and the automatic options are not displayed in pattern  informa-
        tion, to avoid cluttering up test output.
 
          #load <filename>
 
        This command is used to load a set of precompiled patterns from a file,
-       as  described  in  the  section entitled "Saving and restoring compiled
+       as described in the section entitled  "Saving  and  restoring  compiled
        patterns" below.
 
+         #newline_default [<newline-list>]
+
+       When  PCRE2  is  built,  a default newline convention can be specified.
+       This determines which characters and/or character pairs are  recognized
+       as indicating a newline in a pattern or subject string. The default can
+       be overridden when a pattern is compiled. The standard test files  con-
+       tain  tests  of  various  newline  conventions, but the majority of the
+       tests expect a single  linefeed  to  be  recognized  as  a  newline  by
+       default. Without special action the tests would fail when PCRE2 is com-
+       piled with either CR or CRLF as the default newline.
+
+       The #newline_default command specifies a list of newline types that are
+       acceptable  as the default. The types must be one of CR, LF, CRLF, ANY-
+       CRLF, or ANY (in upper or lower case), for example:
+
+         #newline_default LF Any anyCRLF
+
+       If the default newline is in the list, this command has no effect. Oth-
+       erwise,  except  when  testing  the  POSIX API, a newline modifier that
+       specifies the first newline convention in the list  (LF  in  the  above
+       example)  is  added to any pattern that does not already have a newline
+       modifier. If the newline list is empty, the feature is turned off. This
+       command is present in a number of the standard test input files.
+
+       When  the  POSIX  API  is  being tested there is no way to override the
+       default newline convention, though it is possible to  set  the  newline
+       convention  from  within  the  pattern. A warning is given if the posix
+       modifier is used when #newline_default would set a default for the non-
+       POSIX API.
+
          #pattern <modifier-list>
 
-       This command sets a default modifier list that applies  to  all  subse-
+       This  command  sets  a default modifier list that applies to all subse-
        quent patterns. Modifiers on a pattern can change these settings.
 
          #perltest
 
-       The  appearance of this line causes all subsequent modifier settings to
+       The appearance of this line causes all subsequent modifier settings  to
        be checked for compatibility with the perltest.sh script, which is used
-       to  confirm that Perl gives the same results as PCRE2. Also, apart from
-       comment lines, none of the other command lines are  permitted,  because
-       they  and  many  of the modifiers are specific to pcre2test, and should
-       not be used in test files that are also processed by  perltest.sh.  The
-       #perltest  command  helps detect tests that are accidentally put in the
+       to confirm that Perl gives the same results as PCRE2. Also, apart  from
+       comment  lines,  none of the other command lines are permitted, because
+       they and many of the modifiers are specific to  pcre2test,  and  should
+       not  be  used in test files that are also processed by perltest.sh. The
+       #perltest command helps detect tests that are accidentally put  in  the
        wrong file.
 
          #pop [<modifiers>]
 
-       This command is used to manipulate the stack of compiled  patterns,  as
-       described  in  the section entitled "Saving and restoring compiled pat-
+       This  command  is used to manipulate the stack of compiled patterns, as
+       described in the section entitled "Saving and restoring  compiled  pat-
        terns" below.
 
          #save <filename>
 
-       This command is used to save a set of compiled patterns to a  file,  as
-       described  in  the section entitled "Saving and restoring compiled pat-
+       This  command  is used to save a set of compiled patterns to a file, as
+       described in the section entitled "Saving and restoring  compiled  pat-
        terns" below.
 
          #subject <modifier-list>
 
-       This command sets a default modifier list that applies  to  all  subse-
-       quent  subject lines. Modifiers on a subject line can change these set-
+       This  command  sets  a default modifier list that applies to all subse-
+       quent subject lines. Modifiers on a subject line can change these  set-
        tings.
 
 
 MODIFIER SYNTAX
 
        Modifier lists are used with both pattern and subject lines. Items in a
-       list  are  separated by commas and optional white space. Some modifiers
-       may be given for both patterns and subject lines,  whereas  others  are
-       valid  for  one  or  the other only. Each modifier has a long name, for
-       example "anchored", and some of them must be followed by an equals sign
-       and a value, for example, "offset=12".  Modifiers that do not take val-
-       ues may be preceded by a minus sign to turn off a previous setting.
+       list are separated by commas followed by optional white space. Trailing
+       whitespace  in  a modifier list is ignored. Some modifiers may be given
+       for both patterns and subject lines, whereas others are valid only  for
+       one  or  the  other.  Each  modifier  has  a  long  name,  for  example
+       "anchored", and some of them must be followed by an equals sign  and  a
+       value,  for  example,  "offset=12". Values cannot contain comma charac-
+       ters, but may contain spaces. Modifiers that do not take values may  be
+       preceded by a minus sign to turn off a previous setting.
 
        A few of the more common modifiers can also be specified as single let-
-       ters,  for  example "i" for "caseless". In documentation, following the
+       ters, for example "i" for "caseless". In documentation,  following  the
        Perl convention, these are written with a slash ("the /i modifier") for
-       clarity.  Abbreviated  modifiers  must all be concatenated in the first
-       item of a modifier list. If the first item is not recognized as a  long
-       modifier  name, it is interpreted as a sequence of these abbreviations.
+       clarity. Abbreviated modifiers must all be concatenated  in  the  first
+       item  of a modifier list. If the first item is not recognized as a long
+       modifier name, it is interpreted as a sequence of these  abbreviations.
        For example:
 
          /abc/ig,newline=cr,jit=3
 
-       This is a pattern line whose modifier list starts with  two  one-letter
-       modifiers  (/i  and  /g).  The lower-case abbreviated modifiers are the
+       This  is  a pattern line whose modifier list starts with two one-letter
+       modifiers (/i and /g). The lower-case  abbreviated  modifiers  are  the
        same as used in Perl.
 
 
 PATTERN SYNTAX
 
-       A pattern line must start with one of the following characters  (common
+       A  pattern line must start with one of the following characters (common
        symbols, excluding pattern meta-characters):
 
          / ! " ' ` - = _ : ; , % & @ ~
 
-       This  is  interpreted  as the pattern's delimiter. A regular expression
-       may be continued over several input lines, in which  case  the  newline
+       This is interpreted as the pattern's delimiter.  A  regular  expression
+       may  be  continued  over several input lines, in which case the newline
        characters are included within it. It is possible to include the delim-
        iter within the pattern by escaping it with a backslash, for example
 
          /abc\/def/
 
-       If you do this, the escape and the delimiter form part of the  pattern,
+       If  you do this, the escape and the delimiter form part of the pattern,
        but since the delimiters are all non-alphanumeric, this does not affect
-       its interpretation. If the terminating delimiter  is  immediately  fol-
+       its  interpretation.  If  the terminating delimiter is immediately fol-
        lowed by a backslash, for example,
 
          /abc/\
 
-       then  a  backslash  is added to the end of the pattern. This is done to
-       provide a way of testing the error condition that arises if  a  pattern
+       then a backslash is added to the end of the pattern. This  is  done  to
+       provide  a  way of testing the error condition that arises if a pattern
        finishes with a backslash, because
 
          /abc\/
 
-       is  interpreted as the first line of a pattern that starts with "abc/",
-       causing pcre2test to read the next line as a continuation of the  regu-
+       is interpreted as the first line of a pattern that starts with  "abc/",
+       causing  pcre2test to read the next line as a continuation of the regu-
        lar expression.
 
        A pattern can be followed by a modifier list (details below).
@@ -343,7 +377,7 @@ PATTERN SYNTAX
 
 SUBJECT LINE SYNTAX
 
-       Before    each   subject   line   is   passed   to   pcre2_match()   or
+       Before   each   subject   line   is   passed   to   pcre2_match()    or
        pcre2_dfa_match(), leading and trailing white space is removed, and the
        line is scanned for backslash escapes. The following provide a means of
        encoding non-printing characters in a visible way:
@@ -363,23 +397,23 @@ SUBJECT LINE SYNTAX
          \x{hh...}  hexadecimal character (any number of hex digits)
 
        The use of \x{hh...} is not dependent on the use of the utf modifier on
-       the  pattern. It is recognized always. There may be any number of hexa-
-       decimal digits inside the braces; invalid  values  provoke  error  mes-
+       the pattern. It is recognized always. There may be any number of  hexa-
+       decimal  digits  inside  the  braces; invalid values provoke error mes-
        sages.
 
-       Note  that  \xhh  specifies one byte rather than one character in UTF-8
-       mode; this makes it possible to construct invalid UTF-8  sequences  for
-       testing  purposes.  On the other hand, \x{hh} is interpreted as a UTF-8
-       character in UTF-8 mode, generating more than one byte if the value  is
-       greater  than  127.   When testing the 8-bit library not in UTF-8 mode,
+       Note that \xhh specifies one byte rather than one  character  in  UTF-8
+       mode;  this  makes it possible to construct invalid UTF-8 sequences for
+       testing purposes. On the other hand, \x{hh} is interpreted as  a  UTF-8
+       character  in UTF-8 mode, generating more than one byte if the value is
+       greater than 127.  When testing the 8-bit library not  in  UTF-8  mode,
        \x{hh} generates one byte for values less than 256, and causes an error
        for greater values.
 
        In UTF-16 mode, all 4-digit \x{hhhh} values are accepted. This makes it
        possible to construct invalid UTF-16 sequences for testing purposes.
 
-       In UTF-32 mode, all 4- to 8-digit \x{...}  values  are  accepted.  This
-       makes  it  possible  to  construct invalid UTF-32 sequences for testing
+       In  UTF-32  mode,  all  4- to 8-digit \x{...} values are accepted. This
+       makes it possible to construct invalid  UTF-32  sequences  for  testing
        purposes.
 
        There is a special backslash sequence that specifies replication of one
@@ -387,43 +421,51 @@ SUBJECT LINE SYNTAX
 
          \[<characters>]{<count>}
 
-       This  makes  it possible to test long strings without having to provide
+       This makes it possible to test long strings without having  to  provide
        them as part of the file. For example:
 
          \[abc]{4}
 
-       is converted to "abcabcabcabc". This feature does not support  nesting.
+       is  converted to "abcabcabcabc". This feature does not support nesting.
        To include a closing square bracket in the characters, code it as \x5D.
 
-       A  backslash  followed  by  an equals sign marks the end of the subject
+       A backslash followed by an equals sign marks the  end  of  the  subject
        string and the start of a modifier list. For example:
 
          abc\=notbol,notempty
 
-       A backslash followed  by  any  other  non-alphanumeric  character  just
+       If  the  subject  string is empty and \= is followed by whitespace, the
+       line is treated as a comment line, and is not used  for  matching.  For
+       example:
+
+         \= This is a comment.
+         abc\= This is an invalid modifier list.
+
+       A  backslash  followed  by  any  other  non-alphanumeric character just
        escapes that character. A backslash followed by anything else causes an
-       error. However, if the very last character in the line is  a  backslash
-       (and  there  is  no  modifier list), it is ignored. This gives a way of
-       passing an empty line as data, since a real empty line  terminates  the
+       error.  However,  if the very last character in the line is a backslash
+       (and there is no modifier list), it is ignored. This  gives  a  way  of
+       passing  an  empty line as data, since a real empty line terminates the
        data input.
 
 
 PATTERN MODIFIERS
 
-       There are three types of modifier that can appear in pattern lines, two
-       of which may also be used in a #pattern command. A  pattern's  modifier
-       list can add to or override default modifiers that were set by a previ-
-       ous #pattern command.
+       There are several types of modifier that can appear in  pattern  lines.
+       Except where noted below, they may also be used in #pattern commands. A
+       pattern's modifier list can add to or override default  modifiers  that
+       were set by a previous #pattern command.
 
    Setting compilation options
 
-       The following modifiers set options for pcre2_compile(). The most  com-
-       mon  ones  have single-letter abbreviations. See pcreapi for a descrip-
+       The  following modifiers set options for pcre2_compile(). The most com-
+       mon ones have single-letter abbreviations. See pcre2api for a  descrip-
        tion of their effects.
 
              allow_empty_class         set PCRE2_ALLOW_EMPTY_CLASS
              alt_bsux                  set PCRE2_ALT_BSUX
              alt_circumflex            set PCRE2_ALT_CIRCUMFLEX
+             alt_verbnames             set PCRE2_ALT_VERBNAMES
              anchored                  set PCRE2_ANCHORED
              auto_callout              set PCRE2_AUTO_CALLOUT
          /i  caseless                  set PCRE2_CASELESS
@@ -444,16 +486,17 @@ PATTERN MODIFIERS
              no_utf_check              set PCRE2_NO_UTF_CHECK
              ucp                       set PCRE2_UCP
              ungreedy                  set PCRE2_UNGREEDY
+             use_offset_limit          set PCRE2_USE_OFFSET_LIMIT
              utf                       set PCRE2_UTF
 
        As well as turning on the PCRE2_UTF option, the utf modifier causes all
-       non-printing  characters  in  output  strings  to  be printed using the
-       \x{hh...} notation. Otherwise, those less than 0x100 are output in  hex
+       non-printing characters in output  strings  to  be  printed  using  the
+       \x{hh...}  notation. Otherwise, those less than 0x100 are output in hex
        without the curly brackets.
 
    Setting compilation controls
 
-       The  following  modifiers  affect  the  compilation  process or request
+       The following modifiers  affect  the  compilation  process  or  request
        information about the pattern:
 
              bsr=[anycrlf|unicode]     specify \R handling
@@ -467,8 +510,10 @@ PATTERN MODIFIERS
              jitfast                   use JIT fast path
              jitverify                 verify JIT use
              locale=<name>             use this locale
+             max_pattern_length=<n>    set the maximum pattern length
              memory                    show memory used
              newline=<type>            set newline type
+             null_context              compile with a NULL context
              parens_nest_limit=<n>     set maximum parentheses depth
              posix                     use the POSIX API
              push                      push compiled pattern onto the stack
@@ -479,34 +524,34 @@ PATTERN MODIFIERS
 
    Newline and \R handling
 
-       The bsr modifier specifies what \R in a pattern should match. If it  is
-       set  to  "anycrlf",  \R  matches  CR, LF, or CRLF only. If it is set to
-       "unicode", \R matches any Unicode  newline  sequence.  The  default  is
+       The  bsr modifier specifies what \R in a pattern should match. If it is
+       set to "anycrlf", \R matches CR, LF, or CRLF only.  If  it  is  set  to
+       "unicode",  \R  matches  any  Unicode  newline sequence. The default is
        specified when PCRE2 is built, with the default default being Unicode.
 
-       The  newline  modifier specifies which characters are to be interpreted
+       The newline modifier specifies which characters are to  be  interpreted
        as newlines, both in the pattern and in subject lines. The type must be
        one of CR, LF, CRLF, ANYCRLF, or ANY (in upper or lower case).
 
    Information about a pattern
 
-       The  debug modifier is a shorthand for info,fullbincode, requesting all
+       The debug modifier is a shorthand for info,fullbincode, requesting  all
        available information.
 
        The bincode modifier causes a representation of the compiled code to be
-       output  after compilation. This information does not contain length and
+       output after compilation. This information does not contain length  and
        offset values, which ensures that the same output is generated for dif-
-       ferent  internal  link  sizes  and different code unit widths. By using
-       bincode, the same regression tests can be used  in  different  environ-
+       ferent internal link sizes and different code  unit  widths.  By  using
+       bincode,  the  same  regression tests can be used in different environ-
        ments.
 
-       The  fullbincode  modifier, by contrast, does include length and offset
-       values. This is used in a few special tests that run only for  specific
+       The fullbincode modifier, by contrast, does include length  and  offset
+       values.  This is used in a few special tests that run only for specific
        code unit widths and link sizes, and is also useful for one-off tests.
 
-       The  info  modifier  requests  information  about  the compiled pattern
-       (whether it is anchored, has a fixed first character, and so  on).  The
-       information  is  obtained  from the pcre2_pattern_info() function. Here
+       The info modifier  requests  information  about  the  compiled  pattern
+       (whether  it  is anchored, has a fixed first character, and so on). The
+       information is obtained from the  pcre2_pattern_info()  function.  Here
        are some typical examples:
 
            re> /(?i)(^a|^b)/m,info
@@ -524,21 +569,28 @@ PATTERN MODIFIERS
          Last code unit = 'c' (caseless)
          Subject length lower bound = 3
 
-       "Compile options" are those specified by modifiers;  "overall  options"
-       have  added options that are taken or deduced from the pattern. If both
-       sets of options are the same, just a single "options" line  is  output;
-       if  there  are  no  options,  the line is omitted. "First code unit" is
-       where any match must start; if there is more than one they  are  listed
-       as  "starting  code  units".  "Last code unit" is the last literal code
-       unit that must be present in any match. This  is  not  necessarily  the
-       last  character.  These lines are omitted if no starting or ending code
+       "Compile  options"  are those specified by modifiers; "overall options"
+       have added options that are taken or deduced from the pattern. If  both
+       sets  of  options are the same, just a single "options" line is output;
+       if there are no options, the line is  omitted.  "First  code  unit"  is
+       where  any  match must start; if there is more than one they are listed
+       as "starting code units". "Last code unit" is  the  last  literal  code
+       unit  that  must  be  present in any match. This is not necessarily the
+       last character. These lines are omitted if no starting or  ending  code
        units are recorded.
 
-       The callout_info modifier requests information about all  the  callouts
+       The  callout_info  modifier requests information about all the callouts
        in the pattern. A list of them is output at the end of any other infor-
        mation that is requested. For each callout, either its number or string
        is given, followed by the item that follows it in the pattern.
 
+   Passing a NULL context
+
+       Normally, pcre2test passes a context block to pcre2_compile().  If  the
+       null_context  modifier  is  set,  however,  NULL is passed. This is for
+       testing that pcre2_compile() behaves correctly in this  case  (it  uses
+       default values).
+
    Specifying a pattern in hex
 
        The hex modifier specifies that the characters of the pattern are to be
@@ -553,25 +605,75 @@ PATTERN MODIFIERS
        the length as PCRE2_ZERO_TERMINATED. However, for patterns specified in
        hexadecimal, the actual length of the pattern is passed.
 
+   Generating long repetitive patterns
+
+       Some  tests use long patterns that are very repetitive. Instead of cre-
+       ating a very long input line for such a pattern, you can use a  special
+       repetition  feature,  similar  to  the  one described for subject lines
+       above. If the expand modifier is present on a  pattern,  parts  of  the
+       pattern that have the form
+
+         \[<characters>]{<count>}
+
+       are expanded before the pattern is passed to pcre2_compile(). For exam-
+       ple, \[AB]{6000} is expanded to "ABAB..." 6000 times. This construction
+       cannot  be  nested. An initial "\[" sequence is recognized only if "]{"
+       followed by decimal digits and "}" is found later in  the  pattern.  If
+       not, the characters remain in the pattern unaltered.
+
+       If  part  of an expanded pattern looks like an expansion, but is really
+       part of the actual pattern, unwanted expansion can be avoided by giving
+       two values in the quantifier. For example, \[AB]{6000,6000} is not rec-
+       ognized as an expansion item.
+
+       If the info modifier is set on an expanded pattern, the result  of  the
+       expansion is included in the information that is output.
+
    JIT compilation
 
-       The  /jit  modifier  may optionally be followed by an equals sign and a
-       number in the range 0 to 7:
+       Just-in-time  (JIT)  compiling  is  a heavyweight optimization that can
+       greatly speed up pattern matching. See the pcre2jit  documentation  for
+       details.  JIT  compiling  happens, optionally, after a pattern has been
+       successfully compiled into an internal form. The JIT compiler  converts
+       this to optimized machine code. It needs to know whether the match-time
+       options PCRE2_PARTIAL_HARD and PCRE2_PARTIAL_SOFT are going to be used,
+       because  different  code  is generated for the different cases. See the
+       partial modifier in "Subject Modifiers" below for details of how  these
+       options are specified for each match attempt.
+
+       JIT  compilation  is  requested by the /jit pattern modifier, which may
+       optionally be followed by an equals sign and a number in the range 0 to
+       7.   The  three bits that make up the number specify which of the three
+       JIT operating modes are to be compiled:
+
+         1  compile JIT code for non-partial matching
+         2  compile JIT code for soft partial matching
+         4  compile JIT code for hard partial matching
+
+       The possible values for the /jit modifier are therefore:
 
          0  disable JIT
-         1  use JIT for normal match only
-         2  use JIT for soft partial match only
-         3  use JIT for normal match and soft partial match
-         4  use JIT for hard partial match only
-         6  use JIT for soft and hard partial match
+         1  normal matching only
+         2  soft partial matching only
+         3  normal and soft partial matching
+         4  hard partial matching only
+         6  soft and hard partial matching only
          7  all three modes
 
-       If no number is given, 7 is assumed. If JIT compilation is  successful,
-       the  compiled JIT code will automatically be used when pcre2_match() is
-       run for the appropriate type of match, except  when  incompatible  run-
-       time options are specified. For more details, see the pcre2jit documen-
-       tation. See also the jitstack modifier below for a way of  setting  the
-       size of the JIT stack.
+       If no number is given, 7 is  assumed.  The  phrase  "partial  matching"
+       means a call to pcre2_match() with either the PCRE2_PARTIAL_SOFT or the
+       PCRE2_PARTIAL_HARD option set. Note that such a call may return a  com-
+       plete match; the options enable the possibility of a partial match, but
+       do not require it. Note also that if you request JIT  compilation  only
+       for  partial  matching (for example, /jit=2) but do not set the partial
+       modifier on a subject line, that match will not use  JIT  code  because
+       none was compiled for non-partial matching.
+
+       If  JIT compilation is successful, the compiled JIT code will automati-
+       cally be used when an appropriate type of match  is  run,  except  when
+       incompatible  run-time options are specified. For more details, see the
+       pcre2jit documentation. See also the jitstack modifier below for a  way
+       of setting the size of the JIT stack.
 
        If  the  jitfast  modifier is specified, matching is done using the JIT
        "fast path" interface, pcre2_jit_match(), which skips some of the  san-
@@ -621,12 +723,21 @@ PATTERN MODIFIERS
        pcre2test  sets  its  own default of 220, which is required for running
        the standard test suite.
 
+   Limiting the pattern length
+
+       The max_pattern_length modifier sets a limit, in  code  units,  to  the
+       length of pattern that pcre2_compile() will accept. Breaching the limit
+       causes a compilation  error.  The  default  is  the  largest  number  a
+       PCRE2_SIZE variable can hold (essentially unlimited).
+
    Using the POSIX wrapper API
 
-       The /posix modifier causes pcre2test to call PCRE2 via the POSIX  wrap-
-       per  API  rather  than  its  native  API.  This supports only the 8-bit
-       library.  When the POSIX API is being used, the following pattern modi-
-       fiers set options for the regcomp() function:
+       The  /posix modifier causes pcre2test to call PCRE2 via the POSIX wrap-
+       per API rather than its  native  API.  This  supports  only  the  8-bit
+       library.   Note  that  it  does not imply POSIX matching semantics; for
+       more detail see the pcre2posix documentation. When  the  POSIX  API  is
+       being  used,  the  following pattern modifiers set options for the reg-
+       comp() function:
 
          caseless           REG_ICASE
          multiline          REG_NEWLINE
@@ -636,24 +747,34 @@ PATTERN MODIFIERS
          ucp                REG_UCP        )   the POSIX standard
          utf                REG_UTF8       )
 
-       The  aftertext  and  allaftertext  subject  modifiers work as described
+       The regerror_buffsize modifier specifies a size for  the  error  buffer
+       that  is  passed to regerror() in the event of a compilation error. For
+       example:
+
+         /abc/posix,regerror_buffsize=20
+
+       This provides a means of testing the behaviour of regerror()  when  the
+       buffer  is  too  small  for the error message. If this modifier has not
+       been set, a large buffer is used.
+
+       The aftertext and allaftertext  subject  modifiers  work  as  described
        below. All other modifiers cause an error.
 
    Testing the stack guard feature
 
-       The /stackguard modifier is used to  test  the  use  of  pcre2_set_com-
-       pile_recursion_guard(),  a  function  that  is provided to enable stack
-       availability to be checked during compilation (see the  pcre2api  docu-
-       mentation  for  details).  If  the  number specified by the modifier is
+       The  /stackguard  modifier  is  used  to test the use of pcre2_set_com-
+       pile_recursion_guard(), a function that is  provided  to  enable  stack
+       availability  to  be checked during compilation (see the pcre2api docu-
+       mentation for details). If the number  specified  by  the  modifier  is
        greater than zero, pcre2_set_compile_recursion_guard() is called to set
-       up  callback  from pcre2_compile() to a local function. The argument it
-       receives is the current nesting parenthesis depth; if this  is  greater
+       up callback from pcre2_compile() to a local function. The  argument  it
+       receives  is  the current nesting parenthesis depth; if this is greater
        than the value given by the modifier, non-zero is returned, causing the
        compilation to be aborted.
 
    Using alternative character tables
 
-       The value specified for the /tables modifier must be one of the  digits
+       The  value specified for the /tables modifier must be one of the digits
        0, 1, or 2. It causes a specific set of built-in character tables to be
        passed to pcre2_compile(). This is used in the PCRE2 tests to check be-
        haviour with different character tables. The digit specifies the tables
@@ -664,25 +785,30 @@ PATTERN MODIFIERS
                pcre2_chartables.c.dist
          2   a set of tables defining ISO 8859 characters
 
-       In table 2, some characters whose codes are greater than 128 are  iden-
-       tified  as  letters,  digits,  spaces, etc. Setting alternate character
+       In  table 2, some characters whose codes are greater than 128 are iden-
+       tified as letters, digits, spaces,  etc.  Setting  alternate  character
        tables and a locale are mutually exclusive.
 
    Setting certain match controls
 
        The following modifiers are really subject modifiers, and are described
-       below.   However, they may be included in a pattern's modifier list, in
-       which case they are applied to every subject  line  that  is  processed
-       with that pattern. They do not affect the compilation process.
-
-             aftertext           show text after match
-             allaftertext        show text after captures
-             allcaptures         show all captures
-             allusedtext         show all consulted text
-         /g  global              global matching
-             mark                show mark values
-             replace=<string>    specify a replacement string
-             startchar           show starting character when relevant
+       below.  However, they may be included in a pattern's modifier list,  in
+       which  case  they  are  applied to every subject line that is processed
+       with that pattern. They may not appear in #pattern commands. These mod-
+       ifiers do not affect the compilation process.
+
+             aftertext                  show text after match
+             allaftertext               show text after captures
+             allcaptures                show all captures
+             allusedtext                show all consulted text
+         /g  global                     global matching
+             mark                       show mark values
+             replace=<string>           specify a replacement string
+             startchar                  show starting character when relevant
+             substitute_extended        use PCRE2_SUBSTITUTE_EXTENDED
+             substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+             substitute_unknown_unset   use PCRE2_SUBSTITUTE_UNKNOWN_UNSET
+             substitute_unset_empty     use PCRE2_SUBSTITUTE_UNSET_EMPTY
 
        These  modifiers may not appear in a #pattern command. If you want them
        as defaults, set them in a #subject command.
@@ -738,31 +864,38 @@ SUBJECT MODIFIERS
        line (see above), in which case they apply to every subject  line  that
        is matched against that pattern.
 
-             aftertext                 show text after match
-             allaftertext              show text after captures
-             allcaptures               show all captures
-             allusedtext               show all consulted text (non-JIT only)
-             altglobal                 alternative global matching
-             callout_capture           show captures at callout time
-             callout_data=<n>          set a value to pass via callouts
-             callout_fail=<n>[:<m>]    control callout failure
-             callout_none              do not supply a callout function
-             copy=<number or name>     copy captured substring
-             dfa                       use pcre2_dfa_match()
-             find_limits               find match and recursion limits
-             get=<number or name>      extract captured substring
-             getall                    extract all captured substrings
-         /g  global                    global matching
-             jitstack=<n>              set size of JIT stack
-             mark                      show mark values
-             match_limit=>n>           set a match limit
-             memory                    show memory usage
-             offset=<n>                set starting offset
-             ovector=<n>               set size of output vector
-             recursion_limit=<n>       set a recursion limit
-             replace=<string>          specify a replacement string
-             startchar                 show startchar when relevant
-             zero_terminate            pass the subject as zero-terminated
+             aftertext                  show text after match
+             allaftertext               show text after captures
+             allcaptures                show all captures
+             allusedtext                show all consulted text (non-JIT only)
+             altglobal                  alternative global matching
+             callout_capture            show captures at callout time
+             callout_data=<n>           set a value to pass via callouts
+             callout_fail=<n>[:<m>]     control callout failure
+             callout_none               do not supply a callout function
+             copy=<number or name>      copy captured substring
+             dfa                        use pcre2_dfa_match()
+             find_limits                find match and recursion limits
+             get=<number or name>       extract captured substring
+             getall                     extract all captured substrings
+         /g  global                     global matching
+             jitstack=<n>               set size of JIT stack
+             mark                       show mark values
+             match_limit=<n>            set a match limit
+             memory                     show memory usage
+             null_context               match with a NULL context
+             offset=<n>                 set starting offset
+             offset_limit=<n>           set offset limit
+             ovector=<n>                set size of output vector
+             recursion_limit=<n>        set a recursion limit
+             replace=<string>           specify a replacement string
+             startchar                  show startchar when relevant
+             startoffset=<n>            same as offset=<n>
+             substitute_extedded        use PCRE2_SUBSTITUTE_EXTENDED
+             substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+             substitute_unknown_unset   use PCRE2_SUBSTITUTE_UNKNOWN_UNSET
+             substitute_unset_empty     use PCRE2_SUBSTITUTE_UNSET_EMPTY
+             zero_terminate             pass the subject as zero-terminated
 
        The effects of these modifiers are described in the following sections.
 
@@ -887,19 +1020,30 @@ SUBJECT MODIFIERS
    Testing the substitution function
 
        If  the  replace  modifier  is  set, the pcre2_substitute() function is
-       called instead  of  one  of  the  matching  functions.  Unlike  subject
-       strings,  pcre2test  does  not  process  replacement strings for escape
-       sequences. In UTF mode, a replacement string is checked to see if it is
-       a valid UTF-8 string.  If so, it is correctly converted to a UTF string
-       of the appropriate code unit width. If it is not a valid UTF-8  string,
-       the individual code units are copied directly. This provides a means of
-       passing an invalid UTF-8 string for testing purposes.
-
-       If the global modifier is set,  PCRE2_SUBSTITUTE_GLOBAL  is  passed  to
-       pcre2_substitute().  After  a  successful  substitution,  the  modified
-       string is output, preceded by the number of replacements. This  may  be
-       zero  if there were no matches. Here is a simple example of a substitu-
-       tion test:
+       called instead of one of the matching functions. Note that  replacement
+       strings  cannot  contain commas, because a comma signifies the end of a
+       modifier. This is not thought to be an issue in a test program.
+
+       Unlike subject strings, pcre2test does not process replacement  strings
+       for  escape  sequences. In UTF mode, a replacement string is checked to
+       see if it is a valid UTF-8 string. If so, it is correctly converted  to
+       a  UTF  string of the appropriate code unit width. If it is not a valid
+       UTF-8 string, the individual code units are copied directly. This  pro-
+       vides a means of passing an invalid UTF-8 string for testing purposes.
+
+       The  following modifiers set options (in additional to the normal match
+       options) for pcre2_substitute():
+
+         global                      PCRE2_SUBSTITUTE_GLOBAL
+         substitute_extended         PCRE2_SUBSTITUTE_EXTENDED
+         substitute_overflow_length  PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+         substitute_unknown_unset    PCRE2_SUBSTITUTE_UNKNOWN_UNSET
+         substitute_unset_empty      PCRE2_SUBSTITUTE_UNSET_EMPTY
+
+
+       After a successful substitution, the modified string  is  output,  pre-
+       ceded  by the number of replacements. This may be zero if there were no
+       matches. Here is a simple example of a substitution test:
 
          /abc/replace=xxx
              =abc=abc=
@@ -907,12 +1051,13 @@ SUBJECT MODIFIERS
              =abc=abc=\=global
           2: =xxx=xxx=
 
-       Subject and replacement strings should be  kept  relatively  short  for
-       substitution  tests, as fixed-size buffers are used. To make it easy to
-       test for buffer overflow, if the replacement string starts with a  num-
-       ber  in square brackets, that number is passed to pcre2_substitute() as
-       the size of the output buffer, with the replacement string starting  at
-       the next character. Here is an example that tests the edge case:
+       Subject and replacement strings should be kept relatively short  (fewer
+       than  256 characters) for substitution tests, as fixed-size buffers are
+       used. To make it easy to test for buffer overflow, if  the  replacement
+       string  starts  with a number in square brackets, that number is passed
+       to pcre2_substitute() as the  size  of  the  output  buffer,  with  the
+       replacement  string  starting at the next character. Here is an example
+       that tests the edge case:
 
          /abc/
              123abc123\=replace=[10]XYZ
@@ -920,6 +1065,19 @@ SUBJECT MODIFIERS
              123abc123\=replace=[9]XYZ
          Failed: error -47: no more memory
 
+       The   default   action   of    pcre2_substitute()    is    to    return
+       PCRE2_ERROR_NOMEMORY  when  the output buffer is too small. However, if
+       the PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option is set (by using  the  sub-
+       stitute_overflow_length  modifier),  pcre2_substitute() continues to go
+       through the motions of matching and substituting, in order  to  compute
+       the size of buffer that is required. When this happens, pcre2test shows
+       the required buffer length (which includes space for the trailing zero)
+       as part of the error message. For example:
+
+         /abc/substitute_overflow_length
+             123abc123\=replace=[9]XYZ
+         Failed: error -47: no more memory: 10 code units are needed
+
        A replacement string is ignored with POSIX and DFA matching. Specifying
        partial matching provokes an error return  ("bad  option  value")  from
        pcre2_substitute().
@@ -978,6 +1136,14 @@ SUBJECT MODIFIERS
        The  offset  modifier  sets  an  offset  in the subject string at which
        matching starts. Its value is a number of code units, not characters.
 
+   Setting an offset limit
+
+       The offset_limit modifier sets a limit for  unanchored  matches.  If  a
+       match cannot be found starting at or before this offset in the subject,
+       a "no match" return is given. The data value is a number of code units,
+       not  characters. When this modifier is used, the use_offset_limit modi-
+       fier must have been set for the pattern; if not, an error is generated.
+
    Setting the size of the output vector
 
        The ovector modifier applies only to  the  subject  line  in  which  it
@@ -1005,39 +1171,48 @@ SUBJECT MODIFIERS
        When testing pcre2_substitute(), this modifier also has the  effect  of
        passing the replacement string as zero-terminated.
 
+   Passing a NULL context
+
+       Normally,   pcre2test   passes   a   context  block  to  pcre2_match(),
+       pcre2_dfa_match() or pcre2_jit_match(). If the null_context modifier is
+       set,  however,  NULL  is  passed. This is for testing that the matching
+       functions behave correctly in this case (they use default values). This
+       modifier  cannot  be used with the find_limits modifier or when testing
+       the substitution function.
+
 
 THE ALTERNATIVE MATCHING FUNCTION
 
-       By  default,  pcre2test  uses  the  standard  PCRE2  matching function,
+       By default,  pcre2test  uses  the  standard  PCRE2  matching  function,
        pcre2_match() to match each subject line. PCRE2 also supports an alter-
-       native  matching  function, pcre2_dfa_match(), which operates in a dif-
-       ferent way, and has some restrictions. The differences between the  two
+       native matching function, pcre2_dfa_match(), which operates in  a  dif-
+       ferent  way, and has some restrictions. The differences between the two
        functions are described in the pcre2matching documentation.
 
-       If  the dfa modifier is set, the alternative matching function is used.
-       This function finds all possible matches at a given point in  the  sub-
-       ject.  If,  however, the dfa_shortest modifier is set, processing stops
-       after the first match is found. This is always  the  shortest  possible
+       If the dfa modifier is set, the alternative matching function is  used.
+       This  function  finds all possible matches at a given point in the sub-
+       ject. If, however, the dfa_shortest modifier is set,  processing  stops
+       after  the  first  match is found. This is always the shortest possible
        match.
 
 
 DEFAULT OUTPUT FROM pcre2test
 
-       This  section  describes  the output when the normal matching function,
+       This section describes the output when the  normal  matching  function,
        pcre2_match(), is being used.
 
-       When a match succeeds, pcre2test outputs  the  list  of  captured  sub-
-       strings,  starting  with number 0 for the string that matched the whole
-       pattern.   Otherwise,  it  outputs  "No  match"  when  the  return   is
-       PCRE2_ERROR_NOMATCH,  or  "Partial  match:"  followed  by the partially
-       matching substring when the return is PCRE2_ERROR_PARTIAL.  (Note  that
-       this  is  the  entire  substring  that was inspected during the partial
-       match; it may include characters before the actual  match  start  if  a
+       When  a  match  succeeds,  pcre2test  outputs the list of captured sub-
+       strings, starting with number 0 for the string that matched  the  whole
+       pattern.    Otherwise,  it  outputs  "No  match"  when  the  return  is
+       PCRE2_ERROR_NOMATCH, or "Partial  match:"  followed  by  the  partially
+       matching  substring  when the return is PCRE2_ERROR_PARTIAL. (Note that
+       this is the entire substring that  was  inspected  during  the  partial
+       match;  it  may  include  characters before the actual match start if a
        lookbehind assertion, \K, \b, or \B was involved.)
 
        For any other return, pcre2test outputs the PCRE2 negative error number
-       and a short descriptive phrase. If the error is  a  failed  UTF  string
-       check,  the  code  unit offset of the start of the failing character is
+       and  a  short  descriptive  phrase. If the error is a failed UTF string
+       check, the code unit offset of the start of the  failing  character  is
        also output. Here is an example of an interactive pcre2test run.
 
          $ pcre2test
@@ -1053,8 +1228,8 @@ DEFAULT OUTPUT FROM pcre2test
        Unset capturing substrings that are not followed by one that is set are
        not shown by pcre2test unless the allcaptures modifier is specified. In
        the following example, there are two capturing substrings, but when the
-       first  data  line is matched, the second, unset substring is not shown.
-       An "internal" unset substring is shown as "<unset>", as for the  second
+       first data line is matched, the second, unset substring is  not  shown.
+       An  "internal" unset substring is shown as "<unset>", as for the second
        data line.
 
            re> /(a)|(b)/
@@ -1066,11 +1241,11 @@ DEFAULT OUTPUT FROM pcre2test
           1: <unset>
           2: b
 
-       If  the strings contain any non-printing characters, they are output as
-       \xhh escapes if the value is less than 256 and UTF  mode  is  not  set.
+       If the strings contain any non-printing characters, they are output  as
+       \xhh  escapes  if  the  value is less than 256 and UTF mode is not set.
        Otherwise they are output as \x{hh...} escapes. See below for the defi-
-       nition of non-printing characters. If the /aftertext modifier  is  set,
-       the  output  for substring 0 is followed by the the rest of the subject
+       nition  of  non-printing characters. If the /aftertext modifier is set,
+       the output for substring 0 is followed by the the rest of  the  subject
        string, identified by "0+" like this:
 
            re> /cat/aftertext
@@ -1078,7 +1253,7 @@ DEFAULT OUTPUT FROM pcre2test
           0: cat
           0+ aract
 
-       If global matching is requested, the  results  of  successive  matching
+       If  global  matching  is  requested, the results of successive matching
        attempts are output in sequence, like this:
 
            re> /\Bi(\w\w)/g
@@ -1090,8 +1265,8 @@ DEFAULT OUTPUT FROM pcre2test
           0: ipp
           1: pp
 
-       "No  match" is output only if the first match attempt fails. Here is an
-       example of a failure message (the offset 4 that  is  specified  by  the
+       "No match" is output only if the first match attempt fails. Here is  an
+       example  of  a  failure  message (the offset 4 that is specified by the
        offset modifier is past the end of the subject string):
 
            re> /xyz/
@@ -1099,7 +1274,7 @@ DEFAULT OUTPUT FROM pcre2test
          Error -24 (bad offset value)
 
        Note that whereas patterns can be continued over several lines (a plain
-       ">" prompt is used for continuations), subject lines may  not.  However
+       ">"  prompt  is used for continuations), subject lines may not. However
        newlines can be included in a subject by means of the \n escape (or \r,
        \r\n, etc., depending on the newline sequence setting).
 
@@ -1107,7 +1282,7 @@ DEFAULT OUTPUT FROM pcre2test
 OUTPUT FROM THE ALTERNATIVE MATCHING FUNCTION
 
        When the alternative matching function, pcre2_dfa_match(), is used, the
-       output  consists  of  a list of all the matches that start at the first
+       output consists of a list of all the matches that start  at  the  first
        point in the subject where there is at least one match. For example:
 
            re> /(tang|tangerine|tan)/
@@ -1116,11 +1291,11 @@ OUTPUT FROM THE ALTERNATIVE MATCHING FUNCTION
           1: tang
           2: tan
 
-       Using the normal matching function on this data finds only "tang".  The
-       longest  matching  string  is  always  given first (and numbered zero).
-       After a PCRE2_ERROR_PARTIAL return, the  output  is  "Partial  match:",
-       followed  by  the  partially  matching substring. Note that this is the
-       entire substring that was inspected during the partial  match;  it  may
+       Using  the normal matching function on this data finds only "tang". The
+       longest matching string is always  given  first  (and  numbered  zero).
+       After  a  PCRE2_ERROR_PARTIAL  return,  the output is "Partial match:",
+       followed by the partially matching substring. Note  that  this  is  the
+       entire  substring  that  was inspected during the partial match; it may
        include characters before the actual match start if a lookbehind asser-
        tion, \b, or \B was involved. (\K is not supported for DFA matching.)
 
@@ -1136,16 +1311,16 @@ OUTPUT FROM THE ALTERNATIVE MATCHING FUNCTION
           1: tan
           0: tan
 
-       The  alternative  matching function does not support substring capture,
-       so the modifiers that are concerned with captured  substrings  are  not
+       The alternative matching function does not support  substring  capture,
+       so  the  modifiers  that are concerned with captured substrings are not
        relevant.
 
 
 RESTARTING AFTER A PARTIAL MATCH
 
-       When  the  alternative matching function has given the PCRE2_ERROR_PAR-
+       When the alternative matching function has given  the  PCRE2_ERROR_PAR-
        TIAL return, indicating that the subject partially matched the pattern,
-       you  can restart the match with additional subject data by means of the
+       you can restart the match with additional subject data by means of  the
        dfa_restart modifier. For example:
 
            re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
@@ -1154,44 +1329,44 @@ RESTARTING AFTER A PARTIAL MATCH
          data> n05\=dfa,dfa_restart
           0: n05
 
-       For further information about partial matching,  see  the  pcre2partial
+       For  further  information  about partial matching, see the pcre2partial
        documentation.
 
 
 CALLOUTS
 
        If the pattern contains any callout requests, pcre2test's callout func-
-       tion is called during matching unless callout_none is specified.   This
+       tion  is called during matching unless callout_none is specified.  This
        works with both matching functions.
 
-       The  callout  function in pcre2test returns zero (carry on matching) by
-       default, but you can use a callout_fail modifier in a subject line  (as
+       The callout function in pcre2test returns zero (carry on  matching)  by
+       default,  but you can use a callout_fail modifier in a subject line (as
        described above) to change this and other parameters of the callout.
 
        Inserting callouts can be helpful when using pcre2test to check compli-
-       cated regular expressions. For further information about callouts,  see
+       cated  regular expressions. For further information about callouts, see
        the pcre2callout documentation.
 
-       The  output for callouts with numerical arguments and those with string
+       The output for callouts with numerical arguments and those with  string
        arguments is slightly different.
 
    Callouts with numerical arguments
 
        By default, the callout function displays the callout number, the start
-       and  current positions in the subject text at the callout time, and the
+       and current positions in the subject text at the callout time, and  the
        next pattern item to be tested. For example:
 
          --->pqrabcdef
            0    ^  ^     \d
 
-       This output indicates that  callout  number  0  occurred  for  a  match
-       attempt  starting  at  the fourth character of the subject string, when
-       the pointer was at the seventh character, and  when  the  next  pattern
-       item  was  \d.  Just  one circumflex is output if the start and current
+       This  output  indicates  that  callout  number  0  occurred for a match
+       attempt starting at the fourth character of the  subject  string,  when
+       the  pointer  was  at  the seventh character, and when the next pattern
+       item was \d. Just one circumflex is output if  the  start  and  current
        positions are the same.
 
        Callouts numbered 255 are assumed to be automatic callouts, inserted as
-       a  result  of the /auto_callout pattern modifier. In this case, instead
+       a result of the /auto_callout pattern modifier. In this  case,  instead
        of showing the callout number, the offset in the pattern, preceded by a
        plus, is output. For example:
 
@@ -1205,7 +1380,7 @@ CALLOUTS
           0: E*
 
        If a pattern contains (*MARK) items, an additional line is output when-
-       ever a change of latest mark is passed to  the  callout  function.  For
+       ever  a  change  of  latest mark is passed to the callout function. For
        example:
 
            re> /a(*MARK:X)bc/auto_callout
@@ -1219,17 +1394,17 @@ CALLOUTS
          +12 ^  ^
           0: abc
 
-       The  mark  changes between matching "a" and "b", but stays the same for
-       the rest of the match, so nothing more is output. If, as  a  result  of
-       backtracking,  the  mark  reverts to being unset, the text "<unset>" is
+       The mark changes between matching "a" and "b", but stays the  same  for
+       the  rest  of  the match, so nothing more is output. If, as a result of
+       backtracking, the mark reverts to being unset, the  text  "<unset>"  is
        output.
 
    Callouts with string arguments
 
        The output for a callout with a string argument is similar, except that
-       instead  of outputting a callout number before the position indicators,
-       the callout string and its offset in  the  pattern  string  are  output
-       before  the reflection of the subject string, and the subject string is
+       instead of outputting a callout number before the position  indicators,
+       the  callout  string  and  its  offset in the pattern string are output
+       before the reflection of the subject string, and the subject string  is
        reflected for each callout. For example:
 
            re> /^ab(?C'first')cd(?C"second")ef/
@@ -1246,59 +1421,59 @@ CALLOUTS
 NON-PRINTING CHARACTERS
 
        When pcre2test is outputting text in the compiled version of a pattern,
-       bytes  other  than 32-126 are always treated as non-printing characters
+       bytes other than 32-126 are always treated as  non-printing  characters
        and are therefore shown as hex escapes.
 
-       When pcre2test is outputting text that is a matched part of  a  subject
-       string,  it behaves in the same way, unless a different locale has been
-       set for the pattern (using the /locale modifier).  In  this  case,  the
-       isprint()  function  is  used  to distinguish printing and non-printing
+       When  pcre2test  is outputting text that is a matched part of a subject
+       string, it behaves in the same way, unless a different locale has  been
+       set  for  the  pattern  (using the /locale modifier). In this case, the
+       isprint() function is used to  distinguish  printing  and  non-printing
        characters.
 
 
 SAVING AND RESTORING COMPILED PATTERNS
 
-       It is possible to save compiled patterns  on  disc  or  elsewhere,  and
+       It  is  possible  to  save  compiled patterns on disc or elsewhere, and
        reload them later, subject to a number of restrictions. JIT data cannot
-       be saved. The host on which the patterns are reloaded must  be  running
+       be  saved.  The host on which the patterns are reloaded must be running
        the same version of PCRE2, with the same code unit width, and must also
-       have the same endianness, pointer width  and  PCRE2_SIZE  type.  Before
-       compiled  patterns  can be saved they must be serialized, that is, con-
-       verted to a stream of bytes. A single byte stream may contain any  num-
-       ber  of  compiled  patterns,  but  they must all use the same character
+       have  the  same  endianness,  pointer width and PCRE2_SIZE type. Before
+       compiled patterns can be saved they must be serialized, that  is,  con-
+       verted  to a stream of bytes. A single byte stream may contain any num-
+       ber of compiled patterns, but they must  all  use  the  same  character
        tables. A single copy of the tables is included in the byte stream (its
        size is 1088 bytes).
 
-       The  functions  whose  names  begin  with pcre2_serialize_ are used for
-       serializing and de-serializing. They are described in the  pcre2serial-
+       The functions whose names begin  with  pcre2_serialize_  are  used  for
+       serializing  and de-serializing. They are described in the pcre2serial-
        ize  documentation.  In  this  section  we  describe  the  features  of
        pcre2test that can be used to test these functions.
 
-       When a pattern with push  modifier  is  successfully  compiled,  it  is
-       pushed  onto  a  stack  of compiled patterns, and pcre2test expects the
-       next line to contain a new pattern (or command) instead  of  a  subject
+       When  a  pattern  with  push  modifier  is successfully compiled, it is
+       pushed onto a stack of compiled patterns,  and  pcre2test  expects  the
+       next  line  to  contain a new pattern (or command) instead of a subject
        line. By this means, a number of patterns can be compiled and retained.
-       The push modifier is incompatible with  posix,  and  control  modifiers
+       The  push  modifier  is  incompatible with posix, and control modifiers
        that act at match time are ignored (with a message). The jitverify mod-
        ifier applies only at compile time. The command
 
          #save <filename>
 
        causes all the stacked patterns to be serialized and the result written
-       to  the named file. Afterwards, all the stacked patterns are freed. The
+       to the named file. Afterwards, all the stacked patterns are freed.  The
        command
 
          #load <filename>
 
-       reads the data in the file, and then arranges for it to  be  de-serial-
-       ized,  with the resulting compiled patterns added to the pattern stack.
-       The pattern on the top of the stack can be retrieved by the  #pop  com-
-       mand,  which  must  be  followed  by  lines  of subjects that are to be
-       matched with the pattern, terminated as usual by an empty line  or  end
-       of  file.  This  command  may be followed by a modifier list containing
-       only control modifiers that act after a pattern has been  compiled.  In
-       particular,  hex,  posix, and push are not allowed, nor are any option-
-       setting modifiers.  The JIT modifiers are, however permitted.  Here  is
+       reads  the  data in the file, and then arranges for it to be de-serial-
+       ized, with the resulting compiled patterns added to the pattern  stack.
+       The  pattern  on the top of the stack can be retrieved by the #pop com-
+       mand, which must be followed by  lines  of  subjects  that  are  to  be
+       matched  with  the pattern, terminated as usual by an empty line or end
+       of file. This command may be followed by  a  modifier  list  containing
+       only  control  modifiers that act after a pattern has been compiled. In
+       particular, hex, posix, and push are not allowed, nor are  any  option-
+       setting  modifiers.   The JIT modifiers are, however permitted. Here is
        an example that saves and reloads two patterns.
 
          /abc/push
@@ -1311,7 +1486,7 @@ SAVING AND RESTORING COMPILED PATTERNS
          #pop jit,bincode
          abc
 
-       If  jitverify  is  used with #pop, it does not automatically imply jit,
+       If jitverify is used with #pop, it does not  automatically  imply  jit,
        which is different behaviour from when it is used on a pattern.
 
 
@@ -1330,5 +1505,5 @@ AUTHOR
 
 REVISION
 
-       Last updated: 20 May 2015
+       Last updated: 12 December 2015
        Copyright (c) 1997-2015 University of Cambridge.
index 6c32bc0461fc4509a05b2a7a34adc77b9b65e965..59e226e3067342d44f5ce14881ac4281a209e8bb 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2UNICODE 3 "23 November 2014" "PCRE2 10.00"
+.TH PCRE2UNICODE 3 "16 October 2015" "PCRE2 10.21"
 .SH NAME
 PCRE - Perl-compatible regular expressions (revised API)
 .SH "UNICODE AND UTF SUPPORT"
@@ -63,11 +63,12 @@ characters (see the description of \eC in the
 .\" HREF
 \fBpcre2pattern\fP
 .\"
-documentation). The use of \eC is not supported in the alternative matching
-function \fBpcre2_dfa_match()\fP, nor is it supported in UTF mode by the JIT
-optimization. If JIT optimization is requested for a UTF pattern that contains
-\eC, it will not succeed, and so the matching will be carried out by the normal
-interpretive function.
+documentation). The use of \eC is not supported by the alternative matching
+function \fBpcre2_dfa_match()\fP when in UTF mode. Its use provokes a
+match-time error. The JIT optimization also does not support \eC in UTF mode.
+If JIT optimization is requested for a UTF pattern that contains \eC, it will
+not succeed, and so the matching will be carried out by the normal interpretive
+function.
 .P
 The character escapes \eb, \eB, \ed, \eD, \es, \eS, \ew, and \eW correctly test
 characters of any code value, but, by default, the characters that PCRE2
@@ -117,11 +118,21 @@ UTF-16 and UTF-32 strings can indicate their endianness by special code knows
 as a byte-order mark (BOM). The PCRE2 functions do not handle this, expecting
 strings to be in host byte order.
 .P
-The entire string is checked before any other processing takes place. In
-addition to checking the format of the string, there is a check to ensure that
-all code points lie in the range U+0 to U+10FFFF, excluding the surrogate area.
-The so-called "non-character" code points are not excluded because Unicode
-corrigendum #9 makes it clear that they should not be.
+A UTF string is checked before any other processing takes place. In the case of
+\fBpcre2_match()\fP and \fBpcre2_dfa_match()\fP calls with a non-zero starting
+offset, the check is applied only to that part of the subject that could be
+inspected during matching, and there is a check that the starting offset points
+to the first code unit of a character or to the end of the subject. If there
+are no lookbehind assertions in the pattern, the check starts at the starting
+offset. Otherwise, it starts at the length of the longest lookbehind before the
+starting offset, or at the start of the subject if there are not that many
+characters before the starting offset. Note that the sequences \eb and \eB are
+one-character lookbehinds.
+.P
+In addition to checking the format of the string, there is a check to ensure
+that all code points lie in the range U+0 to U+10FFFF, excluding the surrogate
+area. The so-called "non-character" code points are not excluded because
+Unicode corrigendum #9 makes it clear that they should not be.
 .P
 Characters in the "Surrogate Area" of Unicode are reserved for use by UTF-16,
 where they are used in pairs to encode code points with values greater than
@@ -252,6 +263,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 23 November 2014
-Copyright (c) 1997-2014 University of Cambridge.
+Last updated: 16 October 2015
+Copyright (c) 1997-2015 University of Cambridge.
 .fi
index f011ccc99b6f3132fb3b9a09cc32c9efe3e96a56..9cf7b17f73ba08086eeeffdf56560c88f30f5bce 100755 (executable)
@@ -204,12 +204,14 @@ for (;;)
     printf "data> " if $interact;
     last NEXT_RE if ! ($_ = <$infile>);
     chomp;
-    printf $outfile "$_\n" if ! $interact;
+    printf $outfile "%s", "$_\n" if ! $interact;
 
     s/\s+$//;  # Remove trailing space
     s/^\s+//;  # Remove leading space
 
     last if ($_ eq "");
+    next if $_ =~ /^\\=(?:\s|$)/;   # Comment line
+
     $x = eval "\"$_\"";   # To get escapes processed
 
     # Empty array for holding results, ensure $REGERROR and $REGMARK are
index 0f9da50ce3d60c56235d5643cc0aeeace66ddd22..744f19898f7466dc15f7ad6f5516ada6f444c7ff 100644 (file)
@@ -182,6 +182,9 @@ sure both macros are undefined; an emulation function will then be used. */
 #define MAX_NAME_SIZE 32
 #endif
 
+/* Defining NEVER_BACKSLASH_C locks out the use of \C in all patterns. */
+/* #undef NEVER_BACKSLASH_C */
+
 /* The value of NEWLINE_DEFAULT determines the default newline character
    sequence. PCRE2 client programs can override this by selecting other values
    at run time. The valid values are 1 (CR), 2 (LF), 3 (CRLF), 4 (ANY), and 5
@@ -200,7 +203,7 @@ sure both macros are undefined; an emulation function will then be used. */
 #define PACKAGE_NAME "PCRE2"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "PCRE2 10.20"
+#define PACKAGE_STRING "PCRE2 10.21"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "pcre2"
@@ -209,7 +212,7 @@ sure both macros are undefined; an emulation function will then be used. */
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "10.20"
+#define PACKAGE_VERSION "10.21"
 
 /* The value of PARENS_NEST_LIMIT specifies the maximum depth of nested
    parentheses (of any kind) in a pattern. This limits the amount of system
@@ -290,7 +293,7 @@ sure both macros are undefined; an emulation function will then be used. */
 /* #undef SUPPORT_VALGRIND */
 
 /* Version number of package */
-#define VERSION "10.20"
+#define VERSION "10.21"
 
 /* Define to empty if `const' does not conform to ANSI C. */
 /* #undef const */
index e3ef2fddc106d42adfed0ec1588a65cc8e4d8fd4..e55d0a04842dc0fc31310c0fc900ea80b41047ba 100644 (file)
@@ -169,6 +169,9 @@ sure both macros are undefined; an emulation function will then be used. */
    overflow caused by enormously large patterns. */
 #undef MAX_NAME_SIZE
 
+/* Defining NEVER_BACKSLASH_C locks out the use of \C in all patterns. */
+#undef NEVER_BACKSLASH_C
+
 /* The value of NEWLINE_DEFAULT determines the default newline character
    sequence. PCRE2 client programs can override this by selecting other values
    at run time. The valid values are 1 (CR), 2 (LF), 3 (CRLF), 4 (ANY), and 5
index b6417cc2e208596755ea647fbe821d5f04a7760b..dfb90b594a4512329e1eb58db20011cf18877533 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -102,7 +102,7 @@ fprintf(f,
   "/* This file was automatically written by the dftables auxiliary\n"
   "program. It contains character tables that are used when no external\n"
   "tables are passed to PCRE2 by the application that calls it. The tables\n"
-  "are used only for characters whose code values are less than 256.\n\n");
+  "are used only for characters whose code values are less than 256. */\n\n");
 
 /* Force config.h in z/OS */
 
@@ -115,7 +115,7 @@ fprintf(f,
 #endif
 
 fprintf(f,
-  "The following #includes are present because without them gcc 4.x may remove\n"
+  "/* The following #includes are present because without them gcc 4.x may remove\n"
   "the array definition from the final binary if PCRE2 is built into a static\n"
   "library and dead code stripping is activated. This leads to link errors.\n"
   "Pulling in the header ensures that the array gets flagged as \"someone\n"
index 3e97fb8bf173e4c3936203fb6b9612bddd3c5362..7f9ba4f19a96ee90d0d617edef8db27f664e16f8 100644 (file)
@@ -5,7 +5,7 @@
 /* This is the public header file for the PCRE library, second API, to be
 #included by applications that call PCRE2 functions.
 
-           Copyright (c) 2015 University of Cambridge
+           Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
 /* The current PCRE version information. */
 
 #define PCRE2_MAJOR          10
-#define PCRE2_MINOR          20
+#define PCRE2_MINOR          21
 #define PCRE2_PRERELEASE     
-#define PCRE2_DATE           2015-06-30
+#define PCRE2_DATE           2016-01-12
 
 /* When an application links to a PCRE DLL in Windows, the symbols that are
 imported have to be identified as such. When building PCRE2, the appropriate
@@ -120,6 +120,8 @@ D   is inspected during pcre2_dfa_match() execution
 #define PCRE2_UTF                 0x00080000u  /* C J M D */
 #define PCRE2_NEVER_BACKSLASH_C   0x00100000u  /* C       */
 #define PCRE2_ALT_CIRCUMFLEX      0x00200000u  /*   J M D */
+#define PCRE2_ALT_VERBNAMES       0x00400000u  /* C       */
+#define PCRE2_USE_OFFSET_LIMIT    0x00800000u  /*   J M D */
 
 /* These are for pcre2_jit_compile(). */
 
@@ -144,9 +146,13 @@ sanity checks). */
 #define PCRE2_DFA_RESTART         0x00000040u
 #define PCRE2_DFA_SHORTEST        0x00000080u
 
-/* This is an additional option for pcre2_substitute(). */
+/* These are additional options for pcre2_substitute(). */
 
-#define PCRE2_SUBSTITUTE_GLOBAL   0x00000100u
+#define PCRE2_SUBSTITUTE_GLOBAL           0x00000100u
+#define PCRE2_SUBSTITUTE_EXTENDED         0x00000200u
+#define PCRE2_SUBSTITUTE_UNSET_EMPTY      0x00000400u
+#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET    0x00000800u
+#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH  0x00001000u
 
 /* Newline and \R settings, for use in compile contexts. The newline values
 must be kept in step with values set in config.h and both sets must all be
@@ -233,6 +239,12 @@ numbers must not be changed. */
 #define PCRE2_ERROR_RECURSIONLIMIT    (-53)
 #define PCRE2_ERROR_UNAVAILABLE       (-54)
 #define PCRE2_ERROR_UNSET             (-55)
+#define PCRE2_ERROR_BADOFFSETLIMIT    (-56)
+#define PCRE2_ERROR_BADREPESCAPE      (-57)
+#define PCRE2_ERROR_REPMISSINGBRACE   (-58)
+#define PCRE2_ERROR_BADSUBSTITUTION   (-59)
+#define PCRE2_ERROR_BADSUBSPATTERN    (-60)
+#define PCRE2_ERROR_TOOMANYREPLACE    (-61)
 
 /* Request types for pcre2_pattern_info() */
 
@@ -259,6 +271,7 @@ numbers must not be changed. */
 #define PCRE2_INFO_NEWLINE              20
 #define PCRE2_INFO_RECURSIONLIMIT       21
 #define PCRE2_INFO_SIZE                 22
+#define PCRE2_INFO_HASBACKSLASHC        23
 
 /* Request types for pcre2_config(). */
 
@@ -291,6 +304,7 @@ define special values to indicate zero-terminated strings and unset offsets in
 the offset vector (ovector). */
 
 #define PCRE2_SIZE            size_t
+#define PCRE2_SIZE_MAX        SIZE_MAX
 #define PCRE2_ZERO_TERMINATED (~(PCRE2_SIZE)0)
 #define PCRE2_UNSET           (~(PCRE2_SIZE)0)
 
@@ -388,6 +402,8 @@ PCRE2_EXP_DECL void      pcre2_compile_context_free(pcre2_compile_context *); \
 PCRE2_EXP_DECL int       pcre2_set_bsr(pcre2_compile_context *, uint32_t); \
 PCRE2_EXP_DECL int       pcre2_set_character_tables(pcre2_compile_context *, \
                            const unsigned char *); \
+PCRE2_EXP_DECL int       pcre2_set_max_pattern_length(pcre2_compile_context *, \
+                           PCRE2_SIZE); \
 PCRE2_EXP_DECL int       pcre2_set_newline(pcre2_compile_context *, uint32_t); \
 PCRE2_EXP_DECL int       pcre2_set_parens_nest_limit(pcre2_compile_context *, \
                            uint32_t); \
@@ -405,6 +421,8 @@ PCRE2_EXP_DECL int       pcre2_set_callout(pcre2_match_context *, \
                            int (*)(pcre2_callout_block *, void *), void *); \
 PCRE2_EXP_DECL int       pcre2_set_match_limit(pcre2_match_context *, \
                            uint32_t); \
+PCRE2_EXP_DECL int       pcre2_set_offset_limit(pcre2_match_context *, \
+                           PCRE2_SIZE); \
 PCRE2_EXP_DECL int       pcre2_set_recursion_limit(pcre2_match_context *, \
                            uint32_t); \
 PCRE2_EXP_DECL int       pcre2_set_recursion_memory_management( \
@@ -606,8 +624,10 @@ pcre2_compile are called by application code. */
 #define pcre2_set_character_tables            PCRE2_SUFFIX(pcre2_set_character_tables_)
 #define pcre2_set_compile_recursion_guard     PCRE2_SUFFIX(pcre2_set_compile_recursion_guard_)
 #define pcre2_set_match_limit                 PCRE2_SUFFIX(pcre2_set_match_limit_)
+#define pcre2_set_max_pattern_length          PCRE2_SUFFIX(pcre2_set_max_pattern_length_)
 #define pcre2_set_newline                     PCRE2_SUFFIX(pcre2_set_newline_)
 #define pcre2_set_parens_nest_limit           PCRE2_SUFFIX(pcre2_set_parens_nest_limit_)
+#define pcre2_set_offset_limit                PCRE2_SUFFIX(pcre2_set_offset_limit_)
 #define pcre2_set_recursion_limit             PCRE2_SUFFIX(pcre2_set_recursion_limit_)
 #define pcre2_set_recursion_memory_management PCRE2_SUFFIX(pcre2_set_recursion_memory_management_)
 #define pcre2_substitute                      PCRE2_SUFFIX(pcre2_substitute_)
index 94fbdd5b34b3721c0b0eb2513f69982534a99800..49f1909654c5adb08a87defd5575771cc88484f3 100644 (file)
@@ -5,7 +5,7 @@
 /* This is the public header file for the PCRE library, second API, to be
 #included by applications that call PCRE2 functions.
 
-           Copyright (c) 2015 University of Cambridge
+           Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -120,6 +120,8 @@ D   is inspected during pcre2_dfa_match() execution
 #define PCRE2_UTF                 0x00080000u  /* C J M D */
 #define PCRE2_NEVER_BACKSLASH_C   0x00100000u  /* C       */
 #define PCRE2_ALT_CIRCUMFLEX      0x00200000u  /*   J M D */
+#define PCRE2_ALT_VERBNAMES       0x00400000u  /* C       */
+#define PCRE2_USE_OFFSET_LIMIT    0x00800000u  /*   J M D */
 
 /* These are for pcre2_jit_compile(). */
 
@@ -144,9 +146,13 @@ sanity checks). */
 #define PCRE2_DFA_RESTART         0x00000040u
 #define PCRE2_DFA_SHORTEST        0x00000080u
 
-/* This is an additional option for pcre2_substitute(). */
+/* These are additional options for pcre2_substitute(). */
 
-#define PCRE2_SUBSTITUTE_GLOBAL   0x00000100u
+#define PCRE2_SUBSTITUTE_GLOBAL           0x00000100u
+#define PCRE2_SUBSTITUTE_EXTENDED         0x00000200u
+#define PCRE2_SUBSTITUTE_UNSET_EMPTY      0x00000400u
+#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET    0x00000800u
+#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH  0x00001000u
 
 /* Newline and \R settings, for use in compile contexts. The newline values
 must be kept in step with values set in config.h and both sets must all be
@@ -233,6 +239,12 @@ numbers must not be changed. */
 #define PCRE2_ERROR_RECURSIONLIMIT    (-53)
 #define PCRE2_ERROR_UNAVAILABLE       (-54)
 #define PCRE2_ERROR_UNSET             (-55)
+#define PCRE2_ERROR_BADOFFSETLIMIT    (-56)
+#define PCRE2_ERROR_BADREPESCAPE      (-57)
+#define PCRE2_ERROR_REPMISSINGBRACE   (-58)
+#define PCRE2_ERROR_BADSUBSTITUTION   (-59)
+#define PCRE2_ERROR_BADSUBSPATTERN    (-60)
+#define PCRE2_ERROR_TOOMANYREPLACE    (-61)
 
 /* Request types for pcre2_pattern_info() */
 
@@ -259,6 +271,7 @@ numbers must not be changed. */
 #define PCRE2_INFO_NEWLINE              20
 #define PCRE2_INFO_RECURSIONLIMIT       21
 #define PCRE2_INFO_SIZE                 22
+#define PCRE2_INFO_HASBACKSLASHC        23
 
 /* Request types for pcre2_config(). */
 
@@ -291,6 +304,7 @@ define special values to indicate zero-terminated strings and unset offsets in
 the offset vector (ovector). */
 
 #define PCRE2_SIZE            size_t
+#define PCRE2_SIZE_MAX        SIZE_MAX
 #define PCRE2_ZERO_TERMINATED (~(PCRE2_SIZE)0)
 #define PCRE2_UNSET           (~(PCRE2_SIZE)0)
 
@@ -388,6 +402,8 @@ PCRE2_EXP_DECL void      pcre2_compile_context_free(pcre2_compile_context *); \
 PCRE2_EXP_DECL int       pcre2_set_bsr(pcre2_compile_context *, uint32_t); \
 PCRE2_EXP_DECL int       pcre2_set_character_tables(pcre2_compile_context *, \
                            const unsigned char *); \
+PCRE2_EXP_DECL int       pcre2_set_max_pattern_length(pcre2_compile_context *, \
+                           PCRE2_SIZE); \
 PCRE2_EXP_DECL int       pcre2_set_newline(pcre2_compile_context *, uint32_t); \
 PCRE2_EXP_DECL int       pcre2_set_parens_nest_limit(pcre2_compile_context *, \
                            uint32_t); \
@@ -405,6 +421,8 @@ PCRE2_EXP_DECL int       pcre2_set_callout(pcre2_match_context *, \
                            int (*)(pcre2_callout_block *, void *), void *); \
 PCRE2_EXP_DECL int       pcre2_set_match_limit(pcre2_match_context *, \
                            uint32_t); \
+PCRE2_EXP_DECL int       pcre2_set_offset_limit(pcre2_match_context *, \
+                           PCRE2_SIZE); \
 PCRE2_EXP_DECL int       pcre2_set_recursion_limit(pcre2_match_context *, \
                            uint32_t); \
 PCRE2_EXP_DECL int       pcre2_set_recursion_memory_management( \
@@ -606,8 +624,10 @@ pcre2_compile are called by application code. */
 #define pcre2_set_character_tables            PCRE2_SUFFIX(pcre2_set_character_tables_)
 #define pcre2_set_compile_recursion_guard     PCRE2_SUFFIX(pcre2_set_compile_recursion_guard_)
 #define pcre2_set_match_limit                 PCRE2_SUFFIX(pcre2_set_match_limit_)
+#define pcre2_set_max_pattern_length          PCRE2_SUFFIX(pcre2_set_max_pattern_length_)
 #define pcre2_set_newline                     PCRE2_SUFFIX(pcre2_set_newline_)
 #define pcre2_set_parens_nest_limit           PCRE2_SUFFIX(pcre2_set_parens_nest_limit_)
+#define pcre2_set_offset_limit                PCRE2_SUFFIX(pcre2_set_offset_limit_)
 #define pcre2_set_recursion_limit             PCRE2_SUFFIX(pcre2_set_recursion_limit_)
 #define pcre2_set_recursion_memory_management PCRE2_SUFFIX(pcre2_set_recursion_memory_management_)
 #define pcre2_substitute                      PCRE2_SUFFIX(pcre2_substitute_)
index e99a2c44fff93c29226443c87c5bf93bf7f4f301..d4d2334d894644e7b380ea32f8600d41f34e652d 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -171,64 +171,6 @@ static const uint8_t posspropstab[3][4] = {
   { ucp_L, ucp_N, ucp_P, ucp_Po }   /* WORD */
 };
 
-/* This table is used when converting repeating opcodes into possessified
-versions as a result of an explicit possessive quantifier such as ++. A zero
-value means there is no possessified version - in those cases the item in
-question must be wrapped in ONCE brackets. The table is truncated at OP_CALLOUT
-because all relevant opcodes are less than that. */
-
-static const uint8_t opcode_possessify[] = {
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   /* 0 - 15  */
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   /* 16 - 31 */
-
-  0,                       /* NOTI */
-  OP_POSSTAR, 0,           /* STAR, MINSTAR */
-  OP_POSPLUS, 0,           /* PLUS, MINPLUS */
-  OP_POSQUERY, 0,          /* QUERY, MINQUERY */
-  OP_POSUPTO, 0,           /* UPTO, MINUPTO */
-  0,                       /* EXACT */
-  0, 0, 0, 0,              /* POS{STAR,PLUS,QUERY,UPTO} */
-
-  OP_POSSTARI, 0,          /* STARI, MINSTARI */
-  OP_POSPLUSI, 0,          /* PLUSI, MINPLUSI */
-  OP_POSQUERYI, 0,         /* QUERYI, MINQUERYI */
-  OP_POSUPTOI, 0,          /* UPTOI, MINUPTOI */
-  0,                       /* EXACTI */
-  0, 0, 0, 0,              /* POS{STARI,PLUSI,QUERYI,UPTOI} */
-
-  OP_NOTPOSSTAR, 0,        /* NOTSTAR, NOTMINSTAR */
-  OP_NOTPOSPLUS, 0,        /* NOTPLUS, NOTMINPLUS */
-  OP_NOTPOSQUERY, 0,       /* NOTQUERY, NOTMINQUERY */
-  OP_NOTPOSUPTO, 0,        /* NOTUPTO, NOTMINUPTO */
-  0,                       /* NOTEXACT */
-  0, 0, 0, 0,              /* NOTPOS{STAR,PLUS,QUERY,UPTO} */
-
-  OP_NOTPOSSTARI, 0,       /* NOTSTARI, NOTMINSTARI */
-  OP_NOTPOSPLUSI, 0,       /* NOTPLUSI, NOTMINPLUSI */
-  OP_NOTPOSQUERYI, 0,      /* NOTQUERYI, NOTMINQUERYI */
-  OP_NOTPOSUPTOI, 0,       /* NOTUPTOI, NOTMINUPTOI */
-  0,                       /* NOTEXACTI */
-  0, 0, 0, 0,              /* NOTPOS{STARI,PLUSI,QUERYI,UPTOI} */
-
-  OP_TYPEPOSSTAR, 0,       /* TYPESTAR, TYPEMINSTAR */
-  OP_TYPEPOSPLUS, 0,       /* TYPEPLUS, TYPEMINPLUS */
-  OP_TYPEPOSQUERY, 0,      /* TYPEQUERY, TYPEMINQUERY */
-  OP_TYPEPOSUPTO, 0,       /* TYPEUPTO, TYPEMINUPTO */
-  0,                       /* TYPEEXACT */
-  0, 0, 0, 0,              /* TYPEPOS{STAR,PLUS,QUERY,UPTO} */
-
-  OP_CRPOSSTAR, 0,         /* CRSTAR, CRMINSTAR */
-  OP_CRPOSPLUS, 0,         /* CRPLUS, CRMINPLUS */
-  OP_CRPOSQUERY, 0,        /* CRQUERY, CRMINQUERY */
-  OP_CRPOSRANGE, 0,        /* CRRANGE, CRMINRANGE */
-  0, 0, 0, 0,              /* CRPOS{STAR,PLUS,QUERY,RANGE} */
-
-  0, 0, 0,                 /* CLASS, NCLASS, XCLASS */
-  0, 0,                    /* REF, REFI */
-  0, 0,                    /* DNREF, DNREFI */
-  0, 0                     /* RECURSE, CALLOUT */
-};
-
 
 
 #ifdef SUPPORT_UNICODE
index 4a9e42e2cb780c7d360121caea04b52ee331fdb6..d8528378e7974b86918ca19cfb020f6f7f9f471a 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2015 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -96,26 +96,27 @@ static BOOL
 *      Code parameters and static tables         *
 *************************************************/
 
-/* This value specifies the size of stack workspace, which is used during the
-pre-compile phase when determining how much memory is required. The regex is
-partly compiled into this space, but the compiled parts are discarded as soon
-as they can be, so that hopefully there will never be an overrun. The code
-does, however, check for an overrun. The largest amount I've seen used is 218,
-so this number is very generous.
-
-The same workspace is used during the second, actual compile phase for
-remembering forward references to groups so that they can be filled in at the
-end. Each entry in this list occupies LINK_SIZE bytes, so even when LINK_SIZE
-is 4 there is plenty of room for most patterns. However, the memory can get
-filled up by repetitions of forward references, for example patterns like
-/(?1){0,1999}(b)/, and one user did hit the limit. The code has been changed so
-that the workspace is expanded in this situation. The value below is therefore
-a minimum, and we put a maximum on it for safety. The minimum is now also
-defined in terms of LINK_SIZE so that the size increase kicks in at the same
-number of forward references in all cases. */
-
-#define COMPILE_WORK_SIZE (2048*LINK_SIZE)
-#define COMPILE_WORK_SIZE_MAX (100*COMPILE_WORK_SIZE)
+/* This value specifies the size of stack workspace, which is used in different
+ways in the different pattern scans. The group-identifying pre-scan uses it to
+handle nesting, and needs it to be 16-bit aligned.
+
+During the first compiling phase, when determining how much memory is required,
+the regex is partly compiled into this space, but the compiled parts are
+discarded as soon as they can be, so that hopefully there will never be an
+overrun. The code does, however, check for an overrun, which can occur for
+pathological patterns. The size of the workspace depends on LINK_SIZE because
+the length of compiled items varies with this.
+
+In the real compile phase, the workspace is used for remembering data about
+numbered groups, provided there are not too many of them (if there are, extra
+memory is acquired). For this phase the memory must be 32-bit aligned. Having
+defined the size in code units, we set up C32_WORK_SIZE as the number of
+elements in the 32-bit vector. */
+
+#define COMPILE_WORK_SIZE (2048*LINK_SIZE)   /* Size in code units */
+
+#define C32_WORK_SIZE \
+  ((COMPILE_WORK_SIZE * sizeof(PCRE2_UCHAR))/sizeof(uint32_t))
 
 /* The overrun tests check for a slightly smaller size so that they detect the
 overrun before it actually does run off the end of the data block. */
@@ -160,6 +161,14 @@ have to check them every time. */
 #define REQ_UNSET       (-2)            /* Not yet found anything */
 #define REQ_NONE        (-1)            /* Found not fixed char */
 
+/* These flags are used in the groupinfo vector. */
+
+#define GI_SET_COULD_BE_EMPTY  0x80000000u
+#define GI_COULD_BE_EMPTY      0x40000000u
+#define GI_NOT_FIXED_LENGTH    0x20000000u
+#define GI_SET_FIXED_LENGTH    0x10000000u
+#define GI_FIXED_LENGTH_MASK   0x0000ffffu
+
 /* This bit (which is greater than any UTF value) is used to indicate that a
 variable contains a number of code units instead of an actual code point. */
 
@@ -270,7 +279,7 @@ in UTF-8 mode. It runs from '0' to 'z'. */
 #ifndef EBCDIC
 #define ESCAPES_FIRST       CHAR_0
 #define ESCAPES_LAST        CHAR_z
-#define ESCAPES_UPPER_CASE  (-32)    /* Add this to upper case a letter */
+#define UPPER_CASE(c)       (c-32)
 
 static const short int escapes[] = {
      0,                       0,
@@ -323,11 +332,11 @@ because it is defined as 'a', which of course picks up the ASCII value. */
 #if 'a' == 0x81                    /* Check for a real EBCDIC environment */
 #define ESCAPES_FIRST       CHAR_a
 #define ESCAPES_LAST        CHAR_9
-#define ESCAPES_UPPER_CASE  (+64)  /* Add this to upper case a letter */
+#define UPPER_CASE(c)       (c+64)
 #else                              /* Testing in an ASCII environment */
 #define ESCAPES_FIRST  ((unsigned char)'\x81')   /* EBCDIC 'a' */
 #define ESCAPES_LAST   ((unsigned char)'\xf9')   /* EBCDIC '9' */
-#define ESCAPES_UPPER_CASE  (-32)  /* Add this to upper case a letter */
+#define UPPER_CASE(c)  (c-32)
 #endif
 
 static const short int escapes[] = {
@@ -573,17 +582,18 @@ static PCRE2_SPTR posix_substitutes[] = {
 
 #define PUBLIC_COMPILE_OPTIONS \
   (PCRE2_ANCHORED|PCRE2_ALLOW_EMPTY_CLASS|PCRE2_ALT_BSUX|PCRE2_ALT_CIRCUMFLEX| \
-   PCRE2_AUTO_CALLOUT|PCRE2_CASELESS|PCRE2_DOLLAR_ENDONLY|PCRE2_DOTALL| \
-   PCRE2_DUPNAMES|PCRE2_EXTENDED|PCRE2_FIRSTLINE|PCRE2_MATCH_UNSET_BACKREF| \
-   PCRE2_MULTILINE|PCRE2_NEVER_BACKSLASH_C|PCRE2_NEVER_UCP| \
-   PCRE2_NEVER_UTF|PCRE2_NO_AUTO_CAPTURE|PCRE2_NO_AUTO_POSSESS| \
-   PCRE2_NO_DOTSTAR_ANCHOR|PCRE2_NO_START_OPTIMIZE|PCRE2_NO_UTF_CHECK| \
-   PCRE2_UCP|PCRE2_UNGREEDY|PCRE2_UTF)
+   PCRE2_ALT_VERBNAMES|PCRE2_AUTO_CALLOUT|PCRE2_CASELESS|PCRE2_DOLLAR_ENDONLY| \
+   PCRE2_DOTALL|PCRE2_DUPNAMES|PCRE2_EXTENDED|PCRE2_FIRSTLINE| \
+   PCRE2_MATCH_UNSET_BACKREF|PCRE2_MULTILINE|PCRE2_NEVER_BACKSLASH_C| \
+   PCRE2_NEVER_UCP|PCRE2_NEVER_UTF|PCRE2_NO_AUTO_CAPTURE| \
+   PCRE2_NO_AUTO_POSSESS|PCRE2_NO_DOTSTAR_ANCHOR|PCRE2_NO_START_OPTIMIZE| \
+   PCRE2_NO_UTF_CHECK|PCRE2_UCP|PCRE2_UNGREEDY|PCRE2_USE_OFFSET_LIMIT| \
+   PCRE2_UTF)
 
 /* Compile time error code numbers. They are given names so that they can more
 easily be tracked. When a new number is added, the tables called eint1 and
-eint2 in pcre2posix.c must be updated, and a new error text must be added to
-compile_error_texts in pcre2_error.c. */
+eint2 in pcre2posix.c may need to be updated, and a new error text must be
+added to compile_error_texts in pcre2_error.c. */
 
 enum { ERR0 = COMPILE_ERROR_BASE,
        ERR1,  ERR2,  ERR3,  ERR4,  ERR5,  ERR6,  ERR7,  ERR8,  ERR9,  ERR10,
@@ -594,7 +604,21 @@ enum { ERR0 = COMPILE_ERROR_BASE,
        ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59, ERR60,
        ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69, ERR70,
        ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79, ERR80,
-       ERR81, ERR82, ERR83, ERR84 };
+       ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERR88 };
+
+/* Error codes that correspond to negative error codes returned by
+find_fixedlength(). */
+
+static int fixed_length_errors[] =
+  {
+  ERR0,    /* Not an error */
+  ERR0,    /* Not an error; -1 is used for "process later" */
+  ERR25,   /* Lookbehind is not fixed length */
+  ERR36,   /* \C in lookbehind is not allowed */
+  ERR87,   /* Lookbehind is too long */
+  ERR86,   /* Pattern too complicated */
+  ERR70    /* Internal error: unknown opcode encountered */
+  };
 
 /* This is a table of start-of-pattern options such as (*UTF) and settings such
 as (*LIMIT_MATCH=nnnn) and (*CRLF). For completeness and backward
@@ -791,39 +815,76 @@ PUT(previous_callout, 1 + LINK_SIZE, length);
 *************************************************/
 
 /* Scan a branch and compute the fixed length of subject that will match it, if
-the length is fixed. This is needed for dealing with backward assertions. In
+the length is fixed. This is needed for dealing with lookbehind assertions. In
 UTF mode, the result is in code units rather than bytes. The branch is
 temporarily terminated with OP_END when this function is called.
 
-This function is called when a backward assertion is encountered, so that if it
-fails, the error message can point to the correct place in the pattern.
+This function is called when a lookbehind assertion is encountered, so that if
+it fails, the error message can point to the correct place in the pattern.
 However, we cannot do this when the assertion contains subroutine calls,
 because they can be forward references. We solve this by remembering this case
 and doing the check at the end; a flag specifies which mode we are running in.
 
+Lookbehind lengths are held in 16-bit fields and the maximum value is defined
+as LOOKBEHIND_MAX.
+
 Arguments:
-  code     points to the start of the pattern (the bracket)
-  utf      TRUE in UTF mode
-  atend    TRUE if called when the pattern is complete
-  cb       the "compile data" structure
+  code        points to the start of the pattern (the bracket)
+  utf         TRUE in UTF mode
+  atend       TRUE if called when the pattern is complete
+  cb          the "compile data" structure
   recurses    chain of recurse_check to catch mutual recursion
-
-Returns:   the fixed length,
-             or -1 if there is no fixed length,
-             or -2 if \C was encountered (in UTF-8 mode only)
-             or -3 if an OP_RECURSE item was encountered and atend is FALSE
-             or -4 if an unknown opcode was encountered (internal error)
+  countptr    pointer to counter, to catch over-complexity
+
+Returns:   if non-negative, the fixed length,
+             or -1 if an OP_RECURSE item was encountered and atend is FALSE
+             or -2 if there is no fixed length,
+             or -3 if \C was encountered (in UTF-8 mode only)
+             or -4 length is too long
+             or -5 if an unknown opcode was encountered (internal error)
 */
 
+#define FFL_LATER           (-1)
+#define FFL_NOTFIXED        (-2)
+#define FFL_BACKSLASHC      (-3)
+#define FFL_TOOLONG         (-4)
+#define FFL_TOOCOMPLICATED  (-5)
+#define FFL_UNKNOWNOP       (-6)
+
 static int
 find_fixedlength(PCRE2_UCHAR *code, BOOL utf, BOOL atend, compile_block *cb,
-  recurse_check *recurses)
+  recurse_check *recurses, int *countptr)
 {
 int length = -1;
+uint32_t group = 0;
+uint32_t groupinfo = 0;
 recurse_check this_recurse;
 register int branchlength = 0;
 register PCRE2_UCHAR *cc = code + 1 + LINK_SIZE;
 
+/* If this is a capturing group, we may have the answer cached, but we can only
+use this information if there are no (?| groups in the pattern, because
+otherwise group numbers are not unique. */
+
+if (*code == OP_CBRA || *code == OP_CBRAPOS || *code == OP_SCBRA ||
+    *code == OP_SCBRAPOS)
+  {
+  group = GET2(cc, 0);
+  cc += IMM2_SIZE;
+  groupinfo = cb->groupinfo[group];
+  if ((cb->external_flags & PCRE2_DUPCAPUSED) == 0)
+    {
+    if ((groupinfo & GI_NOT_FIXED_LENGTH) != 0) return FFL_NOTFIXED;
+    if ((groupinfo & GI_SET_FIXED_LENGTH) != 0)
+      return groupinfo & GI_FIXED_LENGTH_MASK;
+    }
+  }
+
+/* A large and/or complex regex can take too long to process. This can happen
+more often when (?| groups are present in the pattern. */
+
+if ((*countptr)++ > 2000) return FFL_TOOCOMPLICATED;
+
 /* Scan along the opcodes for this branch. If we get to the end of the
 branch, check the length against that of the other branches. */
 
@@ -833,6 +894,8 @@ for (;;)
   PCRE2_UCHAR *ce, *cs;
   register PCRE2_UCHAR op = *cc;
 
+  if (branchlength > LOOKBEHIND_MAX) return FFL_TOOLONG;
+
   switch (op)
     {
     /* We only need to continue for OP_CBRA (normal capturing bracket) and
@@ -845,8 +908,7 @@ for (;;)
     case OP_ONCE:
     case OP_ONCE_NC:
     case OP_COND:
-    d = find_fixedlength(cc + ((op == OP_CBRA)? IMM2_SIZE : 0), utf, atend, cb,
-      recurses);
+    d = find_fixedlength(cc, utf, atend, cb, recurses, countptr);
     if (d < 0) return d;
     branchlength += d;
     do cc += GET(cc, 1); while (*cc == OP_ALT);
@@ -865,30 +927,38 @@ for (;;)
     case OP_ACCEPT:
     case OP_ASSERT_ACCEPT:
     if (length < 0) length = branchlength;
-      else if (length != branchlength) return -1;
-    if (*cc != OP_ALT) return length;
+      else if (length != branchlength) goto ISNOTFIXED;
+    if (*cc != OP_ALT)
+      {
+      if (group > 0)
+        {
+        groupinfo |= (GI_SET_FIXED_LENGTH | length);
+        cb->groupinfo[group] = groupinfo;
+        }
+      return length;
+      }
     cc += 1 + LINK_SIZE;
     branchlength = 0;
     break;
 
     /* A true recursion implies not fixed length, but a subroutine call may
     be OK. If the subroutine is a forward reference, we can't deal with
-    it until the end of the pattern, so return -3. */
+    it until the end of the pattern, so return FFL_LATER. */
 
     case OP_RECURSE:
-    if (!atend) return -3;
+    if (!atend) return FFL_LATER;
     cs = ce = (PCRE2_UCHAR *)cb->start_code + GET(cc, 1); /* Start subpattern */
     do ce += GET(ce, 1); while (*ce == OP_ALT);           /* End subpattern */
-    if (cc > cs && cc < ce) return -1;                    /* Recursion */
+    if (cc > cs && cc < ce) goto ISNOTFIXED;          /* Recursion */
     else   /* Check for mutual recursion */
       {
       recurse_check *r = recurses;
       for (r = recurses; r != NULL; r = r->prev) if (r->group == cs) break;
-      if (r != NULL) return -1;   /* Mutual recursion */
+      if (r != NULL) goto ISNOTFIXED;   /* Mutual recursion */
       }
     this_recurse.prev = recurses;
     this_recurse.group = cs;
-    d = find_fixedlength(cs + IMM2_SIZE, utf, atend, cb, &this_recurse);
+    d = find_fixedlength(cs, utf, atend, cb, &this_recurse, countptr);
     if (d < 0) return d;
     branchlength += d;
     cc += 1 + LINK_SIZE;
@@ -1010,7 +1080,7 @@ for (;;)
     otherwise \C is coded as OP_ALLANY. */
 
     case OP_ANYBYTE:
-    return -2;
+    return FFL_BACKSLASHC;
 
     /* Check a class for variable quantification */
 
@@ -1039,12 +1109,12 @@ for (;;)
       case OP_CRPOSSTAR:
       case OP_CRPOSPLUS:
       case OP_CRPOSQUERY:
-      return -1;
+      goto ISNOTFIXED;
 
       case OP_CRRANGE:
       case OP_CRMINRANGE:
       case OP_CRPOSRANGE:
-      if (GET2(cc,1) != GET2(cc,1+IMM2_SIZE)) return -1;
+      if (GET2(cc,1) != GET2(cc,1+IMM2_SIZE)) goto ISNOTFIXED;
       branchlength += (int)GET2(cc,1);
       cc += 1 + 2 * IMM2_SIZE;
       break;
@@ -1136,16 +1206,24 @@ for (;;)
     case OP_TYPEUPTO:
     case OP_UPTO:
     case OP_UPTOI:
-    return -1;
+    goto ISNOTFIXED;
 
     /* Catch unrecognized opcodes so that when new ones are added they
     are not forgotten, as has happened in the past. */
 
     default:
-    return -4;
+    return FFL_UNKNOWNOP;
     }
   }
-/* Control never gets here */
+/* Control never gets here except by goto. */
+
+ISNOTFIXED:
+if (group > 0)
+  {
+  groupinfo |= GI_NOT_FIXED_LENGTH;
+  cb->groupinfo[group] = groupinfo;
+  }
+return FFL_NOTFIXED;
 }
 
 
@@ -1215,30 +1293,72 @@ for (;;)
 *************************************************/
 
 /* This function scans through a branch of a compiled pattern to see whether it
-can match the empty string. It is called from could_be_empty() below and from
-compile_branch() when checking for an unlimited repeat of a group that can
-match nothing. Note that first_significant_code() skips over backward and
-negative forward assertions when its final argument is TRUE. If we hit an
-unclosed bracket, we return "empty" - this means we've struck an inner bracket
-whose current branch will already have been scanned.
+can match the empty string. It is called at the end of compiling to check the
+entire pattern, and from compile_branch() when checking for an unlimited repeat
+of a group that can match nothing. In the latter case it is called only when
+doing the real compile, not during the pre-compile that measures the size of
+the compiled pattern.
+
+Note that first_significant_code() skips over backward and negative forward
+assertions when its final argument is TRUE. If we hit an unclosed bracket, we
+return "empty" - this means we've struck an inner bracket whose current branch
+will already have been scanned.
 
 Arguments:
   code        points to start of search
   endcode     points to where to stop
   utf         TRUE if in UTF mode
   cb          compile data
+  atend       TRUE if being called to check an entire pattern
   recurses    chain of recurse_check to catch mutual recursion
+  countptr    pointer to count to catch over-complicated pattern
 
-Returns:      TRUE if what is matched could be empty
+Returns:      0 if what is matched cannot be empty
+              1 if what is matched could be empty
+             -1 if the pattern is too complicated
 */
 
-static BOOL
+#define CBE_NOTEMPTY          0
+#define CBE_EMPTY             1
+#define CBE_TOOCOMPLICATED  (-1)
+
+
+static int
 could_be_empty_branch(PCRE2_SPTR code, PCRE2_SPTR endcode, BOOL utf,
-  compile_block *cb, recurse_check *recurses)
+  compile_block *cb, BOOL atend, recurse_check *recurses, int *countptr)
 {
+uint32_t group = 0;
+uint32_t groupinfo = 0;
 register PCRE2_UCHAR c;
 recurse_check this_recurse;
 
+/* If what we are checking has already been set as "could be empty", we know
+the answer. */
+
+if (*code >= OP_SBRA && *code <= OP_SCOND) return CBE_EMPTY;
+
+/* If this is a capturing group, we may have the answer cached, but we can only
+use this information if there are no (?| groups in the pattern, because
+otherwise group numbers are not unique. */
+
+if ((cb->external_flags & PCRE2_DUPCAPUSED) == 0 &&
+    (*code == OP_CBRA || *code == OP_CBRAPOS))
+  {
+  group = GET2(code, 1 + LINK_SIZE);
+  groupinfo = cb->groupinfo[group];
+  if ((groupinfo & GI_SET_COULD_BE_EMPTY) != 0)
+    return ((groupinfo & GI_COULD_BE_EMPTY) != 0)? CBE_EMPTY : CBE_NOTEMPTY;
+  }
+
+/* A large and/or complex regex can take too long to process. We have to assume
+it can match an empty string. This can happen more often when (?| groups are
+present in the pattern and the caching is disabled. Setting the cap at 1100
+allows the test for more than 1023 capturing patterns to work. */
+
+if ((*countptr)++ > 1100) return CBE_TOOCOMPLICATED;
+
+/* Scan the opcodes for this branch. */
+
 for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
      code < endcode;
      code = first_significant_code(code + PRIV(OP_lengths)[c], TRUE))
@@ -1257,35 +1377,27 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
     continue;
     }
 
-  /* For a recursion/subroutine call, if its end has been reached, which
-  implies a backward reference subroutine call, we can scan it. If it's a
-  forward reference subroutine call, we can't. To detect forward reference
-  we have to scan up the list that is kept in the workspace. This function is
-  called only when doing the real compile, not during the pre-compile that
-  measures the size of the compiled pattern. */
+  /* For a recursion/subroutine call we can scan the recursion when this
+  function is called at the end, to check a complete pattern. Before then,
+  recursions just have the group number as their argument and in any case may
+  be forward references. In that situation, we return CBE_EMPTY, just in case.
+  It means that unlimited repeats of groups that contain recursions are always
+  treated as "could be empty" - which just adds a bit more processing time
+  because of the runtime check. */
 
   if (c == OP_RECURSE)
     {
-    PCRE2_SPTR scode = cb->start_code + GET(code, 1);
-    PCRE2_SPTR endgroup = scode;
+    PCRE2_SPTR scode, endgroup;
     BOOL empty_branch;
 
-    /* Test for forward reference or uncompleted reference. This is disabled
-    when called to scan a completed pattern by setting cb->start_workspace to
-    NULL. */
+    if (!atend) goto ISTRUE;
+    scode = cb->start_code + GET(code, 1);
+    endgroup = scode;
 
-    if (cb->start_workspace != NULL)
-      {
-      PCRE2_SPTR tcode;
-      for (tcode = cb->start_workspace; tcode < cb->hwm; tcode += LINK_SIZE)
-        if ((int)GET(tcode, 0) == (int)(code + 1 - cb->start_code)) return TRUE;
-      if (GET(scode, 1) == 0) return TRUE;    /* Unclosed */
-      }
-
-    /* If the reference is to a completed group, we need to detect whether this
-    is a recursive call, as otherwise there will be an infinite loop. If it is
-    a recursion, just skip over it. Simple recursions are easily detected. For
-    mutual recursions we keep a chain on the stack. */
+    /* We need to detect whether this is a recursive call, as otherwise there
+    will be an infinite loop. If it is a recursion, just skip over it. Simple
+    recursions are easily detected. For mutual recursions we keep a chain on
+    the stack. */
 
     do endgroup += GET(endgroup, 1); while (*endgroup == OP_ALT);
     if (code >= scode && code <= endgroup) continue;  /* Simple recursion */
@@ -1297,8 +1409,8 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
       if (r != NULL) continue;   /* Mutual recursion */
       }
 
-    /* Completed reference; scan the referenced group, remembering it on the
-    stack chain to detect mutual recursions. */
+    /* Scan the referenced group, remembering it on the stack chain to detect
+    mutual recursions. */
 
     empty_branch = FALSE;
     this_recurse.prev = recurses;
@@ -1306,7 +1418,10 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
 
     do
       {
-      if (could_be_empty_branch(scode, endcode, utf, cb, &this_recurse))
+      int rc = could_be_empty_branch(scode, endcode, utf, cb, atend,
+        &this_recurse, countptr);
+      if (rc < 0) return rc;
+      if (rc > 0)
         {
         empty_branch = TRUE;
         break;
@@ -1315,7 +1430,7 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
       }
     while (*scode == OP_ALT);
 
-    if (!empty_branch) return FALSE;  /* All branches are non-empty */
+    if (!empty_branch) goto ISFALSE;  /* All branches are non-empty */
     continue;
     }
 
@@ -1349,7 +1464,7 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
       c == OP_COND || c == OP_SCOND)
     {
     BOOL empty_branch;
-    if (GET(code, 1) == 0) return TRUE;    /* Hit unclosed bracket */
+    if (GET(code, 1) == 0) goto ISTRUE;    /* Hit unclosed bracket */
 
     /* If a conditional group has only one branch, there is a second, implied,
     empty branch, so just skip over the conditional, because it could be empty.
@@ -1362,12 +1477,17 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
       empty_branch = FALSE;
       do
         {
-        if (!empty_branch && could_be_empty_branch(code, endcode, utf, cb,
-          recurses)) empty_branch = TRUE;
+        if (!empty_branch)
+          {
+          int rc = could_be_empty_branch(code, endcode, utf, cb, atend,
+            recurses, countptr);
+          if (rc < 0) return rc;
+          if (rc > 0) empty_branch = TRUE;
+          }
         code += GET(code, 1);
         }
       while (*code == OP_ALT);
-      if (!empty_branch) return FALSE;   /* All branches are non-empty */
+      if (!empty_branch) goto ISFALSE;   /* All branches are non-empty */
       }
 
     c = *code;
@@ -1412,12 +1532,12 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
       case OP_CRPLUS:            /* These repeats aren't empty */
       case OP_CRMINPLUS:
       case OP_CRPOSPLUS:
-      return FALSE;
+      goto ISFALSE;
 
       case OP_CRRANGE:
       case OP_CRMINRANGE:
       case OP_CRPOSRANGE:
-      if (GET2(ccode, 1) > 0) return FALSE;  /* Minimum > 0 */
+      if (GET2(ccode, 1) > 0) goto ISFALSE;  /* Minimum > 0 */
       break;
       }
     break;
@@ -1474,8 +1594,7 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
     case OP_TYPEMINPLUS:
     case OP_TYPEPOSPLUS:
     case OP_TYPEEXACT:
-
-    return FALSE;
+    goto ISFALSE;
 
     /* These are going to continue, as they may be empty, but we have to
     fudge the length for the \p and \P cases. */
@@ -1505,7 +1624,7 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
     case OP_KETRMIN:
     case OP_KETRPOS:
     case OP_ALT:
-    return TRUE;
+    goto ISTRUE;
 
     /* In UTF-8 or UTF-16 mode, STAR, MINSTAR, POSSTAR, QUERY, MINQUERY,
     POSQUERY, UPTO, MINUPTO, and POSUPTO and their caseless and negative
@@ -1579,78 +1698,13 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
     }
   }
 
-return TRUE;
-}
-
-
-
-/*************************************************
-*    Scan compiled regex for non-emptiness       *
-*************************************************/
+ISTRUE:
+groupinfo |= GI_COULD_BE_EMPTY;
 
-/* This function is called to check for left recursive calls. We want to check
-the current branch of the current pattern to see if it could match the empty
-string. If it could, we must look outwards for branches at other levels,
-stopping when we pass beyond the bracket which is the subject of the recursion.
-This function is called only during the real compile, not during the
-pre-compile.
+ISFALSE:
+if (group > 0) cb->groupinfo[group] = groupinfo | GI_SET_COULD_BE_EMPTY;
 
-Arguments:
-  code        points to start of the recursion
-  endcode     points to where to stop (current RECURSE item)
-  bcptr       points to the chain of current (unclosed) branch starts
-  utf         TRUE if in UTF mode
-  cb          compile data
-
-Returns:      TRUE if what is matched could be empty
-*/
-
-static BOOL
-could_be_empty(PCRE2_SPTR code, PCRE2_SPTR endcode, branch_chain *bcptr,
-  BOOL utf, compile_block *cb)
-{
-while (bcptr != NULL && bcptr->current_branch >= code)
-  {
-  if (!could_be_empty_branch(bcptr->current_branch, endcode, utf, cb, NULL))
-    return FALSE;
-  bcptr = bcptr->outer;
-  }
-return TRUE;
-}
-
-
-
-/*************************************************
-*           Expand the workspace                 *
-*************************************************/
-
-/* This function is called during the second compiling phase, if the number of
-forward references fills the existing workspace, which is originally a block on
-the stack. A larger block is obtained from the heap unless the ultimate limit
-has been reached or the increase will be rather small.
-
-Argument: pointer to the compile data block
-Returns:  0 if all went well, else an error number
-*/
-
-static int
-expand_workspace(compile_block *cb)
-{
-PCRE2_UCHAR *newspace;
-int newsize = cb->workspace_size * 2;
-if (newsize > COMPILE_WORK_SIZE_MAX) newsize = COMPILE_WORK_SIZE_MAX;
-if (cb->workspace_size >= COMPILE_WORK_SIZE_MAX ||
-    newsize - cb->workspace_size < WORK_SIZE_SAFETY_MARGIN)
- return ERR72;
-newspace = cb->cx->memctl.malloc(CU2BYTES(newsize), cb->cx->memctl.memory_data);
-if (newspace == NULL) return ERR21;
-memcpy(newspace, cb->start_workspace, cb->workspace_size * sizeof(PCRE2_UCHAR));
-cb->hwm = (PCRE2_UCHAR *)newspace + (cb->hwm - cb->start_workspace);
-if (cb->workspace_size > COMPILE_WORK_SIZE)
-  cb->cx->memctl.free((void *)cb->start_workspace, cb->cx->memctl.memory_data);
-cb->start_workspace = newspace;
-cb->workspace_size = newsize;
-return 0;
+return ((groupinfo & GI_COULD_BE_EMPTY) != 0)? CBE_EMPTY : CBE_NOTEMPTY;
 }
 
 
@@ -1697,8 +1751,22 @@ is placed in chptr. A backreference to group n is returned as negative n. On
 entry, ptr is pointing at the \. On exit, it points the final code unit of the
 escape sequence.
 
+This function is also called from pcre2_substitute() to handle escape sequences
+in replacement strings. In this case, the cb argument is NULL, and only
+sequences that define a data character are recognised. The isclass argument is
+not relevant, but the options argument is the final value of the compiled
+pattern's options.
+
+There is one "trick" case: when a sequence such as [[:>:]] or \s in UCP mode is
+processed, it is replaced by a nested alternative sequence. If this contains a
+backslash (which is usually does), ptrend does not point to its end - it still
+points to the end of the whole pattern. However, we can detect this case
+because cb->nestptr[0] will be non-NULL. The nested sequences are all zero-
+terminated and there are only ever two levels of nesting.
+
 Arguments:
-  ptrptr         points to the pattern position pointer
+  ptrptr         points to the input position pointer
+  ptrend         points to the end of the input
   chptr          points to a returned data character
   errorcodeptr   points to the errorcode variable (containing zero)
   options        the current options bits
@@ -1711,9 +1779,9 @@ Returns:         zero => a data character
                  on error, errorcodeptr is set non-zero
 */
 
-static int
-check_escape(PCRE2_SPTR *ptrptr, uint32_t *chptr, int *errorcodeptr,
-  uint32_t options, BOOL isclass, compile_block *cb)
+int
+PRIV(check_escape)(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, uint32_t *chptr,
+  int *errorcodeptr, uint32_t options, BOOL isclass, compile_block *cb)
 {
 BOOL utf = (options & PCRE2_UTF) != 0;
 PCRE2_SPTR ptr = *ptrptr + 1;
@@ -1721,19 +1789,28 @@ register uint32_t c, cc;
 int escape = 0;
 int i;
 
-GETCHARINCTEST(c, ptr);         /* Get character value, increment pointer */
-ptr--;                          /* Set pointer back to the last code unit */
+/* Find the end of a nested insert. */
+
+if (cb != NULL && cb->nestptr[0] != NULL)
+  ptrend = ptr + PRIV(strlen)(ptr);
 
-/* If backslash is at the end of the pattern, it's an error. */
+/* If backslash is at the end of the string, it's an error. */
+
+if (ptr >= ptrend)
+  {
+  *errorcodeptr = ERR1;
+  return 0;
+  }
 
-if (c == CHAR_NULL && ptr >= cb->end_pattern) *errorcodeptr = ERR1;
+GETCHARINCTEST(c, ptr);         /* Get character value, increment pointer */
+ptr--;                          /* Set pointer back to the last code unit */
 
 /* Non-alphanumerics are literals, so we just leave the value in c. An initial
 value test saves a memory lookup for code points outside the alphanumeric
 range. Otherwise, do a table lookup. A non-zero result is something that can be
 returned immediately. Otherwise further processing is required. */
 
-else if (c < ESCAPES_FIRST || c > ESCAPES_LAST) {}  /* Definitely literal */
+if (c < ESCAPES_FIRST || c > ESCAPES_LAST) {}  /* Definitely literal */
 
 else if ((i = escapes[c - ESCAPES_FIRST]) != 0)
   {
@@ -1745,7 +1822,9 @@ else if ((i = escapes[c - ESCAPES_FIRST]) != 0)
     }
   }
 
-/* Escapes that need further processing, including those that are unknown. */
+/* Escapes that need further processing, including those that are unknown.
+When called from pcre2_substitute(), only \c, \o, and \x are recognized (and \u
+when BSUX is set). */
 
 else
   {
@@ -1753,6 +1832,15 @@ else
   BOOL braced, negated, overflow;
   unsigned int s;
 
+  /* Filter calls from pcre2_substitute(). */
+
+  if (cb == NULL && c != CHAR_c && c != CHAR_o && c != CHAR_x &&
+      (c != CHAR_u || (options & PCRE2_ALT_BSUX) != 0))
+    {
+    *errorcodeptr = ERR3;
+    return 0;
+    }
+
   switch (c)
     {
     /* A number of Perl escapes are not handled by PCRE. We give an explicit
@@ -1884,7 +1972,7 @@ else
       s = cb->bracount - (s - 1);
       }
 
-    escape = -s;
+    escape = -(int)s;
     break;
 
     /* The handling of escape sequences consisting of a string of digits
@@ -1896,8 +1984,7 @@ else
     number is less than 10, or if there are that many previous extracting left
     brackets, it is a back reference. Otherwise, up to three octal digits are
     read to form an escaped character code. Thus \123 is likely to be octal 123
-    (cf \0123, which is octal 012 followed by the literal 3). If the octal
-    value is greater than 377, the least significant 8 bits are taken.
+    (cf \0123, which is octal 012 followed by the literal 3).
 
     Inside a character class, \ followed by a digit is always either a literal
     8 or 9 or an octal number. */
@@ -1909,7 +1996,7 @@ else
       {
       oldptr = ptr;
       /* The integer range is limited by the machine's int representation. */
-      s = (int)(c - CHAR_0);
+      s = c - CHAR_0;
       overflow = FALSE;
       while (IS_DIGIT(ptr[1]))
         {
@@ -1927,13 +2014,12 @@ else
         break;
         }
 
-      /* \1 to \9 are always back references. \8x and \9x are too, unless there
-      are an awful lot of previous captures; \1x to \7x are octal escapes if
-      there are not that many previous captures. */
+      /* \1 to \9 are always back references. \8x and \9x are too; \1x to \7x
+      are octal escapes if there are not that many previous captures. */
 
       if (s < 10 || *oldptr >= CHAR_8 || s <= cb->bracount)
         {
-        escape = -s;     /* Indicates a back reference */
+        escape = -(int)s;     /* Indicates a back reference */
         break;
         }
       ptr = oldptr;      /* Put the pointer back and fall through */
@@ -1981,7 +2067,7 @@ else
 #if PCRE2_CODE_UNIT_WIDTH == 32
         if (c >= 0x20000000l) { overflow = TRUE; break; }
 #endif
-        c = (c << 3) + cc - CHAR_0 ;
+        c = (c << 3) + (cc - CHAR_0);
 #if PCRE2_CODE_UNIT_WIDTH == 8
         if (c > (utf ? 0x10ffffU : 0xffU)) { overflow = TRUE; break; }
 #elif PCRE2_CODE_UNIT_WIDTH == 16
@@ -2105,8 +2191,8 @@ else
 #endif
 
     c = *(++ptr);
-    if (c >= CHAR_a && c <= CHAR_z) c += ESCAPES_UPPER_CASE;
-    if (c == CHAR_NULL && ptr >= cb->end_pattern)
+    if (c >= CHAR_a && c <= CHAR_z) c = UPPER_CASE(c);
+    if (c == CHAR_NULL && ptr >= ptrend)
       {
       *errorcodeptr = ERR2;
       break;
@@ -2333,175 +2419,6 @@ return p;
 
 
 
-/*************************************************
-*    Scan compiled regex for specific bracket    *
-*************************************************/
-
-/* This function scans through a compiled pattern until it finds a
-capturing bracket with the given number, or, if the number is negative, an
-instance of OP_REVERSE for a lookbehind. The function is global in the C sense
-so that it can be called from pcre2_study() when finding the minimum matching
-length.
-
-Arguments:
-  code        points to start of expression
-  utf         TRUE in UTF mode
-  number      the required bracket number or negative to find a lookbehind
-
-Returns:      pointer to the opcode for the bracket, or NULL if not found
-*/
-
-PCRE2_SPTR
-PRIV(find_bracket)(PCRE2_SPTR code, BOOL utf, int number)
-{
-for (;;)
-  {
-  register PCRE2_UCHAR c = *code;
-
-  if (c == OP_END) return NULL;
-
-  /* XCLASS is used for classes that cannot be represented just by a bit map.
-  This includes negated single high-valued characters. CALLOUT_STR is used for
-  callouts with string arguments. In both cases the length in the table is
-  zero; the actual length is stored in the compiled code. */
-
-  if (c == OP_XCLASS) code += GET(code, 1);
-    else if (c == OP_CALLOUT_STR) code += GET(code, 1 + 2*LINK_SIZE);
-
-  /* Handle recursion */
-
-  else if (c == OP_REVERSE)
-    {
-    if (number < 0) return (PCRE2_UCHAR *)code;
-    code += PRIV(OP_lengths)[c];
-    }
-
-  /* Handle capturing bracket */
-
-  else if (c == OP_CBRA || c == OP_SCBRA ||
-           c == OP_CBRAPOS || c == OP_SCBRAPOS)
-    {
-    int n = (int)GET2(code, 1+LINK_SIZE);
-    if (n == number) return (PCRE2_UCHAR *)code;
-    code += PRIV(OP_lengths)[c];
-    }
-
-  /* Otherwise, we can get the item's length from the table, except that for
-  repeated character types, we have to test for \p and \P, which have an extra
-  two bytes of parameters, and for MARK/PRUNE/SKIP/THEN with an argument, we
-  must add in its length. */
-
-  else
-    {
-    switch(c)
-      {
-      case OP_TYPESTAR:
-      case OP_TYPEMINSTAR:
-      case OP_TYPEPLUS:
-      case OP_TYPEMINPLUS:
-      case OP_TYPEQUERY:
-      case OP_TYPEMINQUERY:
-      case OP_TYPEPOSSTAR:
-      case OP_TYPEPOSPLUS:
-      case OP_TYPEPOSQUERY:
-      if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
-      break;
-
-      case OP_TYPEUPTO:
-      case OP_TYPEMINUPTO:
-      case OP_TYPEEXACT:
-      case OP_TYPEPOSUPTO:
-      if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
-        code += 2;
-      break;
-
-      case OP_MARK:
-      case OP_PRUNE_ARG:
-      case OP_SKIP_ARG:
-      case OP_THEN_ARG:
-      code += code[1];
-      break;
-      }
-
-    /* Add in the fixed length from the table */
-
-    code += PRIV(OP_lengths)[c];
-
-  /* In UTF-8 and UTF-16 modes, opcodes that are followed by a character may be
-  followed by a multi-byte character. The length in the table is a minimum, so
-  we have to arrange to skip the extra bytes. */
-
-#ifdef MAYBE_UTF_MULTI
-    if (utf) switch(c)
-      {
-      case OP_CHAR:
-      case OP_CHARI:
-      case OP_NOT:
-      case OP_NOTI:
-      case OP_EXACT:
-      case OP_EXACTI:
-      case OP_NOTEXACT:
-      case OP_NOTEXACTI:
-      case OP_UPTO:
-      case OP_UPTOI:
-      case OP_NOTUPTO:
-      case OP_NOTUPTOI:
-      case OP_MINUPTO:
-      case OP_MINUPTOI:
-      case OP_NOTMINUPTO:
-      case OP_NOTMINUPTOI:
-      case OP_POSUPTO:
-      case OP_POSUPTOI:
-      case OP_NOTPOSUPTO:
-      case OP_NOTPOSUPTOI:
-      case OP_STAR:
-      case OP_STARI:
-      case OP_NOTSTAR:
-      case OP_NOTSTARI:
-      case OP_MINSTAR:
-      case OP_MINSTARI:
-      case OP_NOTMINSTAR:
-      case OP_NOTMINSTARI:
-      case OP_POSSTAR:
-      case OP_POSSTARI:
-      case OP_NOTPOSSTAR:
-      case OP_NOTPOSSTARI:
-      case OP_PLUS:
-      case OP_PLUSI:
-      case OP_NOTPLUS:
-      case OP_NOTPLUSI:
-      case OP_MINPLUS:
-      case OP_MINPLUSI:
-      case OP_NOTMINPLUS:
-      case OP_NOTMINPLUSI:
-      case OP_POSPLUS:
-      case OP_POSPLUSI:
-      case OP_NOTPOSPLUS:
-      case OP_NOTPOSPLUSI:
-      case OP_QUERY:
-      case OP_QUERYI:
-      case OP_NOTQUERY:
-      case OP_NOTQUERYI:
-      case OP_MINQUERY:
-      case OP_MINQUERYI:
-      case OP_NOTMINQUERY:
-      case OP_NOTMINQUERYI:
-      case OP_POSQUERY:
-      case OP_POSQUERYI:
-      case OP_NOTPOSQUERY:
-      case OP_NOTPOSQUERYI:
-      if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]);
-      break;
-      }
-#else
-    (void)(utf);  /* Keep compiler happy by referencing function argument */
-#endif  /* MAYBE_UTF_MULTI */
-    }
-  }
-}
-
-
-
 /*************************************************
 *   Scan compiled regex for recursion reference  *
 *************************************************/
@@ -2649,82 +2566,6 @@ for (;;)
 
 
 
-/*************************************************
-*    Adjust OP_RECURSE items in repeated group   *
-*************************************************/
-
-/* OP_RECURSE items contain an offset from the start of the regex to the group
-that is referenced. This means that groups can be replicated for fixed
-repetition simply by copying (because the recursion is allowed to refer to
-earlier groups that are outside the current group). However, when a group is
-optional (i.e. the minimum quantifier is zero), OP_BRAZERO or OP_SKIPZERO is
-inserted before it, after it has been compiled. This means that any OP_RECURSE
-items within it that refer to the group itself or any contained groups have to
-have their offsets adjusted. That is one of the jobs of this function. Before
-it is called, the partially compiled regex must be temporarily terminated with
-OP_END.
-
-This function has been extended to cope with forward references for recursions
-and subroutine calls. It must check the list of such references for the
-group we are dealing with. If it finds that one of the recursions in the
-current group is on this list, it does not adjust the value in the reference
-(which is a group number). After the group has been scanned, all the offsets in
-the forward reference list for the group are adjusted.
-
-Arguments:
-  group             points to the start of the group
-  adjust            the amount by which the group is to be moved
-  utf               TRUE in UTF mode
-  cb                compile data
-  save_hwm_offset   the hwm forward reference offset at the start of the group
-
-Returns:     nothing
-*/
-
-static void
-adjust_recurse(PCRE2_UCHAR *group, int adjust, BOOL utf, compile_block *cb,
-  size_t save_hwm_offset)
-{
-uint32_t offset;
-PCRE2_UCHAR *hc;
-PCRE2_UCHAR *ptr = group;
-
-/* Scan the group for recursions. For each one found, check the forward
-reference list. */
-
-while ((ptr = (PCRE2_UCHAR *)find_recurse(ptr, utf)) != NULL)
-  {
-  for (hc = (PCRE2_UCHAR *)cb->start_workspace + save_hwm_offset; hc < cb->hwm;
-       hc += LINK_SIZE)
-    {
-    offset = (int)GET(hc, 0);
-    if (cb->start_code + offset == ptr + 1) break;
-    }
-
-  /* If we have not found this recursion on the forward reference list, adjust
-  the recursion's offset if it's after the start of this group. */
-
-  if (hc >= cb->hwm)
-    {
-    offset = (int)GET(ptr, 1);
-    if (cb->start_code + offset >= group) PUT(ptr, 1, offset + adjust);
-    }
-
-  ptr += 1 + LINK_SIZE;
-  }
-
-/* Now adjust all forward reference offsets for the group. */
-
-for (hc = (PCRE2_UCHAR *)cb->start_workspace + save_hwm_offset; hc < cb->hwm;
-     hc += LINK_SIZE)
-  {
-  offset = (int)GET(hc, 0);
-  PUT(hc, 0, offset + adjust);
-  }
-}
-
-
-
 /*************************************************
 *           Check for POSIX class syntax         *
 *************************************************/
@@ -2743,16 +2584,18 @@ didn't consider this to be a POSIX class. Likewise for [:1234:].
 The problem in trying to be exactly like Perl is in the handling of escapes. We
 have to be sure that [abc[:x\]pqr] is *not* treated as containing a POSIX
 class, but [abc[:x\]pqr:]] is (so that an error can be generated). The code
-below handles the special case of \], but does not try to do any other escape
-processing. This makes it different from Perl for cases such as [:l\ower:]
-where Perl recognizes it as the POSIX class "lower" but PCRE does not recognize
-"l\ower". This is a lesser evil than not diagnosing bad classes when Perl does,
-I think.
+below handles the special cases \\ and \], but does not try to do any other
+escape processing. This makes it different from Perl for cases such as
+[:l\ower:] where Perl recognizes it as the POSIX class "lower" but PCRE does
+not recognize "l\ower". This is a lesser evil than not diagnosing bad classes
+when Perl does, I think.
 
 A user pointed out that PCRE was rejecting [:a[:digit:]] whereas Perl was not.
 It seems that the appearance of a nested POSIX class supersedes an apparent
 external class. For example, [:a[:digit:]b:] matches "a", "b", ":", or
-a digit.
+a digit. This is handled by returning FALSE if the start of a new group with
+the same terminator is encountered, since the next closing sequence must close
+the nested group, not the outer one.
 
 In Perl, unescaped square brackets may also appear as part of class names. For
 example, [:a[:abc]b:] gives unknown POSIX class "[:abc]b:]". However, for
@@ -2775,22 +2618,18 @@ terminator = *(++ptr);   /* compiler warns about "non-constant" initializer. */
 
 for (++ptr; *ptr != CHAR_NULL; ptr++)
   {
-  if (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET) ptr++;
-  else if (*ptr == CHAR_RIGHT_SQUARE_BRACKET) return FALSE;
-  else
+  if (*ptr == CHAR_BACKSLASH &&
+      (ptr[1] == CHAR_RIGHT_SQUARE_BRACKET || ptr[1] == CHAR_BACKSLASH))
+    ptr++;
+  else if ((*ptr == CHAR_LEFT_SQUARE_BRACKET && ptr[1] == terminator) ||
+            *ptr == CHAR_RIGHT_SQUARE_BRACKET) return FALSE;
+  else if (*ptr == terminator && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
     {
-    if (*ptr == terminator && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
-      {
-      *endptr = ptr;
-      return TRUE;
-      }
-    if (*ptr == CHAR_LEFT_SQUARE_BRACKET &&
-         (ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
-          ptr[1] == CHAR_EQUALS_SIGN) &&
-        check_posix_syntax(ptr, endptr))
-      return FALSE;
+    *endptr = ptr;
+    return TRUE;
     }
   }
+
 return FALSE;
 }
 
@@ -3126,6 +2965,187 @@ return n8;
 
 
 
+/*************************************************
+*       Process (*VERB) name for escapes         *
+*************************************************/
+
+/* This function is called when the PCRE2_ALT_VERBNAMES option is set, to
+process the characters in a verb's name argument. It is called twice, once with
+codeptr == NULL, to find out the length of the processed name, and again to put
+the name into memory.
+
+Arguments:
+  ptrptr        pointer to the input pointer
+  codeptr       pointer to the compiled code pointer
+  errorcodeptr  pointer to the error code
+  options       the options bits
+  utf           TRUE if processing UTF
+  cb            compile data block
+
+Returns:        length of the processed name, or < 0 on error
+*/
+
+static int
+process_verb_name(PCRE2_SPTR *ptrptr, PCRE2_UCHAR **codeptr, int *errorcodeptr,
+  uint32_t options, BOOL utf, compile_block *cb)
+{
+int32_t arglen = 0;
+BOOL inescq = FALSE;
+PCRE2_SPTR ptr = *ptrptr;
+PCRE2_UCHAR *code = (codeptr == NULL)? NULL : *codeptr;
+
+for (; ptr < cb->end_pattern; ptr++)
+  {
+  uint32_t x = *ptr;
+
+  /* Skip over literals */
+
+  if (inescq)
+    {
+    if (x == CHAR_BACKSLASH && ptr[1] == CHAR_E)
+      {
+      inescq = FALSE;
+      ptr++;;
+      continue;
+      }
+    }
+
+  else  /* Not a literal character */
+    {
+    if (x == CHAR_RIGHT_PARENTHESIS) break;
+
+    /* Skip over comments and whitespace in extended mode. */
+
+    if ((options & PCRE2_EXTENDED) != 0)
+      {
+      PCRE2_SPTR wscptr = ptr;
+      while (MAX_255(x) && (cb->ctypes[x] & ctype_space) != 0) x = *(++ptr);
+      if (x == CHAR_NUMBER_SIGN)
+        {
+        ptr++;
+        while (*ptr != CHAR_NULL || ptr < cb->end_pattern)
+          {
+          if (IS_NEWLINE(ptr))       /* For non-fixed-length newline cases, */
+            {                        /* IS_NEWLINE sets cb->nllen. */
+            ptr += cb->nllen;
+            break;
+            }
+          ptr++;
+#ifdef SUPPORT_UNICODE
+          if (utf) FORWARDCHAR(ptr);
+#endif
+          }
+        }
+
+      /* If we have skipped any characters, restart the loop. */
+
+      if (ptr > wscptr)
+        {
+        ptr--;
+        continue;
+        }
+      }
+
+    /* Process escapes */
+
+    if (x == '\\')
+      {
+      int rc;
+      *errorcodeptr = 0;
+      rc = PRIV(check_escape)(&ptr, cb->end_pattern, &x, errorcodeptr, options,
+        FALSE, cb);
+      *ptrptr = ptr;   /* For possible error */
+      if (*errorcodeptr != 0) return -1;
+      if (rc != 0)
+        {
+        if (rc == ESC_Q)
+          {
+          inescq = TRUE;
+          continue;
+          }
+        if (rc == ESC_E) continue;
+        *errorcodeptr = ERR40;
+        return -1;
+        }
+      }
+    }
+
+  /* We have the next character in the name. */
+
+#ifdef SUPPORT_UNICODE
+  if (utf)
+    {
+    if (code == NULL)   /* Just want the length */
+      {
+#if PCRE2_CODE_UNIT_WIDTH == 8
+      int i;
+      for (i = 0; i < PRIV(utf8_table1_size); i++)
+        if ((int)x <= PRIV(utf8_table1)[i]) break;
+      arglen += i;
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+      if (x > 0xffff) arglen++;
+#endif
+      }
+    else
+      {
+      PCRE2_UCHAR cbuff[8];
+      x = PRIV(ord2utf)(x, cbuff);
+      memcpy(code, cbuff, CU2BYTES(x));
+      code += x;
+      }
+    }
+  else
+#endif  /* SUPPORT_UNICODE */
+
+  /* Not UTF */
+    {
+    if (code != NULL) *code++ = x;
+    }
+
+  arglen++;
+
+  if ((unsigned int)arglen > MAX_MARK)
+    {
+    *errorcodeptr = ERR76;
+    *ptrptr = ptr;
+    return -1;
+    }
+  }
+
+/* Update the pointers before returning. */
+
+*ptrptr = ptr;
+if (codeptr != NULL) *codeptr = code;
+return arglen;
+}
+
+
+
+/*************************************************
+*          Macro for the next two functions      *
+*************************************************/
+
+/* Both scan_for_captures() and compile_branch() use this macro to generate a
+fragment of code that reads the characters of a name and sets its length
+(checking for not being too long). Count the characters dynamically, to avoid
+the possibility of integer overflow. The same macro is used for reading *VERB
+names. */
+
+#define READ_NAME(ctype, errno, errset)                      \
+  namelen = 0;                                               \
+  while (MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype) != 0)   \
+    {                                                        \
+    ptr++;                                                   \
+    namelen++;                                               \
+    if (namelen > MAX_NAME_SIZE)                             \
+      {                                                      \
+      errset = errno;                                        \
+      goto FAILED;                                           \
+      }                                                      \
+    }
+
+
+
 /*************************************************
 *      Scan regex to identify named groups       *
 *************************************************/
@@ -3157,6 +3177,7 @@ static uint32_t scan_for_captures(PCRE2_SPTR *ptrptr, uint32_t options,
   compile_block *cb)
 {
 uint32_t c;
+uint32_t delimiter;
 uint32_t nest_depth = 0;
 uint32_t set, unset, *optset;
 int errorcode = 0;
@@ -3165,18 +3186,39 @@ int namelen;
 int i;
 BOOL inescq = FALSE;
 BOOL isdupname;
+BOOL skiptoket = FALSE;
 BOOL utf = (options & PCRE2_UTF) != 0;
 BOOL negate_class;
 PCRE2_SPTR name;
+PCRE2_SPTR start;
 PCRE2_SPTR ptr = *ptrptr;
 named_group *ng;
 nest_save *top_nest = NULL;
 nest_save *end_nests = (nest_save *)(cb->start_workspace + cb->workspace_size);
 
+/* The size of the nest_save structure might not be a factor of the size of the
+workspace. Therefore we must round down end_nests so as to correctly avoid
+creating a nest_save that spans the end of the workspace. */
+
+end_nests = (nest_save *)((char *)end_nests -
+  ((cb->workspace_size * sizeof(PCRE2_UCHAR)) % sizeof(nest_save)));
+
+/* Now scan the pattern */
+
 for (; ptr < cb->end_pattern; ptr++)
   {
   c = *ptr;
 
+  /* Parenthesized groups set skiptoket when all following characters up to the
+  next closing parenthesis must be ignored. The parenthesis itself must be
+  processed (to end the nested parenthesized item). */
+
+  if (skiptoket)
+    {
+    if (c != CHAR_RIGHT_PARENTHESIS) continue;
+    skiptoket = FALSE;
+    }
+
   /* Skip over literals */
 
   if (inescq)
@@ -3226,7 +3268,8 @@ for (; ptr < cb->end_pattern; ptr++)
 
     case CHAR_BACKSLASH:
     errorcode = 0;
-    escape = check_escape(&ptr, &c, &errorcode, options, FALSE, cb);
+    escape = PRIV(check_escape)(&ptr, cb->end_pattern, &c, &errorcode, options,
+      FALSE, cb);
     if (errorcode != 0) goto FAILED;
     if (escape == ESC_Q) inescq = TRUE;
     break;
@@ -3238,7 +3281,7 @@ for (; ptr < cb->end_pattern; ptr++)
     if (PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0 ||
         PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)
       {
-      ptr += 7;
+      ptr += 6;
       break;
       }
 
@@ -3273,6 +3316,8 @@ for (; ptr < cb->end_pattern; ptr++)
 
     for (;;)
       {
+      PCRE2_SPTR tempptr;
+
       if (c == CHAR_NULL && ptr >= cb->end_pattern)
         {
         errorcode = ERR6;  /* Missing terminating ']' */
@@ -3299,16 +3344,17 @@ for (; ptr < cb->end_pattern; ptr++)
         }
 
       /* Skip POSIX class names. */
-
       if (c == CHAR_LEFT_SQUARE_BRACKET &&
           (ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
-           ptr[1] == CHAR_EQUALS_SIGN) && check_posix_syntax(ptr, &ptr))
-        ptr ++;
-
+           ptr[1] == CHAR_EQUALS_SIGN) && check_posix_syntax(ptr, &tempptr))
+        {
+        ptr = tempptr + 1;
+        }
       else if (c == CHAR_BACKSLASH)
         {
         errorcode = 0;
-        escape = check_escape(&ptr, &c, &errorcode, options, TRUE, cb);
+        escape = PRIV(check_escape)(&ptr, cb->end_pattern, &c, &errorcode,
+          options, TRUE, cb);
         if (errorcode != 0) goto FAILED;
         if (escape == ESC_Q) inescq = TRUE;
         }
@@ -3326,13 +3372,34 @@ for (; ptr < cb->end_pattern; ptr++)
 
     if (ptr[1] != CHAR_QUESTION_MARK)
       {
-      if (ptr[1] != CHAR_ASTERISK &&
-          (options & PCRE2_NO_AUTO_CAPTURE) == 0)
-        cb->bracount++;  /* Capturing group */
-      else  /* (*something) - just skip to closing ket */
+      if (ptr[1] != CHAR_ASTERISK)
+        {
+        if ((options & PCRE2_NO_AUTO_CAPTURE) == 0) cb->bracount++;
+        }
+
+      /* (*something) - just skip to closing ket unless PCRE2_ALT_VERBNAMES is
+      set, in which case we have to process escapes in the string after the
+      name. */
+
+      else
         {
         ptr += 2;
-        while (ptr < cb->end_pattern && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
+        while (MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype_word) != 0) ptr++;
+        if (*ptr == CHAR_COLON)
+          {
+          ptr++;
+          if ((options & PCRE2_ALT_VERBNAMES) != 0)
+            {
+            if (process_verb_name(&ptr, NULL, &errorcode, options, utf, cb) < 0)
+              goto FAILED;
+            }
+          else
+            {
+            while (ptr < cb->end_pattern && *ptr != CHAR_RIGHT_PARENTHESIS)
+              ptr++;
+            }
+          }
+        nest_depth--;
         }
       }
 
@@ -3342,10 +3409,14 @@ for (; ptr < cb->end_pattern; ptr++)
       {
       default:
       ptr += 2;
-      if (ptr[0] == CHAR_R ||                                 /* (?R) */
-          ptr[0] == CHAR_C ||                                 /* (?C) */
-          IS_DIGIT(ptr[0]) ||                                 /* (?n) */
-          (ptr[0] == CHAR_MINUS && IS_DIGIT(ptr[1]))) break;  /* (?-n) */
+      if (ptr[0] == CHAR_R ||                           /* (?R) */
+          ptr[0] == CHAR_NUMBER_SIGN ||                 /* (?#) */
+          IS_DIGIT(ptr[0]) ||                           /* (?n) */
+          (ptr[0] == CHAR_MINUS && IS_DIGIT(ptr[1])))   /* (?-n) */
+        {
+        skiptoket = TRUE;
+        break;
+        }
 
       /* Handle (?| and (?imsxJU: which are the only other valid forms. Both
       need a new block on the nest stack. */
@@ -3366,6 +3437,7 @@ for (; ptr < cb->end_pattern; ptr++)
         top_nest->reset_group = cb->bracount;
         top_nest->max_group = cb->bracount;
         top_nest->flags |= NSF_RESET;
+        cb->external_flags |= PCRE2_DUPCAPUSED;
         break;
         }
 
@@ -3420,19 +3492,93 @@ for (; ptr < cb->end_pattern; ptr++)
         }
       break;
 
-      case CHAR_NUMBER_SIGN:
-      ptr += 3;
-      while (ptr < cb->end_pattern && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
-      if (*ptr != CHAR_RIGHT_PARENTHESIS)
+      /* Skip over a numerical or string argument for a callout. */
+
+      case CHAR_C:
+      ptr += 2;
+      if (ptr[1] == CHAR_RIGHT_PARENTHESIS) break;
+      if (IS_DIGIT(ptr[1]))
+        {
+        while (IS_DIGIT(ptr[1])) ptr++;
+        }
+
+      /* Handle a string argument */
+
+      else
+        {
+        ptr++;
+        delimiter = 0;
+        for (i = 0; PRIV(callout_start_delims)[i] != 0; i++)
+          {
+          if (*ptr == PRIV(callout_start_delims)[i])
+            {
+            delimiter = PRIV(callout_end_delims)[i];
+            break;
+            }
+          }
+
+        if (delimiter == 0)
+          {
+          errorcode = ERR82;
+          goto FAILED;
+          }
+
+        start = ptr;
+        do
+          {
+          if (++ptr >= cb->end_pattern)
+            {
+            errorcode = ERR81;
+            ptr = start;   /* To give a more useful message */
+            goto FAILED;
+            }
+          if (ptr[0] == delimiter && ptr[1] == delimiter) ptr += 2;
+          }
+        while (ptr[0] != delimiter);
+        }
+
+      /* Check terminating ) */
+
+      if (ptr[1] != CHAR_RIGHT_PARENTHESIS)
         {
-        errorcode = ERR18;
+        errorcode = ERR39;
+        ptr++;
         goto FAILED;
         }
       break;
 
+      /* Conditional group */
+
       case CHAR_LEFT_PARENTHESIS:
-      nest_depth++;
-      /* Fall through */
+      if (ptr[3] != CHAR_QUESTION_MARK)   /* Not assertion or callout */
+        {
+        nest_depth++;
+        ptr += 2;
+        break;
+        }
+
+      /* Must be an assertion or a callout */
+
+      switch(ptr[4])
+       {
+       case CHAR_LESS_THAN_SIGN:
+       if (ptr[5] != CHAR_EXCLAMATION_MARK && ptr[5] != CHAR_EQUALS_SIGN)
+         goto MISSING_ASSERTION;
+       /* Fall through */
+
+       case CHAR_C:
+       case CHAR_EXCLAMATION_MARK:
+       case CHAR_EQUALS_SIGN:
+       ptr++;
+       break;
+
+       default:
+       MISSING_ASSERTION:
+       ptr += 3;            /* To improve error message */
+       errorcode = ERR28;
+       goto FAILED;
+       }
+      break;
 
       case CHAR_COLON:
       case CHAR_GREATER_THAN_SIGN:
@@ -3486,8 +3632,8 @@ for (; ptr < cb->end_pattern; ptr++)
         goto FAILED;
         }
 
-      while (MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype_word) != 0) ptr++;
-      namelen = (int)(ptr - name);
+      /* Advance ptr, set namelen and check its length. */
+      READ_NAME(ctype_word, ERR48, errorcode);
 
       if (*ptr != c)
         {
@@ -3502,14 +3648,7 @@ for (; ptr < cb->end_pattern; ptr++)
         }
 
       if (namelen + IMM2_SIZE + 1 > cb->name_entry_size)
-        {
         cb->name_entry_size = namelen + IMM2_SIZE + 1;
-        if (namelen > MAX_NAME_SIZE)
-          {
-          errorcode = ERR48;
-          goto FAILED;
-          }
-        }
 
       /* We have a valid name for this capturing group. */
 
@@ -3609,7 +3748,7 @@ for (; ptr < cb->end_pattern; ptr++)
       if (top_nest == (nest_save *)(cb->start_workspace)) top_nest = NULL;
         else top_nest--;
       }
-    nest_depth--;
+    if (nest_depth > 0) nest_depth--;  /* Can be 0 for unmatched ) */
     break;
     }
   }
@@ -3674,7 +3813,6 @@ int32_t req_caseopt, reqvary, tempreqvary;
 int after_manual_callout = 0;
 int escape;
 size_t length_prevgroup = 0;
-size_t item_hwm_offset = 0;
 register uint32_t c;
 register PCRE2_UCHAR *code = *codeptr;
 PCRE2_UCHAR *last_code = code;
@@ -3684,7 +3822,6 @@ BOOL inescq = FALSE;
 BOOL groupsetfirstcu = FALSE;
 PCRE2_SPTR ptr = *ptrptr;
 PCRE2_SPTR tempptr;
-PCRE2_SPTR nestptr = NULL;
 PCRE2_UCHAR *previous = NULL;
 PCRE2_UCHAR *previous_callout = NULL;
 uint8_t classbits[32];
@@ -3745,6 +3882,7 @@ for (;; ptr++)
   {
   BOOL negate_class;
   BOOL should_flip_negation;
+  BOOL match_all_or_no_wide_chars;
   BOOL possessive_quantifier;
   BOOL is_quantifier;
   BOOL is_recurse;
@@ -3772,12 +3910,14 @@ for (;; ptr++)
   c = *ptr;
 
   /* If we are at the end of a nested substitution, revert to the outer level
-  string. Nesting only happens one level deep. */
+  string. Nesting only happens one or two levels deep, and the inserted string
+  is always zero terminated. */
 
-  if (c == CHAR_NULL && nestptr != NULL)
+  if (c == CHAR_NULL && cb->nestptr[0] != NULL)
     {
-    ptr = nestptr;
-    nestptr = NULL;
+    ptr = cb->nestptr[0];
+    cb->nestptr[0] = cb->nestptr[1];
+    cb->nestptr[1] = NULL;
     c = *ptr;
     }
 
@@ -3789,7 +3929,8 @@ for (;; ptr++)
     if (code > cb->start_workspace + cb->workspace_size -
         WORK_SIZE_SAFETY_MARGIN)                       /* Check for overrun */
       {
-      *errorcodeptr = ERR52;
+      *errorcodeptr = (code >= cb->start_workspace + cb->workspace_size)?
+        ERR52 : ERR86;
       goto FAILED;
       }
 
@@ -3831,19 +3972,18 @@ for (;; ptr++)
     last_code = code;
     }
 
-  /* In the real compile phase, just check the workspace used by the forward
-  reference list. */
-
-  else if (cb->hwm > cb->start_workspace + cb->workspace_size -
-           WORK_SIZE_SAFETY_MARGIN)
-    {
-    *errorcodeptr = ERR52;
-    goto FAILED;
-    }
+  /* Before doing anything else we must handle all the special items that do
+  nothing, and which may come between an item and its quantifier. Otherwise,
+  when auto-callouts are enabled, a callout gets incorrectly inserted before
+  the quantifier is recognized. After recognizing a "do nothing" item, restart
+  the loop in case another one follows. */
 
-  /* If in \Q...\E, check for the end; if not, we have a literal */
+  /* If c is not NULL we are not at the end of the pattern. If it is NULL, we
+  may still be in the pattern with a NULL data item. In these cases, if we are
+  in \Q...\E, check for the \E that ends the literal string; if not, we have a
+  literal character. If not in \Q...\E, an isolated \E is ignored. */
 
-  if (inescq && (c != CHAR_NULL || ptr < cb->end_pattern))
+  if (c != CHAR_NULL || ptr < cb->end_pattern)
     {
     if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E)
       {
@@ -3851,7 +3991,7 @@ for (;; ptr++)
       ptr++;
       continue;
       }
-    else
+    else if (inescq)   /* Literal character */
       {
       if (previous_callout != NULL)
         {
@@ -3866,20 +4006,29 @@ for (;; ptr++)
         }
       goto NORMAL_CHAR;
       }
-    /* Control does not reach here. */
+
+    /* Check for the start of a \Q...\E sequence. We must do this here rather
+    than later in case it is immediately followed by \E, which turns it into a
+    "do nothing" sequence. */
+
+    if (c == CHAR_BACKSLASH && ptr[1] == CHAR_Q)
+      {
+      inescq = TRUE;
+      ptr++;
+      continue;
+      }
     }
 
-  /* In extended mode, skip white space and comments. We need a loop in order
-  to check for more white space and more comments after a comment. */
+  /* In extended mode, skip white space and #-comments that end at newline. */
 
   if ((options & PCRE2_EXTENDED) != 0)
     {
-    for (;;)
+    PCRE2_SPTR wscptr = ptr;
+    while (MAX_255(c) && (cb->ctypes[c] & ctype_space) != 0) c = *(++ptr);
+    if (c == CHAR_NUMBER_SIGN)
       {
-      while (MAX_255(c) && (cb->ctypes[c] & ctype_space) != 0) c = *(++ptr);
-      if (c != CHAR_NUMBER_SIGN) break;
       ptr++;
-      while (*ptr != CHAR_NULL)
+      while (ptr < cb->end_pattern)
         {
         if (IS_NEWLINE(ptr))         /* For non-fixed-length newline cases, */
           {                          /* IS_NEWLINE sets cb->nllen. */
@@ -3891,34 +4040,58 @@ for (;; ptr++)
         if (utf) FORWARDCHAR(ptr);
 #endif
         }
-      c = *ptr;     /* Either NULL or the char after a newline */
       }
+
+    /* If we skipped any characters, restart the loop. Otherwise, we didn't see
+    a comment. */
+
+    if (ptr > wscptr)
+      {
+      ptr--;
+      continue;
+      }
+    }
+
+  /* Skip over (?# comments. */
+
+  if (c == CHAR_LEFT_PARENTHESIS && ptr[1] == CHAR_QUESTION_MARK &&
+      ptr[2] == CHAR_NUMBER_SIGN)
+    {
+    ptr += 3;
+    while (ptr < cb->end_pattern && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
+    if (*ptr != CHAR_RIGHT_PARENTHESIS)
+      {
+      *errorcodeptr = ERR18;
+      goto FAILED;
+      }
+    continue;
     }
 
-  /* See if the next thing is a quantifier. */
+  /* End of processing "do nothing" items. See if the next thing is a
+  quantifier. */
 
   is_quantifier =
     c == CHAR_ASTERISK || c == CHAR_PLUS || c == CHAR_QUESTION_MARK ||
      (c == CHAR_LEFT_CURLY_BRACKET && is_counted_repeat(ptr+1));
 
-  /* Fill in length of a previous callout, except when the next thing is a
-  quantifier or when processing a property substitution string in UCP mode. */
+  /* Fill in length of a previous callout and create an auto callout if
+  required, except when the next thing is a quantifier or when processing a
+  property substitution string for \w etc in UCP mode. */
 
-  if (!is_quantifier && previous_callout != NULL && nestptr == NULL &&
-       after_manual_callout-- <= 0)
+  if (!is_quantifier && cb->nestptr[0] == NULL)
     {
-    if (lengthptr == NULL)      /* Don't attempt in pre-compile phase */
-      complete_callout(previous_callout, ptr, cb);
-    previous_callout = NULL;
-    }
-
-  /* Create auto callout, except for quantifiers, or while processing property
-  strings that are substituted for \w etc in UCP mode. */
+    if (previous_callout != NULL && after_manual_callout-- <= 0)
+      {
+      if (lengthptr == NULL)      /* Don't attempt in pre-compile phase */
+        complete_callout(previous_callout, ptr, cb);
+      previous_callout = NULL;
+      }
 
-  if ((options & PCRE2_AUTO_CALLOUT) != 0 && !is_quantifier && nestptr == NULL)
-    {
-    previous_callout = code;
-    code = auto_callout(code, ptr, cb);
+    if ((options & PCRE2_AUTO_CALLOUT) != 0)
+      {
+      previous_callout = code;
+      code = auto_callout(code, ptr, cb);
+      }
     }
 
   /* Process the next pattern item. */
@@ -3982,7 +4155,6 @@ for (;; ptr++)
     zeroreqcu = reqcu;
     zeroreqcuflags = reqcuflags;
     previous = code;
-    item_hwm_offset = cb->hwm - cb->start_workspace;
     *code++ = ((options & PCRE2_DOTALL) != 0)? OP_ALLANY: OP_ANY;
     break;
 
@@ -4008,28 +4180,31 @@ for (;; ptr++)
     In another (POSIX) regex library, the ugly syntax [[:<:]] and [[:>:]] is
     used for "start of word" and "end of word". As these are otherwise illegal
     sequences, we don't break anything by recognizing them. They are replaced
-    by \b(?=\w) and \b(?<=\w) respectively. Sequences like [a[:<:]] are
-    erroneous and are handled by the normal code below. */
+    by \b(?=\w) and \b(?<=\w) respectively. This can only happen at the top
+    nesting level, as no other inserted sequences will contains these oddities.
+    Sequences like [a[:<:]] are erroneous and are handled by the normal code
+    below. */
 
     case CHAR_LEFT_SQUARE_BRACKET:
     if (PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0)
       {
-      nestptr = ptr + 7;
-      ptr = sub_start_of_word - 1;
+      cb->nestptr[0] = ptr + 7;
+      ptr = sub_start_of_word;  /* Do not combine these statements; clang's */
+      ptr--;                    /* sanitizer moans about a negative index. */
       continue;
       }
 
     if (PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)
       {
-      nestptr = ptr + 7;
-      ptr = sub_end_of_word - 1;
+      cb->nestptr[0] = ptr + 7;
+      ptr = sub_end_of_word;    /* Do not combine these statements; clang's */
+      ptr--;                    /* sanitizer moans about a negative index. */
       continue;
       }
 
     /* Handle a real character class. */
 
     previous = code;
-    item_hwm_offset = cb->hwm - cb->start_workspace;
 
     /* PCRE supports POSIX class stuff inside a class. Perl gives an error if
     they are encountered at the top level, so we'll do that too. */
@@ -4079,11 +4254,13 @@ for (;; ptr++)
       break;
       }
 
-    /* If a class contains a negative special such as \S, we need to flip the
-    negation flag at the end, so that support for characters > 255 works
-    correctly (they are all included in the class). */
+    /* If a non-extended class contains a negative special such as \S, we need
+    to flip the negation flag at the end, so that support for characters > 255
+    works correctly (they are all included in the class). An extended class may
+    need to insert specific matching or non-matching code for wide characters.
+    */
 
-    should_flip_negation = FALSE;
+    should_flip_negation = match_all_or_no_wide_chars = FALSE;
 
     /* Extended class (xclass) will be used when characters > 255
     might match. */
@@ -4121,6 +4298,9 @@ for (;; ptr++)
     for(;;)
       {
       PCRE2_SPTR oldptr;
+#ifdef EBCDIC
+      BOOL range_is_literal = TRUE;
+#endif
 
       if (c == CHAR_NULL && ptr >= cb->end_pattern)
         {
@@ -4203,11 +4383,13 @@ for (;; ptr++)
           int pc = posix_class + ((local_negate)? POSIX_SUBSIZE/2 : 0);
 
           /* The posix_substitutes table specifies which POSIX classes can be
-          converted to \p or \P items. */
+          converted to \p or \P items. This can only happen at top nestling
+          level, as there will never be a POSIX class in a string that is
+          substituted for something else. */
 
           if (posix_substitutes[pc] != NULL)
             {
-            nestptr = tempptr + 1;
+            cb->nestptr[0] = tempptr + 1;
             ptr = posix_substitutes[pc] - 1;
             goto CONTINUE_CLASS;
             }
@@ -4232,10 +4414,22 @@ for (;; ptr++)
             ptr = tempptr + 1;
             goto CONTINUE_CLASS;
 
-            /* For all other POSIX classes, no special action is taken in UCP
-            mode. Fall through to the non_UCP case. */
+            /* For the other POSIX classes (ascii, xdigit) we are going to fall
+            through to the non-UCP case and build a bit map for characters with
+            code points less than 256. However, if we are in a negated POSIX
+            class, characters with code points greater than 255 must either all
+            match or all not match, depending on whether the whole class is not
+            or is negated. For example, for [[:^ascii:]... they must all match,
+            whereas for [^[:^xdigit:]... they must not.
+
+            In the special case where there are no xclass items, this is
+            automatically handled by the use of OP_CLASS or OP_NCLASS, but an
+            explicit range is needed for OP_XCLASS. Setting a flag here causes
+            the range to be generated later when it is known that OP_XCLASS is
+            required. */
 
             default:
+            match_all_or_no_wide_chars |= local_negate;
             break;
             }
           }
@@ -4299,9 +4493,16 @@ for (;; ptr++)
 
       if (c == CHAR_BACKSLASH)
         {
-        escape = check_escape(&ptr, &ec, errorcodeptr, options, TRUE, cb);
+        escape = PRIV(check_escape)(&ptr, cb->end_pattern, &ec, errorcodeptr,
+          options, TRUE, cb);
         if (*errorcodeptr != 0) goto FAILED;
-        if (escape == 0) c = ec;               /* Escaped single char */
+        if (escape == 0)    /* Escaped single char */
+          {
+          c = ec;
+#ifdef EBCDIC
+          range_is_literal = FALSE;
+#endif
+          }
         else if (escape == ESC_b) c = CHAR_BS; /* \b is backspace in a class */
         else if (escape == ESC_N)          /* \N is not supported in a class */
           {
@@ -4334,9 +4535,10 @@ for (;; ptr++)
             case ESC_DU:     /* when PCRE2_UCP is set. We replace the */
             case ESC_wu:     /* escape sequence with an appropriate \p */
             case ESC_WU:     /* or \P to test Unicode properties instead */
-            case ESC_su:     /* of the default ASCII testing. */
-            case ESC_SU:
-            nestptr = ptr;
+            case ESC_su:     /* of the default ASCII testing. This might be */
+            case ESC_SU:     /* a 2nd-level nesting for [[:<:]] or [[:>:]]. */
+            cb->nestptr[1] = cb->nestptr[0];
+            cb->nestptr[0] = ptr;
             ptr = substitutes[escape - ESC_DU] - 1;  /* Just before substitute */
             class_has_8bitchar--;                /* Undo! */
             break;
@@ -4503,9 +4705,12 @@ for (;; ptr++)
           if (d == CHAR_BACKSLASH)
             {
             int descape;
-            descape = check_escape(&ptr, &d, errorcodeptr, options, TRUE, cb);
+            descape = PRIV(check_escape)(&ptr, cb->end_pattern, &d,
+              errorcodeptr, options, TRUE, cb);
             if (*errorcodeptr != 0) goto FAILED;
-
+#ifdef EBCDIC
+            range_is_literal = FALSE;
+#endif
             /* 0 means a character was put into d; \b is backspace; any other
             special causes an error. */
 
@@ -4551,9 +4756,48 @@ for (;; ptr++)
 
         if (d == CHAR_CR || d == CHAR_NL) cb->external_flags |= PCRE2_HASCRORLF;
 
+        /* In an EBCDIC environment, Perl treats alphabetic ranges specially
+        because there are holes in the encoding, and simply using the range A-Z
+        (for example) would include the characters in the holes. This applies
+        only to literal ranges; [\xC1-\xE9] is different to [A-Z]. */
+
+#ifdef EBCDIC
+        if (range_is_literal &&
+             (cb->ctypes[c] & ctype_letter) != 0 &&
+             (cb->ctypes[d] & ctype_letter) != 0 &&
+             (c <= CHAR_z) == (d <= CHAR_z))
+          {
+          uint32_t uc = (c <= CHAR_z)? 0 : 64;
+          uint32_t C = c - uc;
+          uint32_t D = d - uc;
+
+          if (C <= CHAR_i)
+            {
+            class_has_8bitchar +=
+              add_to_class(classbits, &class_uchardata, options, cb, C + uc,
+                ((D < CHAR_i)? D : CHAR_i) + uc);
+            C = CHAR_j;
+            }
+
+          if (C <= D && C <= CHAR_r)
+            {
+            class_has_8bitchar +=
+              add_to_class(classbits, &class_uchardata, options, cb, C + uc,
+                ((D < CHAR_r)? D : CHAR_r) + uc);
+            C = CHAR_s;
+            }
+
+          if (C <= D)
+            {
+            class_has_8bitchar +=
+              add_to_class(classbits, &class_uchardata, options, cb, C + uc,
+                D + uc);
+            }
+          }
+        else
+#endif
         class_has_8bitchar +=
           add_to_class(classbits, &class_uchardata, options, cb, c, d);
-
         goto CONTINUE_CLASS;   /* Go get the next char in the class */
         }
 
@@ -4566,16 +4810,20 @@ for (;; ptr++)
       CLASS_SINGLE_CHARACTER:
       if (class_one_char < 2) class_one_char++;
 
-      /* If class_one_char is 1, we have the first single character in the
-      class, and there have been no prior ranges, or XCLASS items generated by
-      escapes. If this is the final character in the class, we can optimize by
-      turning the item into a 1-character OP_CHAR[I] if it's positive, or
-      OP_NOT[I] if it's negative. In the positive case, it can cause firstcu
-      to be set. Otherwise, there can be no first char if this item is first,
-      whatever repeat count may follow. In the case of reqcu, save the
-      previous value for reinstating. */
+      /* If class_one_char is 1 and xclass_has_prop is false, we have the first
+      single character in the class, and there have been no prior ranges, or
+      XCLASS items generated by escapes. If this is the final character in the
+      class, we can optimize by turning the item into a 1-character OP_CHAR[I]
+      if it's positive, or OP_NOT[I] if it's negative. In the positive case, it
+      can cause firstcu to be set. Otherwise, there can be no first char if
+      this item is first, whatever repeat count may follow. In the case of
+      reqcu, save the previous value for reinstating. */
 
-      if (!inescq && class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
+      if (!inescq &&
+#ifdef SUPPORT_UNICODE
+          !xclass_has_prop &&
+#endif
+          class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
         {
         ptr++;
         zeroreqcu = reqcu;
@@ -4636,10 +4884,11 @@ for (;; ptr++)
 
       CONTINUE_CLASS:
       c = *(++ptr);
-      if (c == 0 && nestptr != NULL)
+      if (c == CHAR_NULL && cb->nestptr[0] != NULL)
         {
-        ptr = nestptr;
-        nestptr = NULL;
+        ptr = cb->nestptr[0];
+        cb->nestptr[0] = cb->nestptr[1];
+        cb->nestptr[1] = NULL;
         c = *(++ptr);
         }
 
@@ -4675,21 +4924,36 @@ for (;; ptr++)
     zeroreqcu = reqcu;
     zeroreqcuflags = reqcuflags;
 
-    /* If there are characters with values > 255, we have to compile an
-    extended class, with its own opcode, unless there was a negated special
-    such as \S in the class, and PCRE2_UCP is not set, because in that case all
-    characters > 255 are in the class, so any that were explicitly given as
-    well can be ignored. If (when there are explicit characters > 255 that must
-    be listed) there are no characters < 256, we can omit the bitmap in the
-    actual compiled code. */
+    /* If there are characters with values > 255, or Unicode property settings
+    (\p or \P), we have to compile an extended class, with its own opcode,
+    unless there were no property settings and there was a negated special such
+    as \S in the class, and PCRE2_UCP is not set, because in that case all
+    characters > 255 are in or not in the class, so any that were explicitly
+    given as well can be ignored.
+
+    In the UCP case, if certain negated POSIX classes ([:^ascii:] or
+    [^:xdigit:]) were present in a class, we either have to match or not match
+    all wide characters (depending on whether the whole class is or is not
+    negated). This requirement is indicated by match_all_or_no_wide_chars being
+    true. We do this by including an explicit range, which works in both cases.
+
+    If, when generating an xclass, there are no characters < 256, we can omit
+    the bitmap in the actual compiled code. */
 
 #ifdef SUPPORT_WIDE_CHARS
 #ifdef SUPPORT_UNICODE
-    if (xclass && (!should_flip_negation || (options & PCRE2_UCP) != 0))
+    if (xclass && (xclass_has_prop || !should_flip_negation ||
+         (options & PCRE2_UCP) != 0))
 #elif PCRE2_CODE_UNIT_WIDTH != 8
-    if (xclass && !should_flip_negation)
+    if (xclass && (xclass_has_prop || !should_flip_negation))
 #endif
       {
+      if (match_all_or_no_wide_chars)
+        {
+        *class_uchardata++ = XCL_RANGE;
+        class_uchardata += PRIV(ord2utf)(0x100, class_uchardata);
+        class_uchardata += PRIV(ord2utf)(MAX_UTF_CODE_POINT, class_uchardata);
+        }
       *class_uchardata++ = XCL_END;    /* Marks the end of extra data */
       *code++ = OP_XCLASS;
       code += LINK_SIZE;
@@ -4794,26 +5058,26 @@ for (;; ptr++)
 
     if ((options & PCRE2_EXTENDED) != 0)
       {
-      PCRE2_SPTR p = ptr + 1;
+      ptr++;
       for (;;)
         {
-        while (MAX_255(*p) && (cb->ctypes[*p] & ctype_space) != 0) p++;
-        if (*p != CHAR_NUMBER_SIGN) break;
-        p++;
-        while (*p != CHAR_NULL)
+        while (MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype_space) != 0) ptr++;
+        if (*ptr != CHAR_NUMBER_SIGN) break;
+        ptr++;
+        while (ptr < cb->end_pattern)
           {
-          if (IS_NEWLINE(p))         /* For non-fixed-length newline cases, */
+          if (IS_NEWLINE(ptr))         /* For non-fixed-length newline cases, */
             {                        /* IS_NEWLINE sets cb->nllen. */
-            p += cb->nllen;
+            ptr += cb->nllen;
             break;
             }
-          p++;
+          ptr++;
 #ifdef SUPPORT_UNICODE
-          if (utf) FORWARDCHAR(p);
+          if (utf) FORWARDCHAR(ptr);
 #endif
           }           /* Loop for comment characters */
         }             /* Loop for multiple comments */
-      ptr = p - 1;    /* Character before the next significant one. */
+      ptr--;          /* Last code unit of previous character. */
       }
 
     /* If the next character is '+', we have a possessive quantifier. This
@@ -4835,6 +5099,10 @@ for (;; ptr++)
       }
     else repeat_type = greedy_default;
 
+    /* If the repeat is {1} we can ignore it. */
+
+    if (repeat_max == 1 && repeat_min == 1) goto END_REPEAT;
+
     /* If previous was a recursion call, wrap it in atomic brackets so that
     previous becomes the atomic group. All recursions were so wrapped in the
     past, but it no longer happens for non-repeated recursions. In fact, the
@@ -4850,16 +5118,6 @@ for (;; ptr++)
       PUT(previous, 3 + 2*LINK_SIZE, 2 + 2*LINK_SIZE);
       code += 2 + 2 * LINK_SIZE;
       length_prevgroup = 3 + 3*LINK_SIZE;
-
-      /* When actually compiling, we need to check whether this was a forward
-      reference, and if so, adjust the offset. */
-
-      if (lengthptr == NULL && cb->hwm >= cb->start_workspace + LINK_SIZE)
-        {
-        int offset = GET(cb->hwm, -LINK_SIZE);
-        if (offset == previous + 1 - cb->start_code)
-          PUT(cb->hwm, -LINK_SIZE, offset + 1 + LINK_SIZE);
-        }
       }
 
     /* Now handle repetition for the different types of item. */
@@ -4888,7 +5146,7 @@ for (;; ptr++)
       that it's a length rather than a small character. */
 
 #ifdef MAYBE_UTF_MULTI
-      if (utf && NOT_FIRSTCHAR(code[-1]))
+      if (utf && NOT_FIRSTCU(code[-1]))
         {
         PCRE2_UCHAR *lastchar = code - 1;
         BACKCHAR(lastchar);
@@ -5102,7 +5360,6 @@ for (;; ptr++)
       {
       register int i;
       int len = (int)(code - previous);
-      size_t base_hwm_offset = item_hwm_offset;
       PCRE2_UCHAR *bralink = NULL;
       PCRE2_UCHAR *brazeroptr = NULL;
 
@@ -5150,16 +5407,10 @@ for (;; ptr++)
         selectively.
 
         If the maximum is 1 or unlimited, we just have to stick in the BRAZERO
-        and do no more at this point. However, we do need to adjust any
-        OP_RECURSE calls inside the group that refer to the group itself or any
-        internal or forward referenced group, because the offset is from the
-        start of the whole regex. Temporarily terminate the pattern while doing
-        this. */
+        and do no more at this point. */
 
         if (repeat_max <= 1)    /* Covers 0, 1, and unlimited */
           {
-          *code = OP_END;
-          adjust_recurse(previous, 1, utf, cb, item_hwm_offset);
           memmove(previous + 1, previous, CU2BYTES(len));
           code++;
           if (repeat_max == 0)
@@ -5176,14 +5427,11 @@ for (;; ptr++)
         The first one has to be handled carefully because it's the original
         copy, which has to be moved up. The remainder can be handled by code
         that is common with the non-zero minimum case below. We have to
-        adjust the value or repeat_max, since one less copy is required. Once
-        again, we may have to adjust any OP_RECURSE calls inside the group. */
+        adjust the value or repeat_max, since one less copy is required. */
 
         else
           {
           int offset;
-          *code = OP_END;
-          adjust_recurse(previous, 2 + LINK_SIZE, utf, cb, item_hwm_offset);
           memmove(previous + 2 + LINK_SIZE, previous, CU2BYTES(len));
           code += 2 + LINK_SIZE;
           *previous++ = OP_BRAZERO + repeat_type;
@@ -5202,10 +5450,7 @@ for (;; ptr++)
 
       /* If the minimum is greater than zero, replicate the group as many
       times as necessary, and adjust the maximum to the number of subsequent
-      copies that we need. If we set a first char from the group, and didn't
-      set a required char, copy the latter from the former. If there are any
-      forward reference subroutine calls in the group, there will be entries on
-      the workspace list; replicate these with an appropriate increment. */
+      copies that we need. */
 
       else
         {
@@ -5231,9 +5476,7 @@ for (;; ptr++)
             }
 
           /* This is compiling for real. If there is a set first byte for
-          the group, and we have not yet set a "required byte", set it. Make
-          sure there is enough workspace for copying forward references before
-          doing the copy. */
+          the group, and we have not yet set a "required byte", set it. */
 
           else
             {
@@ -5242,29 +5485,9 @@ for (;; ptr++)
               reqcu = firstcu;
               reqcuflags = firstcuflags;
               }
-
             for (i = 1; i < repeat_min; i++)
               {
-              PCRE2_UCHAR *hc;
-              size_t this_hwm_offset = cb->hwm - cb->start_workspace;
               memcpy(code, previous, CU2BYTES(len));
-
-              while (cb->hwm > cb->start_workspace + cb->workspace_size -
-                     WORK_SIZE_SAFETY_MARGIN -
-                     (this_hwm_offset - base_hwm_offset))
-                {
-                *errorcodeptr = expand_workspace(cb);
-                if (*errorcodeptr != 0) goto FAILED;
-                }
-
-              for (hc = (PCRE2_UCHAR *)cb->start_workspace + base_hwm_offset;
-                   hc < (PCRE2_UCHAR *)cb->start_workspace + this_hwm_offset;
-                   hc += LINK_SIZE)
-                {
-                PUT(cb->hwm, 0, GET(hc, 0) + len);
-                cb->hwm += LINK_SIZE;
-                }
-              base_hwm_offset = this_hwm_offset;
               code += len;
               }
             }
@@ -5308,9 +5531,6 @@ for (;; ptr++)
 
         else for (i = repeat_max - 1; i >= 0; i--)
           {
-          PCRE2_UCHAR *hc;
-          size_t this_hwm_offset = cb->hwm - cb->start_workspace;
-
           *code++ = OP_BRAZERO + repeat_type;
 
           /* All but the final copy start a new nesting, maintaining the
@@ -5326,26 +5546,6 @@ for (;; ptr++)
             }
 
           memcpy(code, previous, CU2BYTES(len));
-
-          /* Ensure there is enough workspace for forward references before
-          copying them. */
-
-          while (cb->hwm > cb->start_workspace + cb->workspace_size -
-                 WORK_SIZE_SAFETY_MARGIN -
-                 (this_hwm_offset - base_hwm_offset))
-            {
-            *errorcodeptr = expand_workspace(cb);
-            if (*errorcodeptr != 0) goto FAILED;
-            }
-
-          for (hc = (PCRE2_UCHAR *)cb->start_workspace + base_hwm_offset;
-               hc < (PCRE2_UCHAR *)cb->start_workspace + this_hwm_offset;
-               hc += LINK_SIZE)
-            {
-            PUT(cb->hwm, 0, GET(hc, 0) + len + ((i != 0)? 2+LINK_SIZE : 1));
-            cb->hwm += LINK_SIZE;
-            }
-          base_hwm_offset = this_hwm_offset;
           code += len;
           }
 
@@ -5381,7 +5581,7 @@ for (;; ptr++)
       conditional, we convert the BRA code to the POS form, and the KET code to
       KETRPOS. (It turns out to be convenient at runtime to detect this kind of
       subpattern at both the start and at the end.) The use of special opcodes
-      makes it possible to reduce greatly the stack usage in pcre_exec(). If
+      makes it possible to reduce greatly the stack usage in pcre2_match(). If
       the group is preceded by OP_BRAZERO, convert this to OP_BRAPOSZERO.
 
       Then, if the minimum number of matches is 1 or 0, cancel the possessive
@@ -5411,14 +5611,23 @@ for (;; ptr++)
 
         else
           {
-          /* In the compile phase, check for empty string matching. */
+          /* In the compile phase, check whether the group could match an empty
+          string. */
 
           if (lengthptr == NULL)
             {
             PCRE2_UCHAR *scode = bracode;
             do
               {
-              if (could_be_empty_branch(scode, ketcode, utf, cb, NULL))
+              int count = 0;
+              int rc = could_be_empty_branch(scode, ketcode, utf, cb, FALSE,
+                NULL, &count);
+              if (rc < 0)
+                {
+                *errorcodeptr = ERR86;
+                goto FAILED;
+                }
+              if (rc > 0)
                 {
                 *bracode += OP_SBRA - OP_BRA;
                 break;
@@ -5426,6 +5635,12 @@ for (;; ptr++)
               scode += GET(scode, 1);
               }
             while (*scode == OP_ALT);
+
+            /* A conditional group with only one branch has an implicit empty
+            alternative branch. */
+
+            if (*bracode == OP_COND && bracode[GET(bracode,1)] != OP_ALT)
+              *bracode = OP_SCOND;
             }
 
           /* Handle possessive quantifiers. */
@@ -5434,18 +5649,15 @@ for (;; ptr++)
             {
             /* For COND brackets, we wrap the whole thing in a possessively
             repeated non-capturing bracket, because we have not invented POS
-            versions of the COND opcodes. Because we are moving code along, we
-            must ensure that any pending recursive references are updated. */
+            versions of the COND opcodes. */
 
             if (*bracode == OP_COND || *bracode == OP_SCOND)
               {
               int nlen = (int)(code - bracode);
-              *code = OP_END;
-              adjust_recurse(bracode, 1 + LINK_SIZE, utf, cb, item_hwm_offset);
               memmove(bracode + 1 + LINK_SIZE, bracode, CU2BYTES(nlen));
               code += 1 + LINK_SIZE;
               nlen += 1 + LINK_SIZE;
-              *bracode = OP_BRAPOS;
+              *bracode = (*bracode == OP_COND)? OP_BRAPOS : OP_SBRAPOS;
               *code++ = OP_KETRPOS;
               PUTINC(code, 0, nlen);
               PUT(bracode, 1, nlen);
@@ -5570,13 +5782,10 @@ for (;; ptr++)
           *tempcode = opcode_possessify[repcode];
 
         /* For opcode without a special possessified version, wrap the item in
-        ONCE brackets. Because we are moving code along, we must ensure that
-        any pending recursive references are updated. */
+        ONCE brackets. */
 
         else
           {
-          *code = OP_END;
-          adjust_recurse(tempcode, 1 + LINK_SIZE, utf, cb, item_hwm_offset);
           memmove(tempcode + 1 + LINK_SIZE, tempcode, CU2BYTES(len));
           code += 1 + LINK_SIZE;
           len += 1 + LINK_SIZE;
@@ -5599,33 +5808,19 @@ for (;; ptr++)
 
 
     /* ===================================================================*/
-    /* Start of nested parenthesized sub-expression, or comment or lookahead or
-    lookbehind or option setting or condition or all the other extended
-    parenthesis forms.  We must save the current high-water-mark for the
-    forward reference list so that we know where they start for this group.
-    However, because the list may be extended when there are very many forward
-    references (usually the result of a replicated inner group), we must use
-    an offset rather than an absolute address. */
+    /* Start of nested parenthesized sub-expression, or lookahead or lookbehind
+    or option setting or condition or all the other extended parenthesis forms.
+    We must save the current high-water-mark for the forward reference list so
+    that we know where they start for this group. However, because the list may
+    be extended when there are very many forward references (usually the result
+    of a replicated inner group), we must use an offset rather than an absolute
+    address. Note that (?# comments are dealt with at the top of the loop;
+    they do not get this far. */
 
     case CHAR_LEFT_PARENTHESIS:
     ptr++;
 
-    /* First deal with comments. Putting this code right at the start ensures
-    that comments have no bad side effects. */
-
-    if (ptr[0] == CHAR_QUESTION_MARK && ptr[1] == CHAR_NUMBER_SIGN)
-      {
-      ptr += 2;
-      while (ptr < cb->end_pattern && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
-      if (*ptr != CHAR_RIGHT_PARENTHESIS)
-        {
-        *errorcodeptr = ERR18;
-        goto FAILED;
-        }
-      continue;
-      }
-
-    /* Now deal with various "verbs" that can be introduced by '*'. */
+    /* Deal with various "verbs" that can be introduced by '*'. */
 
     if (ptr[0] == CHAR_ASTERISK && (ptr[1] == ':'
          || (MAX_255(ptr[1]) && ((cb->ctypes[ptr[1]] & ctype_letter) != 0))))
@@ -5637,22 +5832,43 @@ for (;; ptr++)
       PCRE2_SPTR arg = NULL;
       previous = NULL;
       ptr++;
-      while (MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype_letter) != 0) ptr++;
-      namelen = (int)(ptr - name);
+
+      /* Increment ptr, set namelen, check length */
+
+      READ_NAME(ctype_letter, ERR60, *errorcodeptr);
 
       /* It appears that Perl allows any characters whatsoever, other than
       a closing parenthesis, to appear in arguments, so we no longer insist on
-      letters, digits, and underscores. */
+      letters, digits, and underscores. Perl does not, however, do any
+      interpretation within arguments, and has no means of including a closing
+      parenthesis. PCRE supports escape processing but only when it is
+      requested by an option. Note that check_escape() will not return values
+      greater than the code unit maximum when not in UTF mode. */
 
       if (*ptr == CHAR_COLON)
         {
         arg = ++ptr;
-        while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
-        arglen = (int)(ptr - arg);
-        if ((unsigned int)arglen > MAX_MARK)
+
+        if ((options & PCRE2_ALT_VERBNAMES) == 0)
           {
-          *errorcodeptr = ERR76;
-          goto FAILED;
+          arglen = 0;
+          while (ptr < cb->end_pattern && *ptr != CHAR_RIGHT_PARENTHESIS)
+            {
+            ptr++;                                /* Check length as we go */
+            arglen++;                             /* along, to avoid the   */
+            if ((unsigned int)arglen > MAX_MARK)  /* possibility of overflow. */
+              {
+              *errorcodeptr = ERR76;
+              goto FAILED;
+              }
+            }
+          }
+        else
+          {
+          /* The length check is in process_verb_names() */
+          arglen = process_verb_name(&ptr, NULL, errorcodeptr, options,
+            utf, cb);
+          if (arglen < 0) goto FAILED;
           }
         }
 
@@ -5697,7 +5913,7 @@ for (;; ptr++)
 
           /* Handle other cases with/without an argument */
 
-          else if (arglen == 0)
+          else if (arglen == 0)    /* There is no argument */
             {
             if (verbs[i].op < 0)   /* Argument is mandatory */
               {
@@ -5707,17 +5923,42 @@ for (;; ptr++)
             setverb = *code++ = verbs[i].op;
             }
 
-          else
+          else                        /* An argument is present */
             {
-            if (verbs[i].op_arg < 0)   /* Argument is forbidden */
+            if (verbs[i].op_arg < 0)  /* Argument is forbidden */
               {
               *errorcodeptr = ERR59;
               goto FAILED;
               }
             setverb = *code++ = verbs[i].op_arg;
-            *code++ = arglen;
-            memcpy(code, arg, CU2BYTES(arglen));
-            code += arglen;
+
+            /* Arguments can be very long, especially in 16- and 32-bit modes,
+            and can overflow the workspace in the first pass. Instead of
+            putting the argument into memory, we just update the length counter
+            and set up an empty argument. */
+
+            if (lengthptr != NULL)
+              {
+              *lengthptr += arglen;
+              *code++ = 0;
+              }
+            else
+              {
+              *code++ = arglen;
+              if ((options & PCRE2_ALT_VERBNAMES) != 0)
+                {
+                PCRE2_UCHAR *memcode = code;  /* code is "register" */
+                (void)process_verb_name(&arg, &memcode, errorcodeptr, options,
+                  utf, cb);
+                code = memcode;
+                }
+              else   /* No argument processing */
+                {
+                memcpy(code, arg, CU2BYTES(arglen));
+                code += arglen;
+                }
+              }
+
             *code++ = 0;
             }
 
@@ -5911,9 +6152,10 @@ for (;; ptr++)
             {
             ptr++;
             while (IS_DIGIT(*ptr)) minor = minor * 10 + *ptr++ - '0';
+            if (minor < 10) minor *= 10;
             }
 
-          if (*ptr != CHAR_RIGHT_PARENTHESIS)
+          if (*ptr != CHAR_RIGHT_PARENTHESIS || minor > 99)
             {
             *errorcodeptr = ERR79;
             goto FAILED;
@@ -5968,6 +6210,12 @@ for (;; ptr++)
           {
           while (IS_DIGIT(*ptr))
             {
+            if (recno > INT_MAX / 10 - 1)  /* Integer overflow */
+              {
+              while (IS_DIGIT(*ptr)) ptr++;
+              *errorcodeptr = ERR61;
+              goto FAILED;
+              }
             recno = recno * 10 + (int)(*ptr - CHAR_0);
             ptr++;
             }
@@ -5992,12 +6240,9 @@ for (;; ptr++)
             *errorcodeptr = ERR28;   /* Assertion expected */
             goto FAILED;
             }
-          name = ptr++;
-          while (MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype_word) != 0)
-            {
-            ptr++;
-            }
-          namelen = (int)(ptr - name);
+          name = ptr;
+          /* Increment ptr, set namelen, check length */
+          READ_NAME(ctype_word, ERR48, *errorcodeptr);
           if (lengthptr != NULL) skipunits += IMM2_SIZE;
           }
 
@@ -6027,7 +6272,7 @@ for (;; ptr++)
             goto FAILED;
             }
           if (refsign != 0) recno = (refsign == CHAR_MINUS)?
-            cb->bracount - recno + 1 : recno + cb->bracount;
+            (cb->bracount + 1) - recno : recno + cb->bracount;
           if (recno <= 0 || (uint32_t)recno > cb->final_bracount)
             {
             *errorcodeptr = ERR15;
@@ -6103,7 +6348,12 @@ for (;; ptr++)
             {
             if (!IS_DIGIT(name[i]))
               {
-              *errorcodeptr = ERR15;
+              *errorcodeptr = ERR15;        /* Non-existent subpattern */
+              goto FAILED;
+              }
+            if (recno > INT_MAX / 10 - 1)   /* Integer overflow */
+              {
+              *errorcodeptr = ERR61;
               goto FAILED;
               }
             recno = recno * 10 + name[i] - CHAR_0;
@@ -6229,7 +6479,9 @@ for (;; ptr++)
             }
 
           /* During the pre-compile phase, we parse the string and update the
-          length. There is no need to generate any code. */
+          length. There is no need to generate any code. (In fact, the string
+          has already been parsed in the pre-pass that looks for named
+          parentheses, but it does no harm to leave this code in.) */
 
           if (lengthptr != NULL)     /* Only check the string */
             {
@@ -6373,8 +6625,8 @@ for (;; ptr++)
           *errorcodeptr = ERR44;   /* Group name must start with non-digit */
           goto FAILED;
           }
-        while (MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype_word) != 0) ptr++;
-        namelen = (int)(ptr - name);
+        /* Increment ptr, set namelen, check length */
+        READ_NAME(ctype_word, ERR48, *errorcodeptr);
 
         /* In the pre-compile phase, do a syntax check. */
 
@@ -6390,11 +6642,6 @@ for (;; ptr++)
             *errorcodeptr = ERR42;
             goto FAILED;
             }
-          if (namelen > MAX_NAME_SIZE)
-            {
-            *errorcodeptr = ERR48;
-            goto FAILED;
-            }
           }
 
         /* Scan the list of names generated in the pre-pass in order to get
@@ -6480,7 +6727,6 @@ for (;; ptr++)
 
         if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
         previous = code;
-        item_hwm_offset = cb->hwm - cb->start_workspace;
         *code++ = ((options & PCRE2_CASELESS) != 0)? OP_DNREFI : OP_DNREF;
         PUT2INC(code, 0, index);
         PUT2INC(code, 0, count);
@@ -6488,9 +6734,14 @@ for (;; ptr++)
 
 
         /* ------------------------------------------------------------ */
-        case CHAR_R:              /* Recursion */
-        ptr++;                    /* Same as (?0)      */
-        /* Fall through */
+        case CHAR_R:              /* Recursion, same as (?0) */
+        recno = 0;
+        if (*(++ptr) != CHAR_RIGHT_PARENTHESIS)
+          {
+          *errorcodeptr = ERR29;
+          goto FAILED;
+          }
+        goto HANDLE_RECURSION;
 
 
         /* ------------------------------------------------------------ */
@@ -6498,7 +6749,6 @@ for (;; ptr++)
         case CHAR_0: case CHAR_1: case CHAR_2: case CHAR_3: case CHAR_4:
         case CHAR_5: case CHAR_6: case CHAR_7: case CHAR_8: case CHAR_9:
           {
-          PCRE2_SPTR called;
           terminator = CHAR_RIGHT_PARENTHESIS;
 
           /* Come here from the \g<...> and \g'...' code (Oniguruma
@@ -6550,7 +6800,7 @@ for (;; ptr++)
               *errorcodeptr = ERR58;
               goto FAILED;
               }
-            recno = cb->bracount - recno + 1;
+            recno = (int)(cb->bracount + 1) - recno;
             if (recno <= 0)
               {
               *errorcodeptr = ERR15;
@@ -6567,76 +6817,29 @@ for (;; ptr++)
             recno += cb->bracount;
             }
 
-          /* Come here from code above that handles a named recursion */
-
-          HANDLE_RECURSION:
-          previous = code;
-          item_hwm_offset = cb->hwm - cb->start_workspace;
-          called = cb->start_code;
-
-          /* When we are actually compiling, find the bracket that is being
-          referenced. Temporarily end the regex in case it doesn't exist before
-          this point. If we end up with a forward reference, first check that
-          the bracket does occur later so we can give the error (and position)
-          now. Then remember this forward reference in the workspace so it can
-          be filled in at the end. */
-
-          if (lengthptr == NULL)
+          if ((uint32_t)recno > cb->final_bracount)
             {
-            *code = OP_END;
-            if (recno != 0)
-              called = PRIV(find_bracket)(cb->start_code, utf, recno);
-
-            /* Forward reference */
-
-            if (called == NULL)
-              {
-              if ((uint32_t)recno > cb->final_bracount)
-                {
-                *errorcodeptr = ERR15;
-                goto FAILED;
-                }
-
-              /* Fudge the value of "called" so that when it is inserted as an
-              offset below, what it actually inserted is the reference number
-              of the group. Then remember the forward reference, expanding the
-              working space where the list is kept if necessary. */
-
-              called = cb->start_code + recno;
-              if (cb->hwm >= cb->start_workspace + cb->workspace_size -
-                  WORK_SIZE_SAFETY_MARGIN)
-                {
-                *errorcodeptr = expand_workspace(cb);
-                if (*errorcodeptr != 0) goto FAILED;
-                }
-              PUTINC(cb->hwm, 0, (int)(code + 1 - cb->start_code));
-              }
-
-            /* If not a forward reference, and the subpattern is still open,
-            this is a recursive call. We check to see if this is a left
-            recursion that could loop for ever, and diagnose that case. We
-            must not, however, do this check if we are in a conditional
-            subpattern because the condition might be testing for recursion in
-            a pattern such as /(?(R)a+|(?R)b)/, which is perfectly valid.
-            Forever loops are also detected at runtime, so those that occur in
-            conditional subpatterns will be picked up then. */
-
-            else if (GET(called, 1) == 0 && cond_depth <= 0 &&
-                     could_be_empty(called, code, bcptr, utf, cb))
-              {
-              *errorcodeptr = ERR40;
-              goto FAILED;
-              }
+            *errorcodeptr = ERR15;
+            goto FAILED;
             }
 
-          /* Insert the recursion/subroutine item. It does not have a set first
-          character (relevant if it is repeated, because it will then be
-          wrapped with ONCE brackets). */
+          /* Come here from code above that handles a named recursion.
+          We insert the number of the called group after OP_RECURSE. At the
+          end of compiling the pattern is scanned and these numbers are
+          replaced by offsets within the pattern. It is done like this to avoid
+          problems with forward references and adjusting offsets when groups
+          are duplicated and moved (as discovered in previous implementations).
+          Note that a recursion does not have a set first character (relevant
+          if it is repeated, because it will then be wrapped with ONCE
+          brackets). */
 
+          HANDLE_RECURSION:
+          previous = code;
           *code = OP_RECURSE;
-          PUT(code, 1, (int)(called - cb->start_code));
+          PUT(code, 1, recno);
           code += 1 + LINK_SIZE;
           groupsetfirstcu = FALSE;
+          cb->had_recurse = TRUE;
           }
 
         /* Can't determine a first byte now */
@@ -6679,44 +6882,16 @@ for (;; ptr++)
         newoptions = (options | set) & (~unset);
 
         /* If the options ended with ')' this is not the start of a nested
-        group with option changes, so the options change at this level. If this
-        item is right at the start of the pattern, the options can be
-        abstracted and made external in the pre-compile phase, and ignored in
-        the compile phase. This can be helpful when matching -- for instance in
-        caseless checking of required bytes.
-
-        If the code pointer is not (cb->start_code + 1 + LINK_SIZE), we are
-        definitely *not* at the start of the pattern because something has been
-        compiled. In the pre-compile phase, however, the code pointer can have
-        that value after the start, because it gets reset as code is discarded
-        during the pre-compile. However, this can happen only at top level - if
-        we are within parentheses, the starting BRA will still be present. At
-        any parenthesis level, the length value can be used to test if anything
-        has been compiled at that level. Thus, a test for both these conditions
-        is necessary to ensure we correctly detect the start of the pattern in
-        both phases.
-
-        If we are not at the pattern start, reset the greedy defaults and the
-        case value for firstcu and reqcu. */
+        group with option changes, so the options change at this level. They
+        must also be passed back for use in subsequent branches. Reset the
+        greedy defaults and the case value for firstcu and reqcu. */
 
         if (*ptr == CHAR_RIGHT_PARENTHESIS)
           {
-          if (code == cb->start_code + 1 + LINK_SIZE &&
-               (lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE))
-            {
-            cb->external_options = newoptions;
-            }
-          else
-            {
-            greedy_default = ((newoptions & PCRE2_UNGREEDY) != 0);
-            greedy_non_default = greedy_default ^ 1;
-            req_caseopt = ((newoptions & PCRE2_CASELESS) != 0)? REQ_CASELESS:0;
-            }
-
-          /* Change options at this level, and pass them back for use
-          in subsequent branches. */
-
           *optionsptr = options = newoptions;
+          greedy_default = ((newoptions & PCRE2_UNGREEDY) != 0);
+          greedy_non_default = greedy_default ^ 1;
+          req_caseopt = ((newoptions & PCRE2_CASELESS) != 0)? REQ_CASELESS:0;
           previous = NULL;       /* This item can't be repeated */
           continue;              /* It is complete */
           }
@@ -6776,7 +6951,6 @@ for (;; ptr++)
     else
       {
       previous = code;
-      item_hwm_offset = cb->hwm - cb->start_workspace;
       }
 
     *code = bravalue;
@@ -6981,27 +7155,21 @@ for (;; ptr++)
     are negative the reference number. Only back references and those types
     that consume a character may be repeated. We can test for values between
     ESC_b and ESC_Z for the latter; this may have to change if any new ones are
-    ever created. */
+    ever created.
+
+    Note: \Q and \E are handled at the start of the character-processing loop,
+    not here. */
 
     case CHAR_BACKSLASH:
     tempptr = ptr;
-    escape = check_escape(&ptr, &ec, errorcodeptr, options, FALSE, cb);
+    escape = PRIV(check_escape)(&ptr, cb->end_pattern, &ec, errorcodeptr,
+      options, FALSE, cb);
     if (*errorcodeptr != 0) goto FAILED;
 
     if (escape == 0)                  /* The escape coded a single character */
       c = ec;
     else
       {
-      if (escape == ESC_Q)            /* Handle start of quoted string */
-        {
-        if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
-          ptr += 2;               /* avoid empty string */
-            else inescq = TRUE;
-        continue;
-        }
-
-      if (escape == ESC_E) continue;  /* Perl ignores an orphan \E */
-
       /* For metasequences that actually match a character, we disable the
       setting of a first character if it hasn't already been set. */
 
@@ -7055,7 +7223,7 @@ for (;; ptr++)
         if (*p != (PCRE2_UCHAR)terminator)
           {
           *errorcodeptr = ERR57;
-          break;
+          goto FAILED;
           }
         ptr++;
         goto HANDLE_NUMERICAL_RECURSION;
@@ -7070,7 +7238,7 @@ for (;; ptr++)
           ptr[1] != CHAR_APOSTROPHE && ptr[1] != CHAR_LEFT_CURLY_BRACKET))
           {
           *errorcodeptr = ERR69;
-          break;
+          goto FAILED;
           }
         is_recurse = FALSE;
         terminator = (*(++ptr) == CHAR_LESS_THAN_SIGN)?
@@ -7092,9 +7260,13 @@ for (;; ptr++)
         single group (i.e. not to a duplicated name). */
 
         HANDLE_REFERENCE:
+        if (recno > (int)cb->final_bracount)
+          {
+          *errorcodeptr = ERR15;
+          goto FAILED;
+          }
         if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
         previous = code;
-        item_hwm_offset = cb->hwm - cb->start_workspace;
         *code++ = ((options & PCRE2_CASELESS) != 0)? OP_REFI : OP_REF;
         PUT2INC(code, 0, recno);
         cb->backref_map |= (recno < 32)? (1u << recno) : 1;
@@ -7124,7 +7296,6 @@ for (;; ptr++)
         if (!get_ucp(&ptr, &negated, &ptype, &pdata, errorcodeptr, cb))
           goto FAILED;
         previous = code;
-        item_hwm_offset = cb->hwm - cb->start_workspace;
         *code++ = ((escape == ESC_p) != negated)? OP_PROP : OP_NOTPROP;
         *code++ = ptype;
         *code++ = pdata;
@@ -7143,11 +7314,19 @@ for (;; ptr++)
 
       /* The use of \C can be locked out. */
 
+#ifdef NEVER_BACKSLASH_C
+      else if (escape == ESC_C)
+        {
+        *errorcodeptr = ERR85;
+        goto FAILED;
+        }
+#else
       else if (escape == ESC_C && (options & PCRE2_NEVER_BACKSLASH_C) != 0)
         {
         *errorcodeptr = ERR83;
         goto FAILED;
         }
+#endif
 
       /* For the rest (including \X when Unicode properties are supported), we
       can obtain the OP value by negating the escape value in the default
@@ -7157,13 +7336,15 @@ for (;; ptr++)
 
       else
         {
+        if (escape == ESC_C) cb->external_flags |= PCRE2_HASBKC; /* Record */
         if ((escape == ESC_b || escape == ESC_B || escape == ESC_A) &&
              cb->max_lookbehind == 0)
           cb->max_lookbehind = 1;
 #ifdef SUPPORT_UNICODE
         if (escape >= ESC_DU && escape <= ESC_wu)
           {
-          nestptr = ptr + 1;                   /* Where to resume */
+          cb->nestptr[1] = cb->nestptr[0];         /* Back up if at 2nd level */
+          cb->nestptr[0] = ptr + 1;                /* Where to resume */
           ptr = substitutes[escape - ESC_DU] - 1;  /* Just before substitute */
           }
         else
@@ -7173,7 +7354,6 @@ for (;; ptr++)
 
           {
           previous = (escape > ESC_b && escape < ESC_Z)? code : NULL;
-          item_hwm_offset = cb->hwm - cb->start_workspace;
           *code++ = (!utf && escape == ESC_C)? OP_ALLANY : escape;
           }
         }
@@ -7208,7 +7388,6 @@ for (;; ptr++)
 
     ONE_CHAR:
     previous = code;
-    item_hwm_offset = cb->hwm - cb->start_workspace;
 
     /* For caseless UTF mode, check whether this character has more than one
     other case. If so, generate a special OP_PROP item instead of OP_CHARI. */
@@ -7350,7 +7529,6 @@ int32_t firstcuflags, reqcuflags;
 uint32_t branchfirstcu, branchreqcu;
 int32_t branchfirstcuflags, branchreqcuflags;
 size_t length;
-size_t save_hwm_offset;
 unsigned int orig_bracount;
 unsigned int max_bracount;
 branch_chain bc;
@@ -7372,8 +7550,6 @@ bc.current_branch = code;
 firstcu = reqcu = 0;
 firstcuflags = reqcuflags = REQ_UNSET;
 
-save_hwm_offset = cb->hwm - cb->start_workspace;  /* hwm at start of group */
-
 /* Accumulate the length for use in the pre-compile phase. Start with the
 length of the BRA and KET and any extra code units that are required at the
 beginning. We accumulate in a local variable to save frequent testing of
@@ -7508,26 +7684,26 @@ for (;;)
 
     /* If lookbehind, check that this branch matches a fixed-length string, and
     put the length into the OP_REVERSE item. Temporarily mark the end of the
-    branch with OP_END. If the branch contains OP_RECURSE, the result is -3
-    because there may be forward references that we can't check here. Set a
-    flag to cause another lookbehind check at the end. Why not do it all at the
-    end? Because common, erroneous checks are picked up here and the offset of
-    the problem can be shown. */
+    branch with OP_END. If the branch contains OP_RECURSE, the result is
+    FFL_LATER (a negative value) because there may be forward references that
+    we can't check here. Set a flag to cause another lookbehind check at the
+    end. Why not do it all at the end? Because common errors can be picked up
+    here and the offset of the problem can be shown. */
 
     if (lookbehind)
       {
       int fixed_length;
+      int count = 0;
       *code = OP_END;
       fixed_length = find_fixedlength(last_branch,  (options & PCRE2_UTF) != 0,
-        FALSE, cb, NULL);
-      if (fixed_length == -3)
+        FALSE, cb, NULL, &count);
+      if (fixed_length == FFL_LATER)
         {
         cb->check_lookbehind = TRUE;
         }
       else if (fixed_length < 0)
         {
-        *errorcodeptr = (fixed_length == -2)? ERR36 :
-                        (fixed_length == -4)? ERR70: ERR25;
+        *errorcodeptr = fixed_length_errors[-fixed_length];
         *ptrptr = ptr;
         return FALSE;
         }
@@ -7569,18 +7745,13 @@ for (;;)
     code += 1 + LINK_SIZE;
 
     /* If it was a capturing subpattern, check to see if it contained any
-    recursive back references. If so, we must wrap it in atomic brackets.
-    Because we are moving code along, we must ensure that any pending recursive
-    or forward subroutine references are updated. In any event, remove the
-    block from the chain. */
+    recursive back references. If so, we must wrap it in atomic brackets. In
+    any event, remove the block from the chain. */
 
     if (capnumber > 0)
       {
       if (cb->open_caps->flag)
         {
-        *code = OP_END;
-        adjust_recurse(start_bracket, 1 + LINK_SIZE,
-          (options & PCRE2_UTF) != 0, cb, save_hwm_offset);
         memmove(start_bracket + 1 + LINK_SIZE, start_bracket,
           CU2BYTES(code - start_bracket));
         *start_bracket = OP_ONCE;
@@ -8051,7 +8222,7 @@ a pointer to a block of store holding a compiled version of the expression.
 
 Arguments:
   pattern       the regular expression
-  patlen        the length of the pattern, or < 0 for zero-terminated
+  patlen        the length of the pattern, or PCRE2_ZERO_TERMINATED
   options       option bits
   errorptr      pointer to errorcode
   erroroffset   pointer to error offset
@@ -8097,10 +8268,11 @@ PCRE2_UCHAR stack_copied_pattern[COPIED_PATTERN_SIZE];
 named_group named_groups[NAMED_GROUP_LIST_SIZE];
 
 /* The workspace is used in different ways in the different compiling phases.
-Ensure that it is 16-bit aligned for the preliminary group scan. */
+It needs to be 16-bit aligned for the preliminary group scan, and 32-bit
+aligned for the group information cache. */
 
-uint16_t c16workspace[(COMPILE_WORK_SIZE * sizeof(PCRE2_UCHAR))/sizeof(uint16_t)];
-PCRE2_UCHAR *cworkspace = (PCRE2_UCHAR *)c16workspace;
+uint32_t c32workspace[C32_WORK_SIZE];
+PCRE2_UCHAR *cworkspace = (PCRE2_UCHAR *)c32workspace;
 
 
 /* -------------- Check arguments and set up the pattern ----------------- */
@@ -8135,10 +8307,24 @@ if (ccontext == NULL)
 /* A zero-terminated pattern is indicated by the special length value
 PCRE2_ZERO_TERMINATED. Otherwise, we make a copy of the pattern and add a zero,
 to ensure that it is always possible to look one code unit beyond the end of
-the pattern's characters. */
+the pattern's characters. In both cases, check that the pattern is overlong. */
 
-if (patlen == PCRE2_ZERO_TERMINATED) patlen = PRIV(strlen)(pattern); else
+if (patlen == PCRE2_ZERO_TERMINATED)
   {
+  patlen = PRIV(strlen)(pattern);
+  if (patlen > ccontext->max_pattern_length)
+    {
+    *errorptr = ERR88;
+    return NULL;
+    }
+  }
+else
+  {
+  if (patlen > ccontext->max_pattern_length)
+    {
+    *errorptr = ERR88;
+    return NULL;
+    }
   if (patlen < COPIED_PATTERN_SIZE)
     copied_pattern = stack_copied_pattern;
   else
@@ -8170,9 +8356,11 @@ cb.bracount = cb.final_bracount = 0;
 cb.cx = ccontext;
 cb.dupnames = FALSE;
 cb.end_pattern = pattern + patlen;
+cb.nestptr[0] = cb.nestptr[1] = NULL;
 cb.external_flags = 0;
 cb.external_options = options;
-cb.hwm = cworkspace;
+cb.groupinfo = c32workspace;
+cb.had_recurse = FALSE;
 cb.iscondassert = FALSE;
 cb.max_lookbehind = 0;
 cb.name_entry_size = 0;
@@ -8240,14 +8428,21 @@ while (ptr[skipatstart] == CHAR_LEFT_PARENTHESIS &&
         case PSO_LIMR:
         c = 0;
         pp = skipatstart;
+        if (!IS_DIGIT(ptr[pp]))
+          {
+          errorcode = ERR60;
+          ptr += pp;
+          goto HAD_ERROR;
+          }
         while (IS_DIGIT(ptr[pp]))
           {
           if (c > UINT32_MAX / 10 - 1) break;   /* Integer overflow */
-          c = c*10 + ptr[pp++] - CHAR_0;
+          c = c*10 + (ptr[pp++] - CHAR_0);
           }
         if (ptr[pp++] != CHAR_RIGHT_PARENTHESIS)
           {
           errorcode = ERR60;
+          ptr += pp;
           goto HAD_ERROR;
           }
         if (p->type == PSO_LIMM) limit_match = c;
@@ -8288,7 +8483,7 @@ if (utf)
     }
   if ((options & PCRE2_NO_UTF_CHECK) == 0 &&
        (errorcode = PRIV(valid_utf)(pattern, patlen, erroroffset)) != 0)
-    goto HAD_ERROR;
+    goto HAD_UTF_ERROR;
   }
 
 /* Check UCP lockout. */
@@ -8424,7 +8619,7 @@ re->first_codeunit = 0;
 re->last_codeunit = 0;
 re->bsr_convention = bsr;
 re->newline_convention = newline;
-re->max_lookbehind =
+re->max_lookbehind = 0;
 re->minlength = 0;
 re->top_bracket = 0;
 re->top_backref = 0;
@@ -8437,12 +8632,32 @@ code follows after that. */
 codestart = (PCRE2_SPTR)((uint8_t *)re + sizeof(pcre2_real_code)) +
   re->name_entry_size * re->name_count;
 
+/* Workspace is needed to remember information about numbered groups: whether a
+group can match an empty string and what its fixed length is. This is done to
+avoid the possibility of recursive references causing very long compile times
+when checking these features. Unnumbered groups do not have this exposure since
+they cannot be referenced. We use an indexed vector for this purpose. If there
+are sufficiently few groups, it can be the c32workspace vector, as set up
+above. Otherwise we have to get/free a special vector. The vector must be
+initialized to zero. */
+
+if (cb.final_bracount >= C32_WORK_SIZE)
+  {
+  cb.groupinfo = ccontext->memctl.malloc(
+    (cb.final_bracount + 1)*sizeof(uint32_t), ccontext->memctl.memory_data);
+  if (cb.groupinfo == NULL)
+    {
+    errorcode = ERR21;
+    goto HAD_ERROR;
+    }
+  }
+memset(cb.groupinfo, 0, (cb.final_bracount + 1) * sizeof(uint32_t));
+
 /* Update the compile data block for the actual compile. The starting points of
 the name/number translation table and of the code are passed around in the
 compile data block. The start/end pattern and initial options are already set
 from the pre-compile phase, as is the name_entry_size field. Reset the bracket
-count and the names_found field. Also reset the hwm field; this time it's used
-for remembering forward references to subpatterns. */
+count and the names_found field. */
 
 cb.parens_depth = 0;
 cb.assert_depth = 0;
@@ -8450,7 +8665,6 @@ cb.bracount = 0;
 cb.max_lookbehind = 0;
 cb.name_table = (PCRE2_UCHAR *)((uint8_t *)re + sizeof(pcre2_real_code));
 cb.start_code = codestart;
-cb.hwm = (PCRE2_UCHAR *)(cb.start_workspace);
 cb.iscondassert = FALSE;
 cb.req_varyopt = 0;
 cb.had_accept = FALSE;
@@ -8508,44 +8722,72 @@ if (usedlength > length) errorcode = ERR23; else
 #endif
   }
 
-/* In rare debugging situations we sometimes need to look at the compiled code
-at this stage. */
-
-#ifdef CALL_PRINTINT
-pcre2_printint(re, stderr, TRUE);
-fprintf(stderr, "Length=%lu Used=%lu\n", length, usedlength);
-#endif
+/* Scan the pattern for recursion/subroutine calls and convert the group
+numbers into offsets. Maintain a small cache so that repeated groups containing
+recursions are efficiently handled. */
 
-/* Fill in any forward references that are required. There may be repeated
-references; optimize for them, as searching a large regex takes time. The
-test of errorcode inside the loop means that nothing is done if it is already
-non-zero. */
+#define RSCAN_CACHE_SIZE 8
 
-if (cb.hwm > cb.start_workspace)
+if (errorcode == 0 && cb.had_recurse)
   {
-  int prev_recno = -1;
-  PCRE2_SPTR groupptr = NULL;
-  while (errorcode == 0 && cb.hwm > cb.start_workspace)
+  PCRE2_UCHAR *rcode;
+  PCRE2_SPTR rgroup;
+  int ccount = 0;
+  int start = RSCAN_CACHE_SIZE;
+  recurse_cache rc[RSCAN_CACHE_SIZE];
+
+  for (rcode = (PCRE2_UCHAR *)find_recurse(codestart, utf);
+       rcode != NULL;
+       rcode = (PCRE2_UCHAR *)find_recurse(rcode + 1 + LINK_SIZE, utf))
     {
-    int offset, recno;
-    cb.hwm -= LINK_SIZE;
-    offset = GET(cb.hwm, 0);
-    recno = GET(codestart, offset);
-    if (recno != prev_recno)
+    int i, p, recno;
+
+    recno = (int)GET(rcode, 1);
+    if (recno == 0) rgroup = codestart; else
       {
-      groupptr = PRIV(find_bracket)(codestart, utf, recno);
-      prev_recno = recno;
+      PCRE2_SPTR search_from = codestart;
+      rgroup = NULL;
+      for (i = 0, p = start; i < ccount; i++, p = (p + 1) & 7)
+        {
+        if (recno == rc[p].recno)
+          {
+          rgroup = rc[p].group;
+          break;
+          }
+
+        /* Group n+1 must always start to the right of group n, so we can save
+        search time below when the new group number is greater than any of the
+        previously found groups. */
+
+        if (recno > rc[p].recno) search_from = rc[p].group;
+        }
+
+      if (rgroup == NULL)
+        {
+        rgroup = PRIV(find_bracket)(search_from, utf, recno);
+        if (rgroup == NULL)
+          {
+          errorcode = ERR53;
+          break;
+          }
+        if (--start < 0) start = RSCAN_CACHE_SIZE - 1;
+        rc[start].recno = recno;
+        rc[start].group = rgroup;
+        if (ccount < RSCAN_CACHE_SIZE) ccount++;
+        }
       }
-    if (groupptr == NULL) errorcode = ERR53;
-      else PUT(((PCRE2_UCHAR *)codestart), offset, (int)(groupptr - codestart));
+
+    PUT(rcode, 1, rgroup - codestart);
     }
   }
 
-/* If the workspace had to be expanded, free the new memory. */
+/* In rare debugging situations we sometimes need to look at the compiled code
+at this stage. */
 
-if (cb.workspace_size > COMPILE_WORK_SIZE)
-  ccontext->memctl.free((void *)cb.start_workspace,
-    ccontext->memctl.memory_data);
+#ifdef CALL_PRINTINT
+pcre2_printint(re, stderr, TRUE);
+fprintf(stderr, "Length=%lu Used=%lu\n", length, usedlength);
+#endif
 
 /* After a successful compile, give an error if there's back reference to a
 non-existent capturing subpattern. Then, unless disabled, check whether any
@@ -8558,7 +8800,7 @@ compiler gives a warning about loss of "const" attribute if the cast
 if (errorcode == 0)
   {
   if (re->top_backref > re->top_bracket) errorcode = ERR15;
-  else if ((options & PCRE2_NO_AUTO_POSSESS) == 0)
+  else if ((re->overall_options & PCRE2_NO_AUTO_POSSESS) == 0)
     {
     PCRE2_UCHAR *temp = (PCRE2_UCHAR *)codestart;
     if (PRIV(auto_possessify)(temp, utf, &cb) != 0) errorcode = ERR80;
@@ -8591,15 +8833,15 @@ if (errorcode == 0 && cb.check_lookbehind)
     if (GET(cc, 1) == 0)
       {
       int fixed_length;
+      int count = 0;
       PCRE2_UCHAR *be = cc - 1 - LINK_SIZE + GET(cc, -LINK_SIZE);
       int end_op = *be;
       *be = OP_END;
-      fixed_length = find_fixedlength(cc, utf, TRUE, &cb, NULL);
+      fixed_length = find_fixedlength(cc, utf, TRUE, &cb, NULL, &count);
       *be = end_op;
       if (fixed_length < 0)
         {
-        errorcode = (fixed_length == -2)? ERR36 :
-                    (fixed_length == -4)? ERR70 : ERR25;
+        errorcode = fixed_length_errors[-fixed_length];
         break;
         }
       if (fixed_length > cb.max_lookbehind) cb.max_lookbehind = fixed_length;
@@ -8607,6 +8849,13 @@ if (errorcode == 0 && cb.check_lookbehind)
       }
     cc += 1 + LINK_SIZE;
     }
+
+  /* The previous value of the maximum lookbehind was transferred to the
+  compiled regex block above. We could have updated this value in the loop
+  above, but keep the two values in step, just in case some later code below
+  uses the cb value. */
+
+  re->max_lookbehind = cb.max_lookbehind;
   }
 
 /* Failed to compile, or error while post-processing. Earlier errors get here
@@ -8615,10 +8864,11 @@ via the dreaded goto. */
 if (errorcode != 0)
   {
   HAD_ERROR:
+  *erroroffset = (int)(ptr - pattern);
+  HAD_UTF_ERROR:
+  *errorptr = errorcode;
   pcre2_code_free(re);
   re = NULL;
-  *errorptr = errorcode;
-  *erroroffset = (int)(ptr - pattern);
   goto EXIT;
   }
 
@@ -8712,7 +8962,14 @@ can be provided to applications. */
 
 do
   {
-  if (could_be_empty_branch(codestart, code, utf, &cb, NULL))
+  int count = 0;
+  int rc = could_be_empty_branch(codestart, code, utf, &cb, TRUE, NULL, &count);
+  if (rc < 0)
+    {
+    errorcode = ERR86;
+    goto HAD_ERROR;
+    }
+  if (rc > 0)
     {
     re->flags |= PCRE2_MATCH_EMPTY;
     break;
@@ -8734,13 +8991,16 @@ if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0 &&
 
 /* Control ends up here in all cases. If memory was obtained for a
 zero-terminated copy of the pattern, remember to free it before returning. Also
-free the list of named groups if a larger one had to be obtained. */
+free the list of named groups if a larger one had to be obtained, and likewise
+the group information vector. */
 
 EXIT:
 if (copied_pattern != stack_copied_pattern)
   ccontext->memctl.free(copied_pattern, ccontext->memctl.memory_data);
 if (cb.named_group_list_size > NAMED_GROUP_LIST_SIZE)
   ccontext->memctl.free((void *)cb.named_groups, ccontext->memctl.memory_data);
+if (cb.groupinfo != c32workspace)
+  ccontext->memctl.free((void *)cb.groupinfo, ccontext->memctl.memory_data);
 
 return re;    /* Will be NULL after an error */
 }
index 22aa3587deb89fbd9454610923810ce503041559..921845949500a9b08bb60a5f9fa15e10e605da2c 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
index 6146999dfab2e206f5ccb2e39326a1c5f7fc14ef..ae050fe92c7785116afdc9d555666faebff7aeb3 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -131,13 +131,14 @@ return gcontext;
 when no context is supplied to the compile function. */
 
 const pcre2_compile_context PRIV(default_compile_context) = {
-  { default_malloc, default_free, NULL },
-  NULL,
-  NULL,
-  PRIV(default_tables),
-  BSR_DEFAULT,
-  NEWLINE_DEFAULT,
-  PARENS_NEST_LIMIT };
+  { default_malloc, default_free, NULL },    /* Default memory handling */
+  NULL,                                      /* Stack guard */
+  NULL,                                      /* Stack guard data */
+  PRIV(default_tables),                      /* Character tables */
+  PCRE2_UNSET,                               /* Max pattern length */
+  BSR_DEFAULT,                               /* Backslash R default */
+  NEWLINE_DEFAULT,                           /* Newline convention */
+  PARENS_NEST_LIMIT };                       /* As it says */
 
 /* The create function copies the default into the new memory, but must
 override the default memory handling functions if a gcontext was provided. */
@@ -169,6 +170,7 @@ const pcre2_match_context PRIV(default_match_context) = {
 #endif
   NULL,
   NULL,
+  PCRE2_UNSET,   /* Offset limit */
   MATCH_LIMIT,
   MATCH_LIMIT_RECURSION };
 
@@ -294,6 +296,13 @@ switch(value)
   }
 }
 
+PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
+pcre2_set_max_pattern_length(pcre2_compile_context *ccontext, PCRE2_SIZE length)
+{
+ccontext->max_pattern_length = length;
+return 0;
+}
+
 PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
 pcre2_set_newline(pcre2_compile_context *ccontext, uint32_t newline)
 {
@@ -347,6 +356,13 @@ mcontext->match_limit = limit;
 return 0;
 }
 
+PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
+pcre2_set_offset_limit(pcre2_match_context *mcontext, PCRE2_SIZE limit)
+{
+mcontext->offset_limit = limit;
+return 0;
+}
+
 PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
 pcre2_set_recursion_limit(pcre2_match_context *mcontext, uint32_t limit)
 {
index b14477defba1313656b76167cb915884b2257d7e..76bc08525cf718eb91b4f8a2e5fcd7388f72193d 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -433,13 +433,13 @@ move back, and set up each alternative appropriately. */
 
 if (*first_op == OP_REVERSE)
   {
-  int max_back = 0;
-  int gone_back;
+  size_t max_back = 0;
+  size_t gone_back;
 
   end_code = this_start_code;
   do
     {
-    int back = GET(end_code, 2+LINK_SIZE);
+    size_t back = GET(end_code, 2+LINK_SIZE);
     if (back > max_back) max_back = back;
     end_code += GET(end_code, 1);
     }
@@ -466,8 +466,8 @@ if (*first_op == OP_REVERSE)
   /* In byte-mode we can do this quickly. */
 
     {
-    gone_back = (current_subject - max_back < start_subject)?
-      (int)(current_subject - start_subject) : max_back;
+    size_t current_offset = (size_t)(current_subject - start_subject);
+    gone_back = (current_offset < max_back)? current_offset : max_back;
     current_subject -= gone_back;
     }
 
@@ -481,7 +481,7 @@ if (*first_op == OP_REVERSE)
   end_code = this_start_code;
   do
     {
-    int back = GET(end_code, 2+LINK_SIZE);
+    size_t back = GET(end_code, 2+LINK_SIZE);
     if (back <= gone_back)
       {
       int bstate = (int)(end_code - start_code + 2 + 2*LINK_SIZE);
@@ -2774,7 +2774,7 @@ for (;;)
               {
               PCRE2_SPTR p = start_subject + local_offsets[rc];
               PCRE2_SPTR pp = start_subject + local_offsets[rc+1];
-              while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;
+              while (p < pp) if (NOT_FIRSTCU(*p++)) charcount--;
               }
 #endif
             if (charcount > 0)
@@ -2874,7 +2874,7 @@ for (;;)
             PCRE2_SPTR pp = local_ptr;
             charcount = (int)(pp - p);
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-            if (utf) while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;
+            if (utf) while (p < pp) if (NOT_FIRSTCU(*p++)) charcount--;
 #endif
             ADD_NEW_DATA(-next_state_offset, 0, (charcount - 1));
             }
@@ -2960,7 +2960,7 @@ for (;;)
               {
               PCRE2_SPTR p = start_subject + local_offsets[0];
               PCRE2_SPTR pp = start_subject + local_offsets[1];
-              while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;
+              while (p < pp) if (NOT_FIRSTCU(*p++)) charcount--;
               }
 #endif
             ADD_NEW_DATA(-next_state_offset, 0, (charcount - 1));
@@ -3116,6 +3116,7 @@ const pcre2_real_code *re = (const pcre2_real_code *)code;
 
 PCRE2_SPTR start_match;
 PCRE2_SPTR end_subject;
+PCRE2_SPTR bumpalong_limit;
 PCRE2_SPTR req_cu_ptr;
 
 BOOL utf, anchored, startline, firstline;
@@ -3172,15 +3173,10 @@ occur. */
 
 #define FF (PCRE2_NOTEMPTY_SET|PCRE2_NE_ATST_SET)
 #define OO (PCRE2_NOTEMPTY|PCRE2_NOTEMPTY_ATSTART)
-options |= (re->flags & FF) / ((FF & -FF) / (OO & -OO));
+options |= (re->flags & FF) / ((FF & (~FF+1)) / (OO & (~OO+1)));
 #undef FF
 #undef OO
 
-/* A NULL match context means "use a default context" */
-
-if (mcontext == NULL)
-  mcontext = (pcre2_match_context *)(&PRIV(default_match_context));
-
 /* If restarting after a partial match, do some sanity checks on the contents
 of the workspace. */
 
@@ -3205,8 +3201,11 @@ where to start. */
 
 startline = (re->flags & PCRE2_STARTLINE) != 0;
 firstline = (re->overall_options & PCRE2_FIRSTLINE) != 0;
+bumpalong_limit = end_subject;
 
-/* Fill in the fields in the match block. */
+/* Get data from the match context, if present, and fill in the fields in the
+match block. It is an error to set an offset limit without setting the flag at
+compile time. */
 
 if (mcontext == NULL)
   {
@@ -3215,6 +3214,12 @@ if (mcontext == NULL)
   }
 else
   {
+  if (mcontext->offset_limit != PCRE2_UNSET)
+    {
+    if ((re->overall_options & PCRE2_USE_OFFSET_LIMIT) == 0)
+      return PCRE2_ERROR_BADOFFSETLIMIT;
+    bumpalong_limit = subject + mcontext->offset_limit;
+    }
   mb->callout = mcontext->callout;
   mb->callout_data = mcontext->callout_data;
   mb->memctl = mcontext->memctl;
@@ -3264,18 +3269,50 @@ switch(re->newline_convention)
 
 /* Check a UTF string for validity if required. For 8-bit and 16-bit strings,
 we must also check that a starting offset does not point into the middle of a
-multiunit character. */
+multiunit character. We check only the portion of the subject that is going to
+be inspected during matching - from the offset minus the maximum back reference
+to the given length. This saves time when a small part of a large subject is
+being matched by the use of a starting offset. Note that the maximum lookbehind
+is a number of characters, not code units. */
 
 #ifdef SUPPORT_UNICODE
 if (utf && (options & PCRE2_NO_UTF_CHECK) == 0)
   {
-  match_data->rc = PRIV(valid_utf)(subject, length, &(match_data->startchar));
-  if (match_data->rc != 0) return match_data->rc;
+  PCRE2_SPTR check_subject = start_match;  /* start_match includes offset */
+
+  if (start_offset > 0)
+    {
 #if PCRE2_CODE_UNIT_WIDTH != 32
-  if (start_offset > 0 && start_offset < length &&
-      NOT_FIRSTCHAR(subject[start_offset]))
-    return PCRE2_ERROR_BADUTFOFFSET;
+    unsigned int i;
+    if (start_match < end_subject && NOT_FIRSTCU(*start_match))
+      return PCRE2_ERROR_BADUTFOFFSET;
+    for (i = re->max_lookbehind; i > 0 && check_subject > subject; i--)
+      {
+      check_subject--;
+      while (check_subject > subject &&
+#if PCRE2_CODE_UNIT_WIDTH == 8
+      (*check_subject & 0xc0) == 0x80)
+#else  /* 16-bit */
+      (*check_subject & 0xfc00) == 0xdc00)
+#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
+        check_subject--;
+      }
+#else   /* In the 32-bit library, one code unit equals one character. */
+    check_subject -= re->max_lookbehind;
+    if (check_subject < subject) check_subject = subject;
 #endif  /* PCRE2_CODE_UNIT_WIDTH != 32 */
+    }
+
+  /* Validate the relevant portion of the subject. After an error, adjust the
+  offset to be an absolute offset in the whole string. */
+
+  match_data->rc = PRIV(valid_utf)(check_subject,
+    length - (check_subject - subject), &(match_data->startchar));
+  if (match_data->rc != 0)
+    {
+    match_data->startchar += check_subject - subject;
+    return match_data->rc;
+    }
   }
 #endif  /* SUPPORT_UNICODE */
 
@@ -3507,6 +3544,10 @@ for (;;)
 
   /* ------------ End of start of match optimizations ------------ */
 
+  /* Give no match if we have passed the bumpalong limit. */
+
+  if (start_match > bumpalong_limit) break;
+
   /* OK, now we can do the business */
 
   mb->start_used_ptr = start_match;
index c539bd23eebb63c6fa9e8f60bc5df5f28a1aef47..6b4756aec8ae1bdef4101e22c31d5344c57c225c 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2015 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -51,11 +51,10 @@ POSSIBILITY OF SUCH DAMAGE.
 /* The texts of compile-time error messages. Compile-time error numbers start
 at COMPILE_ERROR_BASE (100).
 
-Do not ever re-use any error number, because they are documented. Always add a
-new error instead. This used to be a table of strings, but in order to reduce
-the number of relocations needed when a shared library is loaded dynamically,
-it is now one long string. We cannot use a table of offsets, because the
-lengths of inserts such as XSTRING(MAX_NAME_SIZE) are not known. Instead,
+This used to be a table of strings, but in order to reduce the number of
+relocations needed when a shared library is loaded dynamically, it is now one
+long string. We cannot use a table of offsets, because the lengths of inserts
+such as XSTRING(MAX_NAME_SIZE) are not known. Instead,
 pcre2_get_error_message() counts through to the one it wants - this isn't a
 performance issue because these strings are used only when there is an error.
 
@@ -92,7 +91,7 @@ static const char compile_error_texts[] =
   "failed to allocate heap memory\0"
   "unmatched closing parenthesis\0"
   "internal error: code overflow\0"
-  "unrecognized character after (?<\0"
+  "letter or underscore expected after (?< or (?'\0"
   /* 25 */
   "lookbehind assertion is not fixed length\0"
   "malformed number or name after (?(\0"
@@ -112,7 +111,7 @@ static const char compile_error_texts[] =
   "number after (?C is greater than 255\0"
   "closing parenthesis for (?C expected\0"
   /* 40 */
-  "recursion could loop indefinitely\0"
+  "invalid escape sequence in (*VERB) name\0"
   "unrecognized character after (?P\0"
   "syntax error in subpattern name (missing terminator)\0"
   "two named subpatterns have the same name (PCRE2_DUPNAMES not set)\0"
@@ -154,7 +153,7 @@ static const char compile_error_texts[] =
   /* 70 */
   "internal error: unknown opcode in find_fixedlength()\0"
   "\\N is not supported in a class\0"
-  "too many forward references\0"
+  "SPARE ERROR\0"
   "disallowed Unicode code point (>= 0xd800 && <= 0xdfff)\0"
   "using UTF is disabled by the application\0"
   /* 75 */
@@ -169,6 +168,11 @@ static const char compile_error_texts[] =
   "unrecognized string delimiter follows (?C\0"
   "using \\C is disabled by the application\0"
   "(?| and/or (?J: or (?x: parentheses are too deeply nested\0"
+  /* 85 */
+  "using \\C is disabled in this PCRE2 library\0"
+  "regular expression is too complicated\0"
+  "lookbehind assertion is too long\0"
+  "pattern string is longer than the limit set by the application\0"
   ;
 
 /* Match-time and UTF error texts are in the same format. */
@@ -200,7 +204,7 @@ static const char match_error_texts[] =
   /* 20 */
   "UTF-8 error: overlong 5-byte sequence\0"
   "UTF-8 error: overlong 6-byte sequence\0"
-  "UTF-8 error: isolated 0x80 byte\0"
+  "UTF-8 error: isolated byte with 0x80 bit set\0"
   "UTF-8 error: illegal byte (0xfe or 0xff)\0"
   "UTF-16 error: missing low surrogate at end\0"
   /* 25 */
@@ -239,7 +243,15 @@ static const char match_error_texts[] =
   "nested recursion at the same subject position\0"
   "recursion limit exceeded\0"
   "requested value is not available\0"
+  /* 55 */
   "requested value is not set\0"
+  "offset limit set without PCRE2_USE_OFFSET_LIMIT\0"
+  "bad escape sequence in replacement string\0"
+  "expected closing curly bracket in replacement string\0"
+  "bad substitution in replacement string\0"
+  /* 60 */
+  "match with end before start is not supported\0"
+  "too many replacements (more than INT_MAX)\0"
   ;
 
 
diff --git a/src/pcre2_find_bracket.c b/src/pcre2_find_bracket.c
new file mode 100644 (file)
index 0000000..803e719
--- /dev/null
@@ -0,0 +1,218 @@
+/*************************************************
+*      Perl-Compatible Regular Expressions       *
+*************************************************/
+
+/* PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+                       Written by Philip Hazel
+     Original API code Copyright (c) 1997-2012 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
+
+-----------------------------------------------------------------------------
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+
+    * Neither the name of the University of Cambridge nor the names of its
+      contributors may be used to endorse or promote products derived from
+      this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+-----------------------------------------------------------------------------
+*/
+
+
+/* This module contains a single function that scans through a compiled pattern
+until it finds a capturing bracket with the given number, or, if the number is
+negative, an instance of OP_REVERSE for a lookbehind. The function is called
+from pcre2_compile.c and also from pcre2_study.c when finding the minimum
+matching length. */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "pcre2_internal.h"
+
+
+/*************************************************
+*    Scan compiled regex for specific bracket    *
+*************************************************/
+
+/*
+Arguments:
+  code        points to start of expression
+  utf         TRUE in UTF mode
+  number      the required bracket number or negative to find a lookbehind
+
+Returns:      pointer to the opcode for the bracket, or NULL if not found
+*/
+
+PCRE2_SPTR
+PRIV(find_bracket)(PCRE2_SPTR code, BOOL utf, int number)
+{
+for (;;)
+  {
+  register PCRE2_UCHAR c = *code;
+
+  if (c == OP_END) return NULL;
+
+  /* XCLASS is used for classes that cannot be represented just by a bit map.
+  This includes negated single high-valued characters. CALLOUT_STR is used for
+  callouts with string arguments. In both cases the length in the table is
+  zero; the actual length is stored in the compiled code. */
+
+  if (c == OP_XCLASS) code += GET(code, 1);
+    else if (c == OP_CALLOUT_STR) code += GET(code, 1 + 2*LINK_SIZE);
+
+  /* Handle lookbehind */
+
+  else if (c == OP_REVERSE)
+    {
+    if (number < 0) return (PCRE2_UCHAR *)code;
+    code += PRIV(OP_lengths)[c];
+    }
+
+  /* Handle capturing bracket */
+
+  else if (c == OP_CBRA || c == OP_SCBRA ||
+           c == OP_CBRAPOS || c == OP_SCBRAPOS)
+    {
+    int n = (int)GET2(code, 1+LINK_SIZE);
+    if (n == number) return (PCRE2_UCHAR *)code;
+    code += PRIV(OP_lengths)[c];
+    }
+
+  /* Otherwise, we can get the item's length from the table, except that for
+  repeated character types, we have to test for \p and \P, which have an extra
+  two bytes of parameters, and for MARK/PRUNE/SKIP/THEN with an argument, we
+  must add in its length. */
+
+  else
+    {
+    switch(c)
+      {
+      case OP_TYPESTAR:
+      case OP_TYPEMINSTAR:
+      case OP_TYPEPLUS:
+      case OP_TYPEMINPLUS:
+      case OP_TYPEQUERY:
+      case OP_TYPEMINQUERY:
+      case OP_TYPEPOSSTAR:
+      case OP_TYPEPOSPLUS:
+      case OP_TYPEPOSQUERY:
+      if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
+      break;
+
+      case OP_TYPEUPTO:
+      case OP_TYPEMINUPTO:
+      case OP_TYPEEXACT:
+      case OP_TYPEPOSUPTO:
+      if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
+        code += 2;
+      break;
+
+      case OP_MARK:
+      case OP_PRUNE_ARG:
+      case OP_SKIP_ARG:
+      case OP_THEN_ARG:
+      code += code[1];
+      break;
+      }
+
+    /* Add in the fixed length from the table */
+
+    code += PRIV(OP_lengths)[c];
+
+  /* In UTF-8 and UTF-16 modes, opcodes that are followed by a character may be
+  followed by a multi-byte character. The length in the table is a minimum, so
+  we have to arrange to skip the extra bytes. */
+
+#ifdef MAYBE_UTF_MULTI
+    if (utf) switch(c)
+      {
+      case OP_CHAR:
+      case OP_CHARI:
+      case OP_NOT:
+      case OP_NOTI:
+      case OP_EXACT:
+      case OP_EXACTI:
+      case OP_NOTEXACT:
+      case OP_NOTEXACTI:
+      case OP_UPTO:
+      case OP_UPTOI:
+      case OP_NOTUPTO:
+      case OP_NOTUPTOI:
+      case OP_MINUPTO:
+      case OP_MINUPTOI:
+      case OP_NOTMINUPTO:
+      case OP_NOTMINUPTOI:
+      case OP_POSUPTO:
+      case OP_POSUPTOI:
+      case OP_NOTPOSUPTO:
+      case OP_NOTPOSUPTOI:
+      case OP_STAR:
+      case OP_STARI:
+      case OP_NOTSTAR:
+      case OP_NOTSTARI:
+      case OP_MINSTAR:
+      case OP_MINSTARI:
+      case OP_NOTMINSTAR:
+      case OP_NOTMINSTARI:
+      case OP_POSSTAR:
+      case OP_POSSTARI:
+      case OP_NOTPOSSTAR:
+      case OP_NOTPOSSTARI:
+      case OP_PLUS:
+      case OP_PLUSI:
+      case OP_NOTPLUS:
+      case OP_NOTPLUSI:
+      case OP_MINPLUS:
+      case OP_MINPLUSI:
+      case OP_NOTMINPLUS:
+      case OP_NOTMINPLUSI:
+      case OP_POSPLUS:
+      case OP_POSPLUSI:
+      case OP_NOTPOSPLUS:
+      case OP_NOTPOSPLUSI:
+      case OP_QUERY:
+      case OP_QUERYI:
+      case OP_NOTQUERY:
+      case OP_NOTQUERYI:
+      case OP_MINQUERY:
+      case OP_MINQUERYI:
+      case OP_NOTMINQUERY:
+      case OP_NOTMINQUERYI:
+      case OP_POSQUERY:
+      case OP_POSQUERYI:
+      case OP_NOTPOSQUERY:
+      case OP_NOTPOSQUERYI:
+      if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]);
+      break;
+      }
+#else
+    (void)(utf);  /* Keep compiler happy by referencing function argument */
+#endif  /* MAYBE_UTF_MULTI */
+    }
+  }
+}
+
+/* End of pcre2_find_bracket.c */
index a4cf1e08cce33e40745d4cc831e24b6a2c775d17..7c9f66cc043f27a894e41f56892b42cacbfdc1ef 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2015 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,10 @@ POSSIBILITY OF SUCH DAMAGE.
 */
 
 /* We do not support both EBCDIC and Unicode at the same time. The "configure"
-script prevents both being selected, but not everybody uses "configure". */
+script prevents both being selected, but not everybody uses "configure". EBCDIC
+is only supported for the 8-bit library, but the check for this has to be later
+in this file, because the first part is not width-dependent, and is included by
+pcre2test.c with CODE_UNIT_WIDTH == 0. */
 
 #if defined EBCDIC && defined SUPPORT_UNICODE
 #error The use of both EBCDIC and SUPPORT_UNICODE is not supported.
@@ -524,9 +527,11 @@ bytes in a code unit in that mode. */
 #define PCRE2_NL_SET        0x00008000  /* newline was set in the pattern */
 #define PCRE2_NOTEMPTY_SET  0x00010000  /* (*NOTEMPTY) used        ) keep */
 #define PCRE2_NE_ATST_SET   0x00020000  /* (*NOTEMPTY_ATSTART) used) together */
-#define PCRE2_DEREF_TABLES  0x00040000  /* Release character tables. */
+#define PCRE2_DEREF_TABLES  0x00040000  /* release character tables */
 #define PCRE2_NOJIT         0x00080000  /* (*NOJIT) used */
 #define PCRE2_HASBKPORX     0x00100000  /* contains \P, \p, or \X */
+#define PCRE2_DUPCAPUSED    0x00200000  /* contains (?| */
+#define PCRE2_HASBKC        0x00400000  /* contains \C */
 
 #define PCRE2_MODE_MASK     (PCRE2_MODE8 | PCRE2_MODE16 | PCRE2_MODE32)
 
@@ -917,6 +922,7 @@ a positive value. */
 #define STRING_NOTEMPTY_ATSTART_RIGHTPAR  "NOTEMPTY_ATSTART)"
 #define STRING_LIMIT_MATCH_EQ             "LIMIT_MATCH="
 #define STRING_LIMIT_RECURSION_EQ         "LIMIT_RECURSION="
+#define STRING_MARK                       "MARK"
 
 #else  /* SUPPORT_UNICODE */
 
@@ -1189,6 +1195,7 @@ only. */
 #define STRING_NOTEMPTY_ATSTART_RIGHTPAR  STR_N STR_O STR_T STR_E STR_M STR_P STR_T STR_Y STR_UNDERSCORE STR_A STR_T STR_S STR_T STR_A STR_R STR_T STR_RIGHT_PARENTHESIS
 #define STRING_LIMIT_MATCH_EQ             STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_M STR_A STR_T STR_C STR_H STR_EQUALS_SIGN
 #define STRING_LIMIT_RECURSION_EQ         STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_R STR_E STR_C STR_U STR_R STR_S STR_I STR_O STR_N STR_EQUALS_SIGN
+#define STRING_MARK                       STR_M STR_A STR_R STR_K
 
 #endif  /* SUPPORT_UNICODE */
 
@@ -1800,11 +1807,16 @@ typedef struct pcre2_serialized_data {
 
 #if defined PCRE2_CODE_UNIT_WIDTH && PCRE2_CODE_UNIT_WIDTH != 0
 
+/* EBCDIC is supported only for the 8-bit library. */
+
+#if defined EBCDIC && PCRE2_CODE_UNIT_WIDTH != 8
+#error EBCDIC is not supported for the 16-bit or 32-bit libraries
+#endif
+
 /* This is the largest non-UTF code point. */
 
 #define MAX_NON_UTF_CHAR (0xffffffffU >> (32 - PCRE2_CODE_UNIT_WIDTH))
 
-
 /* Internal shared data tables and variables. These are used by more than one
 of the exported public functions. They have to be "external" in the C sense,
 but are not part of the PCRE2 public API. Although the data for some of them is
@@ -1883,6 +1895,7 @@ not referenced from pcre2test, and must not be defined when no code unit width
 is available. */
 
 #define _pcre2_auto_possessify       PCRE2_SUFFIX(_pcre2_auto_possessify_)
+#define _pcre2_check_escape          PCRE2_SUFFIX(_pcre2_check_escape_)
 #define _pcre2_find_bracket          PCRE2_SUFFIX(_pcre2_find_bracket_)
 #define _pcre2_is_newline            PCRE2_SUFFIX(_pcre2_is_newline_)
 #define _pcre2_jit_free_rodata       PCRE2_SUFFIX(_pcre2_jit_free_rodata_)
@@ -1904,6 +1917,8 @@ is available. */
 
 extern int          _pcre2_auto_possessify(PCRE2_UCHAR *, BOOL,
                       const compile_block *);
+extern int          _pcre2_check_escape(PCRE2_SPTR *, PCRE2_SPTR, uint32_t *,
+                      int *, uint32_t, BOOL, compile_block *);
 extern PCRE2_SPTR   _pcre2_find_bracket(PCRE2_SPTR, BOOL, int);
 extern BOOL         _pcre2_is_newline(PCRE2_SPTR, uint32_t, PCRE2_SPTR,
                       uint32_t *, BOOL);
index f20f71e1e6e65813689fe494c28f6da6a0284b81..90b7959e0596cfb649d1dfce888c71c0d5ea3880 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -72,7 +72,7 @@ just to undefine them all. */
 #undef MAX_MARK
 #undef MAX_PATTERN_SIZE
 #undef MAX_UTF_SINGLE_CU
-#undef NOT_FIRSTCHAR
+#undef NOT_FIRSTCU
 #undef PUT
 #undef PUT2
 #undef PUT2INC
@@ -252,7 +252,7 @@ UTF support is omitted, we don't even define them. */
 /* #define MAX_UTF_SINGLE_CU */
 /* #define HAS_EXTRALEN(c) */
 /* #define GET_EXTRALEN(c) */
-/* #define NOT_FIRSTCHAR(c) */
+/* #define NOT_FIRSTCU(c) */
 #define GETCHAR(c, eptr) c = *eptr;
 #define GETCHARTEST(c, eptr) c = *eptr;
 #define GETCHARINC(c, eptr) c = *eptr++;
@@ -285,10 +285,10 @@ Otherwise it has an undefined behaviour. */
 
 #define GET_EXTRALEN(c) (PRIV(utf8_table4)[(c) & 0x3f])
 
-/* Returns TRUE, if the given character is not the first character
-of a UTF sequence. */
+/* Returns TRUE, if the given value is not the first code unit of a UTF
+sequence. */
 
-#define NOT_FIRSTCHAR(c) (((c) & 0xc0) == 0x80)
+#define NOT_FIRSTCU(c) (((c) & 0xc0) == 0x80)
 
 /* Get the next UTF-8 character, not advancing the pointer. This is called when
 we know we are in UTF-8 mode. */
@@ -371,10 +371,10 @@ Otherwise it has an undefined behaviour. */
 
 #define GET_EXTRALEN(c) 1
 
-/* Returns TRUE, if the given character is not the first character
-of a UTF sequence. */
+/* Returns TRUE, if the given value is not the first code unit of a UTF
+sequence. */
 
-#define NOT_FIRSTCHAR(c) (((c) & 0xfc00) == 0xdc00)
+#define NOT_FIRSTCU(c) (((c) & 0xfc00) == 0xdc00)
 
 /* Base macro to pick up the low surrogate of a UTF-16 character, not
 advancing the pointer. */
@@ -469,7 +469,7 @@ into one PCRE2_UCHAR unit. */
 #define MAX_UTF_SINGLE_CU (0x10ffffu)
 #define HAS_EXTRALEN(c) (0)
 #define GET_EXTRALEN(c) (0)
-#define NOT_FIRSTCHAR(c) (0)
+#define NOT_FIRSTCU(c) (0)
 
 /* Get the next UTF-32 character, not advancing the pointer. This is called when
 we know we are in UTF-32 mode. */
@@ -562,6 +562,7 @@ typedef struct pcre2_real_compile_context {
   int (*stack_guard)(uint32_t, void *);
   void *stack_guard_data;
   const uint8_t *tables;
+  PCRE2_SIZE max_pattern_length;
   uint16_t bsr_convention;
   uint16_t newline_convention;
   uint32_t parens_nest_limit;
@@ -580,6 +581,7 @@ typedef struct pcre2_real_match_context {
 #endif
   int    (*callout)(pcre2_callout_block *, void *);
   void    *callout_data;
+  PCRE2_SIZE offset_limit;
   uint32_t match_limit;
   uint32_t recursion_limit;
 } pcre2_real_match_context;
@@ -588,11 +590,17 @@ typedef struct pcre2_real_match_context {
 defined specially because it is required in pcre2_serialize_decode() when
 copying the size from possibly unaligned memory into a variable of the same
 type. Use a macro rather than a typedef to avoid compiler warnings when this
-file is included multiple times by pcre2test. */
+file is included multiple times by pcre2test. LOOKBEHIND_MAX specifies the
+largest lookbehind that is supported. (OP_REVERSE in a pattern has a 16-bit
+argument in 8-bit and 16-bit modes, so we need no more than a 16-bit field
+here.) */
 
 #undef  CODE_BLOCKSIZE_TYPE
 #define CODE_BLOCKSIZE_TYPE size_t
 
+#undef  LOOKBEHIND_MAX
+#define LOOKBEHIND_MAX UINT16_MAX
+
 typedef struct pcre2_real_code {
   pcre2_memctl memctl;            /* Memory control fields */
   const uint8_t *tables;          /* The character tables */
@@ -647,6 +655,13 @@ typedef struct recurse_check {
   PCRE2_SPTR group;
 } recurse_check;
 
+/* Structure for building a cache when filling in recursion offsets. */
+
+typedef struct recurse_cache {
+  PCRE2_SPTR group;
+  int recno;
+} recurse_cache;
+
 /* Structure for maintaining a chain of pointers to the currently incomplete
 branches, for testing for left recursion while compiling. */
 
@@ -678,7 +693,7 @@ typedef struct compile_block {
   PCRE2_SPTR start_code;           /* The start of the compiled code */
   PCRE2_SPTR start_pattern;        /* The start of the pattern */
   PCRE2_SPTR end_pattern;          /* The end of the pattern */
-  PCRE2_UCHAR *hwm;                /* High watermark of workspace */
+  PCRE2_SPTR nestptr[2];           /* Pointer(s) saved for string substitution */
   PCRE2_UCHAR *name_table;         /* The name/number table */
   size_t workspace_size;           /* Size of workspace */
   uint16_t names_found;            /* Number of entries so far */
@@ -690,6 +705,7 @@ typedef struct compile_block {
   uint32_t external_flags;         /* External flag bits to be set */
   uint32_t bracount;               /* Count of capturing parens as we compile */
   uint32_t final_bracount;         /* Saved value after first pass */
+  uint32_t *groupinfo;             /* Group info vector */
   uint32_t top_backref;            /* Maximum back reference */
   uint32_t backref_map;            /* Bitmap of low back refs */
   uint32_t nltype;                 /* Newline type */
@@ -701,6 +717,7 @@ typedef struct compile_block {
   int  req_varyopt;                /* "After variable item" flag for reqbyte */
   BOOL had_accept;                 /* (*ACCEPT) encountered */
   BOOL had_pruneorskip;            /* (*PRUNE) or (*SKIP) encountered */
+  BOOL had_recurse;                /* Had a recursion or subroutine call */
   BOOL check_lookbehind;           /* Lookbehinds need later checking */
   BOOL dupnames;                   /* Duplicate names exist */
   BOOL iscondassert;               /* Next assert is a condition */
index 272ab28573bf8c0bb603a901ed3ecea36e0788fb..b46f4e3944f0b06efc84a5028a7a80a3a30b1a69 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -186,6 +186,7 @@ typedef struct jit_arguments {
   int (*callout)(pcre2_callout_block *, void *);
   void *callout_data;
   /* Everything else after. */
+  sljit_uw offset_limit;
   sljit_ui limit_match;
   uint32_t oveccount;
   uint32_t options;
@@ -359,33 +360,38 @@ typedef struct compiler_common {
   /* Current position where a THEN must jump. */
   then_trap_backtrack *then_trap;
   /* Starting offset of private data for capturing brackets. */
-  int cbra_ptr;
+  sljit_si cbra_ptr;
   /* Output vector starting point. Must be divisible by 2. */
-  int ovector_start;
+  sljit_si ovector_start;
   /* Points to the starting character of the current match. */
-  int start_ptr;
+  sljit_si start_ptr;
   /* Last known position of the requested byte. */
-  int req_char_ptr;
+  sljit_si req_char_ptr;
   /* Head of the last recursion. */
-  int recursive_head_ptr;
+  sljit_si recursive_head_ptr;
   /* First inspected character for partial matching.
      (Needed for avoiding zero length partial matches.) */
-  int start_used_ptr;
+  sljit_si start_used_ptr;
   /* Starting pointer for partial soft matches. */
-  int hit_start;
-  /* End pointer of the first line. */
-  int first_line_end;
+  sljit_si hit_start;
+  /* Pointer of the match end position. */
+  sljit_si match_end_ptr;
   /* Points to the marked string. */
-  int mark_ptr;
+  sljit_si mark_ptr;
   /* Recursive control verb management chain. */
-  int control_head_ptr;
+  sljit_si control_head_ptr;
   /* Points to the last matched capture block index. */
-  int capture_last_ptr;
+  sljit_si capture_last_ptr;
+  /* Fast forward skipping byte code pointer. */
+  PCRE2_SPTR fast_forward_bc_ptr;
+  /* Locals used by fast fail optimization. */
+  sljit_si fast_fail_start_ptr;
+  sljit_si fast_fail_end_ptr;
 
   /* Flipped and lower case tables. */
   const sljit_ub *fcc;
   sljit_sw lcc;
-  /* Mode can be PCRE_STUDY_JIT_COMPILE and others. */
+  /* Mode can be PCRE2_JIT_COMPLETE and others. */
   int mode;
   /* TRUE, when minlength is greater than 0. */
   BOOL might_be_empty;
@@ -395,6 +401,8 @@ typedef struct compiler_common {
   BOOL has_skip_arg;
   /* (*THEN) is found in the pattern. */
   BOOL has_then;
+  /* (*SKIP) or (*SKIP:arg) is found in lookbehind assertion. */
+  BOOL has_skip_in_assert_back;
   /* Currently in recurse or negative assert. */
   BOOL local_exit;
   /* Currently in a positive assert. */
@@ -593,11 +601,6 @@ SLJIT_ASSERT(*cc >= OP_KET && *cc <= OP_KETRPOS);
 return count;
 }
 
-static int ones_in_half_byte[16] = {
-  /* 0 */ 0, 1, 1, 2, /* 4 */ 1, 2, 2, 3,
-  /* 8 */ 1, 2, 2, 3, /* 12 */ 2, 3, 3, 4
-};
-
 /* Functions whose might need modification for all new supported opcodes:
  next_opcode
  check_opcode_types
@@ -813,6 +816,7 @@ static BOOL check_opcode_types(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPT
 {
 int count;
 PCRE2_SPTR slot;
+PCRE2_SPTR assert_back_end = cc - 1;
 
 /* Calculate important variables (like stack size) and checks whether all opcodes are supported. */
 while (cc < ccend)
@@ -884,6 +888,13 @@ while (cc < ccend)
     cc += (*cc == OP_CALLOUT) ? PRIV(OP_lengths)[OP_CALLOUT] : GET(cc, 1 + 2*LINK_SIZE);
     break;
 
+    case OP_ASSERTBACK:
+    slot = bracketend(cc);
+    if (slot > assert_back_end)
+      assert_back_end = slot;
+    cc += 1 + LINK_SIZE;
+    break;
+
     case OP_THEN_ARG:
     common->has_then = TRUE;
     common->control_head_ptr = 1;
@@ -905,9 +916,17 @@ while (cc < ccend)
     cc += 1;
     break;
 
+    case OP_SKIP:
+    if (cc < assert_back_end)
+      common->has_skip_in_assert_back = TRUE;
+    cc += 1;
+    break;
+
     case OP_SKIP_ARG:
     common->control_head_ptr = 1;
     common->has_skip_arg = TRUE;
+    if (cc < assert_back_end)
+      common->has_skip_in_assert_back = TRUE;
     cc += 1 + 2 + cc[1];
     break;
 
@@ -921,6 +940,185 @@ while (cc < ccend)
 return TRUE;
 }
 
+static BOOL is_accelerated_repeat(PCRE2_SPTR cc)
+{
+switch(*cc)
+  {
+  case OP_TYPESTAR:
+  case OP_TYPEMINSTAR:
+  case OP_TYPEPLUS:
+  case OP_TYPEMINPLUS:
+  case OP_TYPEPOSSTAR:
+  case OP_TYPEPOSPLUS:
+  return (cc[1] != OP_ANYNL && cc[1] != OP_EXTUNI);
+
+  case OP_STAR:
+  case OP_MINSTAR:
+  case OP_PLUS:
+  case OP_MINPLUS:
+  case OP_POSSTAR:
+  case OP_POSPLUS:
+
+  case OP_STARI:
+  case OP_MINSTARI:
+  case OP_PLUSI:
+  case OP_MINPLUSI:
+  case OP_POSSTARI:
+  case OP_POSPLUSI:
+
+  case OP_NOTSTAR:
+  case OP_NOTMINSTAR:
+  case OP_NOTPLUS:
+  case OP_NOTMINPLUS:
+  case OP_NOTPOSSTAR:
+  case OP_NOTPOSPLUS:
+
+  case OP_NOTSTARI:
+  case OP_NOTMINSTARI:
+  case OP_NOTPLUSI:
+  case OP_NOTMINPLUSI:
+  case OP_NOTPOSSTARI:
+  case OP_NOTPOSPLUSI:
+  return TRUE;
+
+  case OP_CLASS:
+  case OP_NCLASS:
+#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8
+  case OP_XCLASS:
+  cc += (*cc == OP_XCLASS) ? GET(cc, 1) : (int)(1 + (32 / sizeof(PCRE2_UCHAR)));
+#else
+  cc += (1 + (32 / sizeof(PCRE2_UCHAR)));
+#endif
+
+  switch(*cc)
+    {
+    case OP_CRSTAR:
+    case OP_CRMINSTAR:
+    case OP_CRPLUS:
+    case OP_CRMINPLUS:
+    case OP_CRPOSSTAR:
+    case OP_CRPOSPLUS:
+    return TRUE;
+    }
+  break;
+  }
+return FALSE;
+}
+
+static SLJIT_INLINE BOOL detect_fast_forward_skip(compiler_common *common, int *private_data_start)
+{
+PCRE2_SPTR cc = common->start;
+PCRE2_SPTR end;
+
+/* Skip not repeated brackets. */
+while (TRUE)
+  {
+  switch(*cc)
+    {
+    case OP_SOD:
+    case OP_SOM:
+    case OP_SET_SOM:
+    case OP_NOT_WORD_BOUNDARY:
+    case OP_WORD_BOUNDARY:
+    case OP_EODN:
+    case OP_EOD:
+    case OP_CIRC:
+    case OP_CIRCM:
+    case OP_DOLL:
+    case OP_DOLLM:
+    /* Zero width assertions. */
+    cc++;
+    continue;
+    }
+
+  if (*cc != OP_BRA && *cc != OP_CBRA)
+    break;
+
+  end = cc + GET(cc, 1);
+  if (*end != OP_KET || PRIVATE_DATA(end) != 0)
+    return FALSE;
+  if (*cc == OP_CBRA)
+    {
+    if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0)
+      return FALSE;
+    cc += IMM2_SIZE;
+    }
+  cc += 1 + LINK_SIZE;
+  }
+
+if (is_accelerated_repeat(cc))
+  {
+  common->fast_forward_bc_ptr = cc;
+  common->private_data_ptrs[(cc + 1) - common->start] = *private_data_start;
+  *private_data_start += sizeof(sljit_sw);
+  return TRUE;
+  }
+return FALSE;
+}
+
+static SLJIT_INLINE void detect_fast_fail(compiler_common *common, PCRE2_SPTR cc, int *private_data_start, sljit_si depth)
+{
+  PCRE2_SPTR next_alt;
+
+  SLJIT_ASSERT(*cc == OP_BRA || *cc == OP_CBRA);
+
+  if (*cc == OP_CBRA && common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0)
+    return;
+
+  next_alt = bracketend(cc) - (1 + LINK_SIZE);
+  if (*next_alt != OP_KET || PRIVATE_DATA(next_alt) != 0)
+    return;
+
+  do
+    {
+    next_alt = cc + GET(cc, 1);
+
+    cc += 1 + LINK_SIZE + ((*cc == OP_CBRA) ? IMM2_SIZE : 0);
+
+    while (TRUE)
+      {
+      switch(*cc)
+        {
+        case OP_SOD:
+        case OP_SOM:
+        case OP_SET_SOM:
+        case OP_NOT_WORD_BOUNDARY:
+        case OP_WORD_BOUNDARY:
+        case OP_EODN:
+        case OP_EOD:
+        case OP_CIRC:
+        case OP_CIRCM:
+        case OP_DOLL:
+        case OP_DOLLM:
+        /* Zero width assertions. */
+        cc++;
+        continue;
+        }
+      break;
+      }
+
+    if (depth > 0 && (*cc == OP_BRA || *cc == OP_CBRA))
+      detect_fast_fail(common, cc, private_data_start, depth - 1);
+
+    if (is_accelerated_repeat(cc))
+      {
+      common->private_data_ptrs[(cc + 1) - common->start] = *private_data_start;
+
+      if (common->fast_fail_start_ptr == 0)
+        common->fast_fail_start_ptr = *private_data_start;
+
+      *private_data_start += sizeof(sljit_sw);
+      common->fast_fail_end_ptr = *private_data_start;
+
+      if (*private_data_start > SLJIT_MAX_LOCAL_SIZE)
+        return;
+      }
+
+    cc = next_alt;
+    }
+  while (*cc == OP_ALT);
+}
+
 static int get_class_iterator_size(PCRE2_SPTR cc)
 {
 sljit_ui min;
@@ -1097,6 +1295,7 @@ PCRE2_SPTR alternative;
 PCRE2_SPTR end = NULL;
 int private_data_ptr = *private_data_start;
 int space, size, bracketlen;
+BOOL repeat_check = TRUE;
 
 while (cc < ccend)
   {
@@ -1106,7 +1305,8 @@ while (cc < ccend)
   if (private_data_ptr > SLJIT_MAX_LOCAL_SIZE)
     break;
 
-  if (*cc == OP_ONCE || *cc == OP_ONCE_NC || *cc == OP_BRA || *cc == OP_CBRA || *cc == OP_COND)
+  if (repeat_check && (*cc == OP_ONCE || *cc == OP_ONCE_NC || *cc == OP_BRA || *cc == OP_CBRA || *cc == OP_COND))
+    {
     if (detect_repeat(common, cc))
       {
       /* These brackets are converted to repeats, so no global
@@ -1114,6 +1314,8 @@ while (cc < ccend)
       if (cc >= end)
         end = bracketend(cc);
       }
+    }
+  repeat_check = TRUE;
 
   switch(*cc)
     {
@@ -1169,6 +1371,13 @@ while (cc < ccend)
     bracketlen = 1 + LINK_SIZE + IMM2_SIZE;
     break;
 
+    case OP_BRAZERO:
+    case OP_BRAMINZERO:
+    case OP_BRAPOSZERO:
+    repeat_check = FALSE;
+    size = 1;
+    break;
+
     CASE_ITERATOR_PRIVATE_DATA_1
     space = 1;
     size = -2;
@@ -1354,6 +1563,13 @@ while (cc < ccend)
     cc += 1 + LINK_SIZE + IMM2_SIZE;
     break;
 
+    case OP_THEN:
+    stack_restore = TRUE;
+    if (common->control_head_ptr != 0)
+      *needs_control_head = TRUE;
+    cc ++;
+    break;
+
     default:
     stack_restore = TRUE;
     /* Fall through. */
@@ -2174,7 +2390,7 @@ static SLJIT_INLINE void reset_ovector(compiler_common *common, int length)
 {
 DEFINE_COMPILER;
 struct sljit_label *loop;
-int i;
+sljit_si i;
 
 /* At this point we can freely use all temporary registers. */
 SLJIT_ASSERT(length > 1);
@@ -2196,6 +2412,18 @@ else
   }
 }
 
+static SLJIT_INLINE void reset_fast_fail(compiler_common *common)
+{
+DEFINE_COMPILER;
+sljit_si i;
+
+SLJIT_ASSERT(common->fast_fail_start_ptr < common->fast_fail_end_ptr);
+
+OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+for (i = common->fast_fail_start_ptr; i < common->fast_fail_end_ptr; i += sizeof(sljit_sw))
+  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), i, TMP1, 0);
+}
+
 static SLJIT_INLINE void do_reset_match(compiler_common *common, int length)
 {
 DEFINE_COMPILER;
@@ -2249,6 +2477,7 @@ while (current != NULL)
     SLJIT_ASSERT_STOP();
     break;
     }
+  SLJIT_ASSERT(current > (sljit_sw*)current[-1]);
   current = (sljit_sw*)current[-1];
   }
 return -1;
@@ -3070,14 +3299,14 @@ sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
 
 #endif /* SUPPORT_UNICODE */
 
-static SLJIT_INLINE struct sljit_label *mainloop_entry(compiler_common *common, BOOL hascrorlf, BOOL firstline)
+static SLJIT_INLINE struct sljit_label *mainloop_entry(compiler_common *common, BOOL hascrorlf, uint32_t overall_options)
 {
 DEFINE_COMPILER;
 struct sljit_label *mainloop;
 struct sljit_label *newlinelabel = NULL;
 struct sljit_jump *start;
 struct sljit_jump *end = NULL;
-struct sljit_jump *nl = NULL;
+struct sljit_jump *end2 = NULL;
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
 struct sljit_jump *singlechar;
 #endif
@@ -3085,14 +3314,16 @@ jump_list *newline = NULL;
 BOOL newlinecheck = FALSE;
 BOOL readuchar = FALSE;
 
-if (!(hascrorlf || firstline) && (common->nltype == NLTYPE_ANY ||
-    common->nltype == NLTYPE_ANYCRLF || common->newline > 255))
+if (!(hascrorlf || (overall_options & PCRE2_FIRSTLINE) != 0)
+    && (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF || common->newline > 255))
   newlinecheck = TRUE;
 
-if (firstline)
+SLJIT_ASSERT(common->forced_quit_label == NULL);
+
+if ((overall_options & PCRE2_FIRSTLINE) != 0)
   {
   /* Search for the end of the first line. */
-  SLJIT_ASSERT(common->first_line_end != 0);
+  SLJIT_ASSERT(common->match_end_ptr != 0);
   OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0);
 
   if (common->nltype == NLTYPE_FIXED && common->newline > 255)
@@ -3105,24 +3336,49 @@ if (firstline)
     CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, mainloop);
     CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff, mainloop);
     JUMPHERE(end);
-    OP2(SLJIT_SUB, SLJIT_MEM1(SLJIT_SP), common->first_line_end, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+    OP2(SLJIT_SUB, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
     }
   else
     {
     end = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
     mainloop = LABEL();
     /* Continual stores does not cause data dependency. */
-    OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->first_line_end, STR_PTR, 0);
+    OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0);
     read_char_range(common, common->nlmin, common->nlmax, TRUE);
     check_newlinechar(common, common->nltype, &newline, TRUE);
     CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, mainloop);
     JUMPHERE(end);
-    OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->first_line_end, STR_PTR, 0);
+    OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0);
     set_jumps(newline, LABEL());
     }
 
   OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0);
   }
+else if ((overall_options & PCRE2_USE_OFFSET_LIMIT) != 0)
+  {
+  /* Check whether offset limit is set and valid. */
+  SLJIT_ASSERT(common->match_end_ptr != 0);
+
+  OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, offset_limit));
+  OP1(SLJIT_MOV, TMP2, 0, STR_END, 0);
+  end = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, (sljit_sw) PCRE2_UNSET);
+  OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
+#if PCRE2_CODE_UNIT_WIDTH == 16
+  OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+  OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 2);
+#endif
+  OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin));
+  OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
+  end2 = CMP(SLJIT_LESS_EQUAL, TMP2, 0, STR_END, 0);
+  OP1(SLJIT_MOV, TMP2, 0, STR_END, 0);
+  JUMPHERE(end2);
+  OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH);
+  add_jump(compiler, &common->forced_quit, CMP(SLJIT_LESS, TMP2, 0, STR_PTR, 0));
+  JUMPHERE(end);
+  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, TMP2, 0);
+  }
 
 start = JUMP(SLJIT_JUMP);
 
@@ -3138,7 +3394,7 @@ if (newlinecheck)
   OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT);
 #endif
   OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
-  nl = JUMP(SLJIT_JUMP);
+  end2 = JUMP(SLJIT_JUMP);
   }
 
 mainloop = LABEL();
@@ -3183,51 +3439,52 @@ JUMPHERE(start);
 if (newlinecheck)
   {
   JUMPHERE(end);
-  JUMPHERE(nl);
+  JUMPHERE(end2);
   }
 
 return mainloop;
 }
 
 #define MAX_N_CHARS 16
-#define MAX_N_BYTES 8
+#define MAX_DIFF_CHARS 6
 
-static SLJIT_INLINE void add_prefix_byte(sljit_ub byte, sljit_ub *bytes)
+static SLJIT_INLINE void add_prefix_char(PCRE2_UCHAR chr, PCRE2_UCHAR *chars)
 {
-sljit_ub len = bytes[0];
-int i;
+PCRE2_UCHAR i, len;
 
+len = chars[0];
 if (len == 255)
   return;
 
 if (len == 0)
   {
-  bytes[0] = 1;
-  bytes[1] = byte;
+  chars[0] = 1;
+  chars[1] = chr;
   return;
   }
 
 for (i = len; i > 0; i--)
-  if (bytes[i] == byte)
+  if (chars[i] == chr)
     return;
 
-if (len >= MAX_N_BYTES - 1)
+if (len >= MAX_DIFF_CHARS - 1)
   {
-  bytes[0] = 255;
+  chars[0] = 255;
   return;
   }
 
 len++;
-bytes[len] = byte;
-bytes[0] = len;
+chars[len] = chr;
+chars[0] = len;
 }
 
-static int scan_prefix(compiler_common *common, PCRE2_SPTR cc, sljit_ui *chars, sljit_ub *bytes, int max_chars)
+static int scan_prefix(compiler_common *common, PCRE2_SPTR cc, PCRE2_UCHAR *chars, int max_chars, uint32_t *rec_count)
 {
 /* Recursive function, which scans prefix literals. */
-BOOL last, any, caseless;
+BOOL last, any, class, caseless;
 int len, repeat, len_save, consumed = 0;
-sljit_ui chr, mask;
+sljit_ui chr; /* Any unicode character. */
+sljit_ub *bytes, *bytes_end, byte;
 PCRE2_SPTR alternative, cc_save, oc;
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
 PCRE2_UCHAR othercase[8];
@@ -3240,9 +3497,15 @@ PCRE2_UCHAR othercase[1];
 repeat = 1;
 while (TRUE)
   {
+  if (*rec_count == 0)
+    return 0;
+  (*rec_count)--;
+
   last = TRUE;
   any = FALSE;
+  class = FALSE;
   caseless = FALSE;
+
   switch (*cc)
     {
     case OP_CHARI:
@@ -3304,7 +3567,7 @@ while (TRUE)
 #ifdef SUPPORT_UNICODE
     if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc);
 #endif
-    max_chars = scan_prefix(common, cc + len, chars, bytes, max_chars);
+    max_chars = scan_prefix(common, cc + len, chars, max_chars, rec_count);
     if (max_chars == 0)
       return consumed;
     last = FALSE;
@@ -3327,7 +3590,7 @@ while (TRUE)
     alternative = cc + GET(cc, 1);
     while (*alternative == OP_ALT)
       {
-      max_chars = scan_prefix(common, alternative + 1 + LINK_SIZE, chars, bytes, max_chars);
+      max_chars = scan_prefix(common, alternative + 1 + LINK_SIZE, chars, max_chars, rec_count);
       if (max_chars == 0)
         return consumed;
       alternative += GET(alternative, 1);
@@ -3342,16 +3605,14 @@ while (TRUE)
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
     if (common->utf && !is_char7_bitset((const sljit_ub *)(cc + 1), FALSE)) return consumed;
 #endif
-    any = TRUE;
-    cc += 1 + 32 / sizeof(PCRE2_UCHAR);
+    class = TRUE;
     break;
 
     case OP_NCLASS:
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
     if (common->utf) return consumed;
 #endif
-    any = TRUE;
-    cc += 1 + 32 / sizeof(PCRE2_UCHAR);
+    class = TRUE;
     break;
 
 #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8
@@ -3433,189 +3694,685 @@ while (TRUE)
     cc += 1 + IMM2_SIZE + 1;
     break;
 
-    default:
-    return consumed;
-    }
+    default:
+    return consumed;
+    }
+
+  if (any)
+    {
+    do
+      {
+      chars[0] = 255;
+
+      consumed++;
+      if (--max_chars == 0)
+        return consumed;
+      chars += MAX_DIFF_CHARS;
+      }
+    while (--repeat > 0);
+
+    repeat = 1;
+    continue;
+    }
+
+  if (class)
+    {
+    bytes = (sljit_ub*) (cc + 1);
+    cc += 1 + 32 / sizeof(PCRE2_UCHAR);
+
+    switch (*cc)
+      {
+      case OP_CRSTAR:
+      case OP_CRMINSTAR:
+      case OP_CRPOSSTAR:
+      case OP_CRQUERY:
+      case OP_CRMINQUERY:
+      case OP_CRPOSQUERY:
+      max_chars = scan_prefix(common, cc + 1, chars, max_chars, rec_count);
+      if (max_chars == 0)
+        return consumed;
+      break;
+
+      default:
+      case OP_CRPLUS:
+      case OP_CRMINPLUS:
+      case OP_CRPOSPLUS:
+      break;
+
+      case OP_CRRANGE:
+      case OP_CRMINRANGE:
+      case OP_CRPOSRANGE:
+      repeat = GET2(cc, 1);
+      if (repeat <= 0)
+        return consumed;
+      break;
+      }
+
+    do
+      {
+      if (bytes[31] & 0x80)
+        chars[0] = 255;
+      else if (chars[0] != 255)
+        {
+        bytes_end = bytes + 32;
+        chr = 0;
+        do
+          {
+          byte = *bytes++;
+          SLJIT_ASSERT((chr & 0x7) == 0);
+          if (byte == 0)
+            chr += 8;
+          else
+            {
+            do
+              {
+              if ((byte & 0x1) != 0)
+                add_prefix_char(chr, chars);
+              byte >>= 1;
+              chr++;
+              }
+            while (byte != 0);
+            chr = (chr + 7) & ~7;
+            }
+          }
+        while (chars[0] != 255 && bytes < bytes_end);
+        bytes = bytes_end - 32;
+        }
+
+      consumed++;
+      if (--max_chars == 0)
+        return consumed;
+      chars += MAX_DIFF_CHARS;
+      }
+    while (--repeat > 0);
+
+    switch (*cc)
+      {
+      case OP_CRSTAR:
+      case OP_CRMINSTAR:
+      case OP_CRPOSSTAR:
+      return consumed;
+
+      case OP_CRQUERY:
+      case OP_CRMINQUERY:
+      case OP_CRPOSQUERY:
+      cc++;
+      break;
+
+      case OP_CRRANGE:
+      case OP_CRMINRANGE:
+      case OP_CRPOSRANGE:
+      if (GET2(cc, 1) != GET2(cc, 1 + IMM2_SIZE))
+        return consumed;
+      cc += 1 + 2 * IMM2_SIZE;
+      break;
+      }
+
+    repeat = 1;
+    continue;
+    }
+
+  len = 1;
+#ifdef SUPPORT_UNICODE
+  if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc);
+#endif
+
+  if (caseless && char_has_othercase(common, cc))
+    {
+#ifdef SUPPORT_UNICODE
+    if (common->utf)
+      {
+      GETCHAR(chr, cc);
+      if ((int)PRIV(ord2utf)(char_othercase(common, chr), othercase) != len)
+        return consumed;
+      }
+    else
+#endif
+      {
+      chr = *cc;
+      othercase[0] = TABLE_GET(chr, common->fcc, chr);
+      }
+    }
+  else
+    {
+    caseless = FALSE;
+    othercase[0] = 0; /* Stops compiler warning - PH */
+    }
+
+  len_save = len;
+  cc_save = cc;
+  while (TRUE)
+    {
+    oc = othercase;
+    do
+      {
+      chr = *cc;
+      add_prefix_char(*cc, chars);
+
+      if (caseless)
+        add_prefix_char(*oc, chars);
+
+      len--;
+      consumed++;
+      if (--max_chars == 0)
+        return consumed;
+      chars += MAX_DIFF_CHARS;
+      cc++;
+      oc++;
+      }
+    while (len > 0);
+
+    if (--repeat == 0)
+      break;
+
+    len = len_save;
+    cc = cc_save;
+    }
+
+  repeat = 1;
+  if (last)
+    return consumed;
+  }
+}
+
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
+
+static sljit_si character_to_int32(PCRE2_UCHAR chr)
+{
+sljit_si value = (sljit_si)chr;
+#if PCRE2_CODE_UNIT_WIDTH == 8
+#define SSE2_COMPARE_TYPE_INDEX 0
+return (value << 24) | (value << 16) | (value << 8) | value;
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+#define SSE2_COMPARE_TYPE_INDEX 1
+return (value << 16) | value;
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+#define SSE2_COMPARE_TYPE_INDEX 2
+return value;
+#else
+#error "Unsupported unit width"
+#endif
+}
+
+static SLJIT_INLINE void fast_forward_first_char2_sse2(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2)
+{
+DEFINE_COMPILER;
+struct sljit_label *start;
+struct sljit_jump *quit[3];
+struct sljit_jump *nomatch;
+sljit_ub instruction[8];
+sljit_si tmp1_ind = sljit_get_register_index(TMP1);
+sljit_si tmp2_ind = sljit_get_register_index(TMP2);
+sljit_si str_ptr_ind = sljit_get_register_index(STR_PTR);
+BOOL load_twice = FALSE;
+PCRE2_UCHAR bit;
+
+bit = char1 ^ char2;
+if (!is_powerof2(bit))
+  bit = 0;
+
+if ((char1 != char2) && bit == 0)
+  load_twice = TRUE;
+
+quit[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+
+/* First part (unaligned start) */
+
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1 | bit));
+
+SLJIT_ASSERT(tmp1_ind < 8 && tmp2_ind == 1);
+
+/* MOVD xmm, r/m32 */
+instruction[0] = 0x66;
+instruction[1] = 0x0f;
+instruction[2] = 0x6e;
+instruction[3] = 0xc0 | (2 << 3) | tmp1_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+if (char1 != char2)
+  {
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(bit != 0 ? bit : char2));
+
+  /* MOVD xmm, r/m32 */
+  instruction[3] = 0xc0 | (3 << 3) | tmp1_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  }
+
+/* PSHUFD xmm1, xmm2/m128, imm8 */
+instruction[2] = 0x70;
+instruction[3] = 0xc0 | (2 << 3) | 2;
+instruction[4] = 0;
+sljit_emit_op_custom(compiler, instruction, 5);
+
+if (char1 != char2)
+  {
+  /* PSHUFD xmm1, xmm2/m128, imm8 */
+  instruction[3] = 0xc0 | (3 << 3) | 3;
+  instruction[4] = 0;
+  sljit_emit_op_custom(compiler, instruction, 5);
+  }
+
+OP2(SLJIT_AND, TMP2, 0, STR_PTR, 0, SLJIT_IMM, 0xf);
+OP2(SLJIT_AND, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, ~0xf);
+
+/* MOVDQA xmm1, xmm2/m128 */
+#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+
+if (str_ptr_ind < 8)
+  {
+  instruction[2] = 0x6f;
+  instruction[3] = (0 << 3) | str_ptr_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+
+  if (load_twice)
+    {
+    instruction[3] = (1 << 3) | str_ptr_ind;
+    sljit_emit_op_custom(compiler, instruction, 4);
+    }
+  }
+else
+  {
+  instruction[1] = 0x41;
+  instruction[2] = 0x0f;
+  instruction[3] = 0x6f;
+  instruction[4] = (0 << 3) | (str_ptr_ind & 0x7);
+  sljit_emit_op_custom(compiler, instruction, 5);
+
+  if (load_twice)
+    {
+    instruction[4] = (1 << 3) | str_ptr_ind;
+    sljit_emit_op_custom(compiler, instruction, 5);
+    }
+  instruction[1] = 0x0f;
+  }
+
+#else
+
+instruction[2] = 0x6f;
+instruction[3] = (0 << 3) | str_ptr_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+if (load_twice)
+  {
+  instruction[3] = (1 << 3) | str_ptr_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  }
+
+#endif
+
+if (bit != 0)
+  {
+  /* POR xmm1, xmm2/m128 */
+  instruction[2] = 0xeb;
+  instruction[3] = 0xc0 | (0 << 3) | 3;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  }
+
+/* PCMPEQB/W/D xmm1, xmm2/m128 */
+instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX;
+instruction[3] = 0xc0 | (0 << 3) | 2;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+if (load_twice)
+  {
+  instruction[3] = 0xc0 | (1 << 3) | 3;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  }
+
+/* PMOVMSKB reg, xmm */
+instruction[2] = 0xd7;
+instruction[3] = 0xc0 | (tmp1_ind << 3) | 0;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+if (load_twice)
+  {
+  OP1(SLJIT_MOV, TMP3, 0, TMP2, 0);
+  instruction[3] = 0xc0 | (tmp2_ind << 3) | 1;
+  sljit_emit_op_custom(compiler, instruction, 4);
+
+  OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+  OP1(SLJIT_MOV, TMP2, 0, TMP3, 0);
+  }
+
+OP2(SLJIT_ASHR, TMP1, 0, TMP1, 0, TMP2, 0);
+
+/* BSF r32, r/m32 */
+instruction[0] = 0x0f;
+instruction[1] = 0xbc;
+instruction[2] = 0xc0 | (tmp1_ind << 3) | tmp1_ind;
+sljit_emit_op_custom(compiler, instruction, 3);
+
+nomatch = JUMP(SLJIT_ZERO);
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
+quit[1] = JUMP(SLJIT_JUMP);
+
+JUMPHERE(nomatch);
+
+start = LABEL();
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16);
+quit[2] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+
+/* Second part (aligned) */
+
+instruction[0] = 0x66;
+instruction[1] = 0x0f;
+
+/* MOVDQA xmm1, xmm2/m128 */
+#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+
+if (str_ptr_ind < 8)
+  {
+  instruction[2] = 0x6f;
+  instruction[3] = (0 << 3) | str_ptr_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+
+  if (load_twice)
+    {
+    instruction[3] = (1 << 3) | str_ptr_ind;
+    sljit_emit_op_custom(compiler, instruction, 4);
+    }
+  }
+else
+  {
+  instruction[1] = 0x41;
+  instruction[2] = 0x0f;
+  instruction[3] = 0x6f;
+  instruction[4] = (0 << 3) | (str_ptr_ind & 0x7);
+  sljit_emit_op_custom(compiler, instruction, 5);
+
+  if (load_twice)
+    {
+    instruction[4] = (1 << 3) | str_ptr_ind;
+    sljit_emit_op_custom(compiler, instruction, 5);
+    }
+  instruction[1] = 0x0f;
+  }
+
+#else
+
+instruction[2] = 0x6f;
+instruction[3] = (0 << 3) | str_ptr_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+if (load_twice)
+  {
+  instruction[3] = (1 << 3) | str_ptr_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  }
+
+#endif
+
+if (bit != 0)
+  {
+  /* POR xmm1, xmm2/m128 */
+  instruction[2] = 0xeb;
+  instruction[3] = 0xc0 | (0 << 3) | 3;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  }
+
+/* PCMPEQB/W/D xmm1, xmm2/m128 */
+instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX;
+instruction[3] = 0xc0 | (0 << 3) | 2;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+if (load_twice)
+  {
+  instruction[3] = 0xc0 | (1 << 3) | 3;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  }
+
+/* PMOVMSKB reg, xmm */
+instruction[2] = 0xd7;
+instruction[3] = 0xc0 | (tmp1_ind << 3) | 0;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+if (load_twice)
+  {
+  instruction[3] = 0xc0 | (tmp2_ind << 3) | 1;
+  sljit_emit_op_custom(compiler, instruction, 4);
+
+  OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+  }
+
+/* BSF r32, r/m32 */
+instruction[0] = 0x0f;
+instruction[1] = 0xbc;
+instruction[2] = 0xc0 | (tmp1_ind << 3) | tmp1_ind;
+sljit_emit_op_custom(compiler, instruction, 3);
+
+JUMPTO(SLJIT_ZERO, start);
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
+
+start = LABEL();
+SET_LABEL(quit[0], start);
+SET_LABEL(quit[1], start);
+SET_LABEL(quit[2], start);
+}
+
+#undef SSE2_COMPARE_TYPE_INDEX
+
+#endif
+
+static void fast_forward_first_char2(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2, sljit_si offset)
+{
+DEFINE_COMPILER;
+struct sljit_label *start;
+struct sljit_jump *quit;
+struct sljit_jump *found;
+PCRE2_UCHAR mask;
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+struct sljit_label *utf_start = NULL;
+struct sljit_jump *utf_quit = NULL;
+#endif
+BOOL has_match_end = (common->match_end_ptr != 0);
+
+if (offset > 0)
+  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset));
+
+if (has_match_end)
+  {
+  OP1(SLJIT_MOV, TMP3, 0, STR_END, 0);
+
+  OP2(SLJIT_ADD, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, SLJIT_IMM, IN_UCHARS(offset + 1));
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
+  if (sljit_x86_is_cmov_available())
+    {
+    OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, STR_END, 0, TMP3, 0);
+    sljit_x86_emit_cmov(compiler, SLJIT_GREATER, STR_END, TMP3, 0);
+    }
+#endif
+    {
+    quit = CMP(SLJIT_LESS_EQUAL, STR_END, 0, TMP3, 0);
+    OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
+    JUMPHERE(quit);
+    }
+  }
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+if (common->utf && offset > 0)
+  utf_start = LABEL();
+#endif
+
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
+
+/* SSE2 accelerated first character search. */
+
+if (sljit_x86_is_sse2_available())
+  {
+  fast_forward_first_char2_sse2(common, char1, char2);
 
-  if (any)
+  SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE || offset == 0);
+  if (common->mode == PCRE2_JIT_COMPLETE)
     {
+    /* In complete mode, we don't need to run a match when STR_PTR == STR_END. */
+    SLJIT_ASSERT(common->forced_quit_label == NULL);
+    OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH);
+    add_jump(compiler, &common->forced_quit, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+    if (common->utf && offset > 0)
+      {
+      SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE);
+
+      OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offset));
+      OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
 #if PCRE2_CODE_UNIT_WIDTH == 8
-    mask = 0xff;
+      OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0);
+      CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0x80, utf_start);
 #elif PCRE2_CODE_UNIT_WIDTH == 16
-    mask = 0xffff;
-#elif PCRE2_CODE_UNIT_WIDTH == 32
-    mask = 0xffffffff;
+      OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00);
+      CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00, utf_start);
 #else
-    SLJIT_ASSERT_STOP();
+#error "Unknown code width"
 #endif
-
-    do
-      {
-      chars[0] = mask;
-      chars[1] = mask;
-      bytes[0] = 255;
-
-      consumed++;
-      if (--max_chars == 0)
-        return consumed;
-      chars += 2;
-      bytes += MAX_N_BYTES;
+      OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
       }
-    while (--repeat > 0);
+#endif
 
-    repeat = 1;
-    continue;
+    if (offset > 0)
+      OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset));
+    }
+  else if (sljit_x86_is_cmov_available())
+    {
+    OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, STR_PTR, 0, STR_END, 0);
+    sljit_x86_emit_cmov(compiler, SLJIT_GREATER_EQUAL, STR_PTR, has_match_end ? SLJIT_MEM1(SLJIT_SP) : STR_END, has_match_end ? common->match_end_ptr : 0);
+    }
+  else
+    {
+    quit = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0);
+    OP1(SLJIT_MOV, STR_PTR, 0, has_match_end ? SLJIT_MEM1(SLJIT_SP) : STR_END, has_match_end ? common->match_end_ptr : 0);
+    JUMPHERE(quit);
     }
 
-  len = 1;
-#ifdef SUPPORT_UNICODE
-  if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc);
+  if (has_match_end)
+    OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
+  return;
+  }
+
 #endif
 
-  if (caseless && char_has_othercase(common, cc))
+quit = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+
+start = LABEL();
+OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
+
+if (char1 == char2)
+  found = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, char1);
+else
+  {
+  mask = char1 ^ char2;
+  if (is_powerof2(mask))
     {
-#ifdef SUPPORT_UNICODE
-    if (common->utf)
-      {
-      GETCHAR(chr, cc);
-      if ((int)PRIV(ord2utf)(char_othercase(common, chr), othercase) != len)
-        return consumed;
-      }
-    else
-#endif
-      {
-      chr = *cc;
-      othercase[0] = TABLE_GET(chr, common->fcc, chr);
-      }
+    OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, mask);
+    found = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, char1 | mask);
     }
   else
     {
-    caseless = FALSE;
-    othercase[0] = 0; /* Stops compiler warning - PH */
+    OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, char1);
+    OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
+    OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, char2);
+    OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+    found = JUMP(SLJIT_NOT_ZERO);
     }
+  }
 
-  len_save = len;
-  cc_save = cc;
-  while (TRUE)
-    {
-    oc = othercase;
-    do
-      {
-      chr = *cc;
-#if PCRE2_CODE_UNIT_WIDTH == 32
-      if (SLJIT_UNLIKELY(chr == NOTACHAR))
-        return consumed;
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, start);
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+if (common->utf && offset > 0)
+  utf_quit = JUMP(SLJIT_JUMP);
 #endif
-      add_prefix_byte((sljit_ub)chr, bytes);
 
-      mask = 0;
-      if (caseless)
-        {
-        add_prefix_byte((sljit_ub)*oc, bytes);
-        mask = *cc ^ *oc;
-        chr |= mask;
-        }
+JUMPHERE(found);
 
-#if PCRE2_CODE_UNIT_WIDTH == 32
-      if (chars[0] == NOTACHAR && chars[1] == 0)
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+if (common->utf && offset > 0)
+  {
+  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offset));
+  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+#if PCRE2_CODE_UNIT_WIDTH == 8
+  OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0);
+  CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0x80, utf_start);
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+  OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00);
+  CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00, utf_start);
 #else
-      if (chars[0] == NOTACHAR)
+#error "Unknown code width"
+#endif
+  OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+  JUMPHERE(utf_quit);
+  }
 #endif
-        {
-        chars[0] = chr;
-        chars[1] = mask;
-        }
-      else
-        {
-        mask |= chars[0] ^ chr;
-        chr |= mask;
-        chars[0] = chr;
-        chars[1] |= mask;
-        }
-
-      len--;
-      consumed++;
-      if (--max_chars == 0)
-        return consumed;
-      chars += 2;
-      bytes += MAX_N_BYTES;
-      cc++;
-      oc++;
-      }
-    while (len > 0);
-
-    if (--repeat == 0)
-      break;
 
-    len = len_save;
-    cc = cc_save;
-    }
+JUMPHERE(quit);
 
-  repeat = 1;
-  if (last)
-    return consumed;
+if (has_match_end)
+  {
+  quit = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0);
+  OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
+  if (offset > 0)
+    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset));
+  JUMPHERE(quit);
+  OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
   }
+
+if (offset > 0)
+  OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset));
 }
 
-static SLJIT_INLINE BOOL fast_forward_first_n_chars(compiler_common *common, BOOL firstline)
+static SLJIT_INLINE BOOL fast_forward_first_n_chars(compiler_common *common)
 {
 DEFINE_COMPILER;
 struct sljit_label *start;
 struct sljit_jump *quit;
-sljit_ui chars[MAX_N_CHARS * 2];
-sljit_ub bytes[MAX_N_CHARS * MAX_N_BYTES];
-sljit_ub ones[MAX_N_CHARS];
-int offsets[3];
-sljit_ui mask;
-sljit_ub *byte_set, *byte_set_end;
+struct sljit_jump *match;
+/* bytes[0] represent the number of characters between 0
+and MAX_N_BYTES - 1, 255 represents any character. */
+PCRE2_UCHAR chars[MAX_N_CHARS * MAX_DIFF_CHARS];
+sljit_si offset;
+PCRE2_UCHAR mask;
+PCRE2_UCHAR *char_set, *char_set_end;
 int i, max, from;
-int range_right = -1, range_len = 3 - 1;
+int range_right = -1, range_len;
 sljit_ub *update_table = NULL;
 BOOL in_range;
+uint32_t rec_count;
 
 for (i = 0; i < MAX_N_CHARS; i++)
-  {
-  chars[i << 1] = NOTACHAR;
-  chars[(i << 1) + 1] = 0;
-  bytes[i * MAX_N_BYTES] = 0;
-  }
+  chars[i * MAX_DIFF_CHARS] = 0;
 
-max = scan_prefix(common, common->start, chars, bytes, MAX_N_CHARS);
+rec_count = 10000;
+max = scan_prefix(common, common->start, chars, MAX_N_CHARS, &rec_count);
 
-if (max <= 1)
+if (max < 1)
   return FALSE;
 
-for (i = 0; i < max; i++)
-  {
-  mask = chars[(i << 1) + 1];
-  ones[i] = ones_in_half_byte[mask & 0xf];
-  mask >>= 4;
-  while (mask != 0)
-    {
-    ones[i] += ones_in_half_byte[mask & 0xf];
-    mask >>= 4;
-    }
-  }
-
 in_range = FALSE;
-from = 0;   /* Prevent compiler "uninitialized" warning */
+/* Prevent compiler "uninitialized" warning */
+from = 0;
+range_len = 4 /* minimum length */ - 1;
 for (i = 0; i <= max; i++)
   {
-  if (in_range && (i - from) > range_len && (bytes[(i - 1) * MAX_N_BYTES] <= 4))
+  if (in_range && (i - from) > range_len && (chars[(i - 1) * MAX_DIFF_CHARS] < 255))
     {
     range_len = i - from;
     range_right = i - 1;
     }
 
-  if (i < max && bytes[i * MAX_N_BYTES] < 255)
+  if (i < max && chars[i * MAX_DIFF_CHARS] < 255)
     {
+    SLJIT_ASSERT(chars[i * MAX_DIFF_CHARS] > 0);
     if (!in_range)
       {
       in_range = TRUE;
       from = i;
       }
     }
-  else if (in_range)
+  else
     in_range = FALSE;
   }
 
@@ -3628,90 +4385,66 @@ if (range_right >= 0)
 
   for (i = 0; i < range_len; i++)
     {
-    byte_set = bytes + ((range_right - i) * MAX_N_BYTES);
-    SLJIT_ASSERT(byte_set[0] > 0 && byte_set[0] < 255);
-    byte_set_end = byte_set + byte_set[0];
-    byte_set++;
-    while (byte_set <= byte_set_end)
+    char_set = chars + ((range_right - i) * MAX_DIFF_CHARS);
+    SLJIT_ASSERT(char_set[0] > 0 && char_set[0] < 255);
+    char_set_end = char_set + char_set[0];
+    char_set++;
+    while (char_set <= char_set_end)
       {
-      if (update_table[*byte_set] > IN_UCHARS(i))
-        update_table[*byte_set] = IN_UCHARS(i);
-      byte_set++;
+      if (update_table[(*char_set) & 0xff] > IN_UCHARS(i))
+        update_table[(*char_set) & 0xff] = IN_UCHARS(i);
+      char_set++;
       }
     }
   }
 
-offsets[0] = -1;
-offsets[1] = -1;
-offsets[2] = -1;
+offset = -1;
 /* Scan forward. */
 for (i = 0; i < max; i++)
-  if (ones[i] <= 2) {
-    offsets[0] = i;
-    break;
-  }
-
-if (offsets[0] < 0 && range_right < 0)
-  return FALSE;
-
-if (offsets[0] >= 0)
   {
-  /* Scan backward. */
-  for (i = max - 1; i > offsets[0]; i--)
-    if (ones[i] <= 2 && i != range_right)
-      {
-      offsets[1] = i;
-      break;
-      }
-
-  /* This case is handled better by fast_forward_first_char. */
-  if (offsets[1] == -1 && offsets[0] == 0 && range_right < 0)
-    return FALSE;
-
-  /* We only search for a middle character if there is no range check. */
-  if (offsets[1] >= 0 && range_right == -1)
+  if (offset == -1)
+    {
+    if (chars[i * MAX_DIFF_CHARS] <= 2)
+      offset = i;
+    }
+  else if (chars[offset * MAX_DIFF_CHARS] == 2 && chars[i * MAX_DIFF_CHARS] <= 2)
     {
-    /* Scan from middle. */
-    for (i = (offsets[0] + offsets[1]) / 2 + 1; i < offsets[1]; i++)
-      if (ones[i] <= 2)
+    if (chars[i * MAX_DIFF_CHARS] == 1)
+      offset = i;
+    else
+      {
+      mask = chars[offset * MAX_DIFF_CHARS + 1] ^ chars[offset * MAX_DIFF_CHARS + 2];
+      if (!is_powerof2(mask))
         {
-        offsets[2] = i;
-        break;
+        mask = chars[i * MAX_DIFF_CHARS + 1] ^ chars[i * MAX_DIFF_CHARS + 2];
+        if (is_powerof2(mask))
+          offset = i;
         }
-
-    if (offsets[2] == -1)
-      {
-      for (i = (offsets[0] + offsets[1]) / 2; i > offsets[0]; i--)
-        if (ones[i] <= 2)
-          {
-          offsets[2] = i;
-          break;
-          }
       }
     }
+  }
 
-  SLJIT_ASSERT(offsets[1] == -1 || (offsets[0] < offsets[1]));
-  SLJIT_ASSERT(offsets[2] == -1 || (offsets[0] < offsets[2] && offsets[1] > offsets[2]));
-
-  chars[0] = chars[offsets[0] << 1];
-  chars[1] = chars[(offsets[0] << 1) + 1];
-  if (offsets[2] >= 0)
-    {
-    chars[2] = chars[offsets[2] << 1];
-    chars[3] = chars[(offsets[2] << 1) + 1];
-    }
-  if (offsets[1] >= 0)
-    {
-    chars[4] = chars[offsets[1] << 1];
-    chars[5] = chars[(offsets[1] << 1) + 1];
-    }
+if (range_right < 0)
+  {
+  if (offset < 0)
+    return FALSE;
+  SLJIT_ASSERT(chars[offset * MAX_DIFF_CHARS] >= 1 && chars[offset * MAX_DIFF_CHARS] <= 2);
+  /* Works regardless the value is 1 or 2. */
+  mask = chars[offset * MAX_DIFF_CHARS + chars[offset * MAX_DIFF_CHARS]];
+  fast_forward_first_char2(common, chars[offset * MAX_DIFF_CHARS + 1], mask, offset);
+  return TRUE;
   }
 
+if (range_right == offset)
+  offset = -1;
+
+SLJIT_ASSERT(offset == -1 || (chars[offset * MAX_DIFF_CHARS] >= 1 && chars[offset * MAX_DIFF_CHARS] <= 2));
+
 max -= 1;
-if (firstline)
+SLJIT_ASSERT(max > 0);
+if (common->match_end_ptr != 0)
   {
-  SLJIT_ASSERT(common->first_line_end != 0);
-  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end);
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
   OP1(SLJIT_MOV, TMP3, 0, STR_END, 0);
   OP2(SLJIT_SUB, STR_END, 0, STR_END, 0, SLJIT_IMM, IN_UCHARS(max));
   quit = CMP(SLJIT_LESS_EQUAL, STR_END, 0, TMP1, 0);
@@ -3721,68 +4454,86 @@ if (firstline)
 else
   OP2(SLJIT_SUB, STR_END, 0, STR_END, 0, SLJIT_IMM, IN_UCHARS(max));
 
+SLJIT_ASSERT(range_right >= 0);
+
 #if !(defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
-if (range_right >= 0)
-  OP1(SLJIT_MOV, RETURN_ADDR, 0, SLJIT_IMM, (sljit_sw)update_table);
+OP1(SLJIT_MOV, RETURN_ADDR, 0, SLJIT_IMM, (sljit_sw)update_table);
 #endif
 
 start = LABEL();
 quit = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
 
-SLJIT_ASSERT(range_right >= 0 || offsets[0] >= 0);
-
-if (range_right >= 0)
-  {
 #if PCRE2_CODE_UNIT_WIDTH == 8 || (defined SLJIT_LITTLE_ENDIAN && SLJIT_LITTLE_ENDIAN)
-  OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(range_right));
+OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(range_right));
 #else
-  OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(range_right + 1) - 1);
+OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(range_right + 1) - 1);
 #endif
 
 #if !(defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
-  OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM2(RETURN_ADDR, TMP1), 0);
+OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM2(RETURN_ADDR, TMP1), 0);
 #else
-  OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)update_table);
+OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)update_table);
 #endif
-  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
-  CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 0, start);
-  }
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
+CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 0, start);
 
-if (offsets[0] >= 0)
+if (offset >= 0)
   {
-  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(offsets[0]));
-  if (offsets[1] >= 0)
-    OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(offsets[1]));
+  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(offset));
   OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
 
-  if (chars[1] != 0)
-    OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, chars[1]);
-  CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[0], start);
-  if (offsets[2] >= 0)
-    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(offsets[2] - 1));
-
-  if (offsets[1] >= 0)
+  if (chars[offset * MAX_DIFF_CHARS] == 1)
+    CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset * MAX_DIFF_CHARS + 1], start);
+  else
     {
-    if (chars[5] != 0)
-      OP2(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_IMM, chars[5]);
-    CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, chars[4], start);
+    mask = chars[offset * MAX_DIFF_CHARS + 1] ^ chars[offset * MAX_DIFF_CHARS + 2];
+    if (is_powerof2(mask))
+      {
+      OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, mask);
+      CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset * MAX_DIFF_CHARS + 1] | mask, start);
+      }
+    else
+      {
+      match = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset * MAX_DIFF_CHARS + 1]);
+      CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset * MAX_DIFF_CHARS + 2], start);
+      JUMPHERE(match);
+      }
     }
+  }
 
-  if (offsets[2] >= 0)
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+if (common->utf && offset != 0)
+  {
+  if (offset < 0)
     {
-    if (chars[3] != 0)
-      OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, chars[3]);
-    CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[2], start);
+    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
+    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
     }
-  OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+  else
+    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));
+#if PCRE2_CODE_UNIT_WIDTH == 8
+  OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0);
+  CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0x80, start);
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+  OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00);
+  CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00, start);
+#else
+#error "Unknown code width"
+#endif
+  if (offset < 0)
+    OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
   }
+#endif
+
+if (offset >= 0)
+  OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
 
 JUMPHERE(quit);
 
-if (firstline)
+if (common->match_end_ptr != 0)
   {
   if (range_right >= 0)
-    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end);
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
   OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
   if (range_right >= 0)
     {
@@ -3799,24 +4550,9 @@ return TRUE;
 #undef MAX_N_CHARS
 #undef MAX_N_BYTES
 
-static SLJIT_INLINE void fast_forward_first_char(compiler_common *common, PCRE2_UCHAR first_char, BOOL caseless, BOOL firstline)
+static SLJIT_INLINE void fast_forward_first_char(compiler_common *common, PCRE2_UCHAR first_char, BOOL caseless)
 {
-DEFINE_COMPILER;
-struct sljit_label *start;
-struct sljit_jump *quit;
-struct sljit_jump *found;
-PCRE2_UCHAR oc, bit;
-
-if (firstline)
-  {
-  SLJIT_ASSERT(common->first_line_end != 0);
-  OP1(SLJIT_MOV, TMP3, 0, STR_END, 0);
-  OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end);
-  }
-
-start = LABEL();
-quit = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
-OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
+PCRE2_UCHAR oc;
 
 oc = first_char;
 if (caseless)
@@ -3827,36 +4563,11 @@ if (caseless)
     oc = UCD_OTHERCASE(first_char);
 #endif
   }
-if (first_char == oc)
-  found = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, first_char);
-else
-  {
-  bit = first_char ^ oc;
-  if (is_powerof2(bit))
-    {
-    OP2(SLJIT_OR, TMP2, 0, TMP1, 0, SLJIT_IMM, bit);
-    found = CMP(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, first_char | bit);
-    }
-  else
-    {
-    OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, first_char);
-    OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
-    OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, oc);
-    OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
-    found = JUMP(SLJIT_NOT_ZERO);
-    }
-  }
-
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-JUMPTO(SLJIT_JUMP, start);
-JUMPHERE(found);
-JUMPHERE(quit);
 
-if (firstline)
-  OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
+fast_forward_first_char2(common, first_char, oc, 0);
 }
 
-static SLJIT_INLINE void fast_forward_newline(compiler_common *common, BOOL firstline)
+static SLJIT_INLINE void fast_forward_newline(compiler_common *common)
 {
 DEFINE_COMPILER;
 struct sljit_label *loop;
@@ -3867,11 +4578,10 @@ struct sljit_jump *foundcr = NULL;
 struct sljit_jump *notfoundnl;
 jump_list *newline = NULL;
 
-if (firstline)
+if (common->match_end_ptr != 0)
   {
-  SLJIT_ASSERT(common->first_line_end != 0);
   OP1(SLJIT_MOV, TMP3, 0, STR_END, 0);
-  OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end);
+  OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
   }
 
 if (common->nltype == NLTYPE_FIXED && common->newline > 255)
@@ -3902,7 +4612,7 @@ if (common->nltype == NLTYPE_FIXED && common->newline > 255)
   JUMPHERE(firstchar);
   JUMPHERE(lastchar);
 
-  if (firstline)
+  if (common->match_end_ptr != 0)
     OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
   return;
   }
@@ -3940,13 +4650,13 @@ if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF)
 JUMPHERE(lastchar);
 JUMPHERE(firstchar);
 
-if (firstline)
+if (common->match_end_ptr != 0)
   OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
 }
 
 static BOOL check_class_ranges(compiler_common *common, const sljit_ub *bits, BOOL nclass, BOOL invert, jump_list **backtracks);
 
-static SLJIT_INLINE void fast_forward_start_bits(compiler_common *common, const sljit_ub *start_bits, BOOL firstline)
+static SLJIT_INLINE void fast_forward_start_bits(compiler_common *common, const sljit_ub *start_bits)
 {
 DEFINE_COMPILER;
 struct sljit_label *start;
@@ -3957,11 +4667,10 @@ jump_list *matches = NULL;
 struct sljit_jump *jump;
 #endif
 
-if (firstline)
+if (common->match_end_ptr != 0)
   {
-  SLJIT_ASSERT(common->first_line_end != 0);
   OP1(SLJIT_MOV, RETURN_ADDR, 0, STR_END, 0);
-  OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end);
+  OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
   }
 
 start = LABEL();
@@ -4019,7 +4728,7 @@ if (matches != NULL)
   set_jumps(matches, LABEL());
 JUMPHERE(quit);
 
-if (firstline)
+if (common->match_end_ptr != 0)
   OP1(SLJIT_MOV, STR_END, 0, RETURN_ADDR, 0);
 }
 
@@ -4328,8 +5037,10 @@ switch(length)
   case 4:
   if ((ranges[1] - ranges[0]) == (ranges[3] - ranges[2])
       && (ranges[0] | (ranges[2] - ranges[0])) == ranges[2]
+      && (ranges[1] & (ranges[2] - ranges[0])) == 0
       && is_powerof2(ranges[2] - ranges[0]))
     {
+    SLJIT_ASSERT((ranges[0] & (ranges[2] - ranges[0])) == 0 && (ranges[2] & ranges[3] & (ranges[2] - ranges[0])) != 0);
     OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, ranges[2] - ranges[0]);
     if (ranges[2] + 1 != ranges[3])
       {
@@ -4788,6 +5499,7 @@ sljit_uw typeoffset;
 cc++;
 ccbegin = cc;
 compares = 0;
+
 if (cc[-1] & XCL_MAP)
   {
   min = 0;
@@ -4845,9 +5557,8 @@ while (*cc != XCL_END)
       /* Any either accepts everything or ignored. */
       if (cc[-1] == XCL_PROP)
         {
-        if (list != backtracks)
-          compile_char1_matchingpath(common, OP_ALLANY, cc, backtracks, FALSE);
-        else
+        compile_char1_matchingpath(common, OP_ALLANY, cc, backtracks, FALSE);
+        if (list == backtracks)
           add_jump(compiler, backtracks, JUMP(SLJIT_JUMP));
         return;
         }
@@ -4928,9 +5639,10 @@ else if ((cc[-1] & XCL_MAP) != 0)
   if (!check_class_ranges(common, (const sljit_ub *)cc, FALSE, TRUE, list))
     {
 #if PCRE2_CODE_UNIT_WIDTH == 8
-    SLJIT_ASSERT(common->utf);
+    jump = NULL;
+    if (common->utf)
 #endif
-    jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
+      jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
 
     OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);
     OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
@@ -4939,7 +5651,10 @@ else if ((cc[-1] & XCL_MAP) != 0)
     OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
     add_jump(compiler, list, JUMP(SLJIT_NOT_ZERO));
 
-    JUMPHERE(jump);
+#if PCRE2_CODE_UNIT_WIDTH == 8
+    if (common->utf)
+#endif
+      JUMPHERE(jump);
     }
 
   OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0);
@@ -5280,7 +5995,7 @@ while (*cc != XCL_END)
       OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS_EQUAL);
 
       SET_CHAR_OFFSET(0);
-      OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xff);
+      OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x7f);
       OP_FLAGS(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL);
 
       SET_TYPE_OFFSET(ucp_Pc);
@@ -7835,6 +8550,10 @@ while (*cc != OP_KETRPOS)
       OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0);
       }
 
+    /* Even if the match is empty, we need to reset the control head. */
+    if (needs_control_head)
+      OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(stack));
+
     if (opcode == OP_SBRAPOS || opcode == OP_SCBRAPOS)
       add_jump(compiler, &emptymatch, CMP(SLJIT_EQUAL, TMP1, 0, STR_PTR, 0));
 
@@ -7862,6 +8581,10 @@ while (*cc != OP_KETRPOS)
       OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), (framesize + 1) * sizeof(sljit_sw), STR_PTR, 0);
       }
 
+    /* Even if the match is empty, we need to reset the control head. */
+    if (needs_control_head)
+      OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(stack));
+
     if (opcode == OP_SBRAPOS || opcode == OP_SCBRAPOS)
       add_jump(compiler, &emptymatch, CMP(SLJIT_EQUAL, TMP1, 0, STR_PTR, 0));
 
@@ -7874,9 +8597,6 @@ while (*cc != OP_KETRPOS)
       }
     }
 
-  if (needs_control_head)
-    OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(stack));
-
   JUMPTO(SLJIT_JUMP, loop);
   flush_stubs(common);
 
@@ -8082,6 +8802,8 @@ backtrack_common *backtrack;
 PCRE2_UCHAR opcode;
 PCRE2_UCHAR type;
 sljit_ui max = 0, exact;
+BOOL fast_fail;
+sljit_si fast_str_ptr;
 BOOL charpos_enabled;
 PCRE2_UCHAR charpos_char;
 unsigned int charpos_othercasebit;
@@ -8098,6 +8820,19 @@ int tmp_base, tmp_offset;
 
 PUSH_BACKTRACK(sizeof(char_iterator_backtrack), cc, NULL);
 
+fast_str_ptr = PRIVATE_DATA(cc + 1);
+fast_fail = TRUE;
+
+SLJIT_ASSERT(common->fast_forward_bc_ptr == NULL || fast_str_ptr == 0 || cc == common->fast_forward_bc_ptr);
+
+if (cc == common->fast_forward_bc_ptr)
+  fast_fail = FALSE;
+else if (common->fast_fail_start_ptr == 0)
+  fast_str_ptr = 0;
+
+SLJIT_ASSERT(common->fast_forward_bc_ptr != NULL || fast_str_ptr == 0
+  || (fast_str_ptr >= common->fast_fail_start_ptr && fast_str_ptr <= common->fast_fail_end_ptr));
+
 cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &exact, &end);
 
 if (type != OP_EXTUNI)
@@ -8111,9 +8846,13 @@ else
   tmp_offset = POSSESSIVE0;
   }
 
+if (fast_fail && fast_str_ptr != 0)
+  add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), fast_str_ptr));
+
 /* Handle fixed part first. */
 if (exact > 1)
   {
+  SLJIT_ASSERT(fast_str_ptr == 0);
   if (common->mode == PCRE2_JIT_COMPLETE
 #ifdef SUPPORT_UNICODE
       && !common->utf
@@ -8144,9 +8883,12 @@ switch(opcode)
   {
   case OP_STAR:
   case OP_UPTO:
+  SLJIT_ASSERT(fast_str_ptr == 0 || opcode == OP_STAR);
+
   if (type == OP_ANYNL || type == OP_EXTUNI)
     {
     SLJIT_ASSERT(private_data_ptr == 0);
+    SLJIT_ASSERT(fast_str_ptr == 0);
 
     allocate_stack(common, 2);
     OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0);
@@ -8228,6 +8970,8 @@ switch(opcode)
         add_jump(compiler, &backtrack->topbacktracks, JUMP(SLJIT_ZERO));
         }
       compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, FALSE);
+      if (fast_str_ptr != 0)
+        OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0);
       JUMPHERE(jump);
 
       detect_partial_match(common, &backtrack->topbacktracks);
@@ -8249,6 +8993,8 @@ switch(opcode)
       /* Search the last instance of charpos_char. */
       label = LABEL();
       compile_char1_matchingpath(common, type, cc, &no_match, FALSE);
+      if (fast_str_ptr != 0)
+        OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0);
       detect_partial_match(common, &no_match);
       OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
       if (charpos_othercasebit != 0)
@@ -8304,6 +9050,8 @@ switch(opcode)
 
       set_jumps(no_match, LABEL());
       OP1(SLJIT_MOV, STR_PTR, 0, base, offset0);
+      if (fast_str_ptr != 0)
+        OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0);
       }
 #endif
     else
@@ -8331,6 +9079,8 @@ switch(opcode)
       OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
       set_jumps(no_match, LABEL());
       OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
+      if (fast_str_ptr != 0)
+        OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0);
       }
     }
   BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL();
@@ -8341,9 +9091,12 @@ switch(opcode)
     allocate_stack(common, 1);
   OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
   BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL();
+  if (fast_str_ptr != 0)
+    OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0);
   break;
 
   case OP_MINUPTO:
+  SLJIT_ASSERT(fast_str_ptr == 0);
   if (private_data_ptr == 0)
     allocate_stack(common, 2);
   OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
@@ -8353,6 +9106,7 @@ switch(opcode)
 
   case OP_QUERY:
   case OP_MINQUERY:
+  SLJIT_ASSERT(fast_str_ptr == 0);
   if (private_data_ptr == 0)
     allocate_stack(common, 1);
   OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
@@ -8375,6 +9129,8 @@ switch(opcode)
     JUMPTO(SLJIT_JUMP, label);
     set_jumps(no_match, LABEL());
     OP1(SLJIT_MOV, STR_PTR, 0, tmp_base, tmp_offset);
+    if (fast_str_ptr != 0)
+      OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0);
     break;
     }
 #endif
@@ -8385,9 +9141,12 @@ switch(opcode)
   set_jumps(no_char1_match, LABEL());
   OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
   set_jumps(no_match, LABEL());
+  if (fast_str_ptr != 0)
+    OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0);
   break;
 
   case OP_POSUPTO:
+  SLJIT_ASSERT(fast_str_ptr == 0);
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
   if (common->utf)
     {
@@ -8416,6 +9175,7 @@ switch(opcode)
   break;
 
   case OP_POSQUERY:
+  SLJIT_ASSERT(fast_str_ptr == 0);
   OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0);
   compile_char1_matchingpath(common, type, cc, &no_match, TRUE);
   OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0);
@@ -8774,8 +9534,7 @@ while (cc < ccend)
       OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), STR_PTR, 0);
       }
     BACKTRACK_AS(braminzero_backtrack)->matchingpath = LABEL();
-    if (cc[1] > OP_ASSERTBACK_NOT)
-      count_match(common);
+    count_match(common);
     break;
 
     case OP_ONCE:
@@ -9944,7 +10703,7 @@ static SLJIT_INLINE void compile_recurse(compiler_common *common)
 DEFINE_COMPILER;
 PCRE2_SPTR cc = common->start + common->currententry->start;
 PCRE2_SPTR ccbegin = cc + 1 + LINK_SIZE + (*cc == OP_BRA ? 0 : IMM2_SIZE);
-PCRE2_SPTR ccend = bracketend(cc);
+PCRE2_SPTR ccend = bracketend(cc) - (1 + LINK_SIZE);
 BOOL needs_control_head;
 int framesize = get_framesize(common, cc, NULL, TRUE, &needs_control_head);
 int private_data_size = get_private_data_copy_length(common, ccbegin, ccend, needs_control_head);
@@ -9967,6 +10726,7 @@ common->currententry->entry = LABEL();
 set_jumps(common->currententry->calls, common->currententry->entry);
 
 sljit_emit_fast_enter(compiler, TMP2, 0);
+count_match(common);
 allocate_stack(common, private_data_size + framesize + alternativesize);
 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(private_data_size + framesize + alternativesize - 1), TMP2, 0);
 copy_private_data(common, ccbegin, ccend, TRUE, private_data_size + framesize + alternativesize, framesize + alternativesize, needs_control_head);
@@ -10206,9 +10966,9 @@ if (mode != PCRE2_JIT_COMPLETE)
     common->ovector_start += sizeof(sljit_sw);
     }
   }
-if ((re->overall_options & PCRE2_FIRSTLINE) != 0)
+if ((re->overall_options & (PCRE2_FIRSTLINE | PCRE2_USE_OFFSET_LIMIT)) != 0)
   {
-  common->first_line_end = common->ovector_start;
+  common->match_end_ptr = common->ovector_start;
   common->ovector_start += sizeof(sljit_sw);
   }
 #if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD
@@ -10251,6 +11011,14 @@ memset(common->private_data_ptrs, 0, total_length * sizeof(sljit_si));
 
 private_data_size = common->cbra_ptr + (re->top_bracket + 1) * sizeof(sljit_sw);
 set_private_data_ptrs(common, &private_data_size, ccend);
+if ((re->overall_options & PCRE2_ANCHORED) == 0 && (re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0)
+  {
+  if (!detect_fast_forward_skip(common, &private_data_size) && !common->has_skip_in_assert_back)
+    detect_fast_fail(common, common->start, &private_data_size, 4);
+  }
+
+SLJIT_ASSERT(common->fast_fail_start_ptr <= common->fast_fail_end_ptr);
+
 if (private_data_size > SLJIT_MAX_LOCAL_SIZE)
   {
   SLJIT_FREE(common->private_data_ptrs, allocator_data);
@@ -10290,8 +11058,12 @@ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, stack));
 OP1(SLJIT_MOV_UI, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, limit_match));
 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(struct sljit_stack, base));
 OP1(SLJIT_MOV, STACK_LIMIT, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(struct sljit_stack, limit));
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LIMIT_MATCH, TMP1, 0);
 
+if (common->fast_fail_start_ptr < common->fast_fail_end_ptr)
+  reset_fast_fail(common);
+
 if (mode == PCRE2_JIT_PARTIAL_SOFT)
   OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1);
 if (common->mark_ptr != 0)
@@ -10302,19 +11074,19 @@ if (common->control_head_ptr != 0)
 /* Main part of the matching */
 if ((re->overall_options & PCRE2_ANCHORED) == 0)
   {
-  mainloop_label = mainloop_entry(common, (re->flags & PCRE2_HASCRORLF) != 0, (re->overall_options & PCRE2_FIRSTLINE) != 0);
+  mainloop_label = mainloop_entry(common, (re->flags & PCRE2_HASCRORLF) != 0, re->overall_options);
   continue_match_label = LABEL();
   /* Forward search if possible. */
   if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0)
     {
-    if (mode == PCRE2_JIT_COMPLETE && fast_forward_first_n_chars(common, (re->overall_options & PCRE2_FIRSTLINE) != 0))
+    if (mode == PCRE2_JIT_COMPLETE && fast_forward_first_n_chars(common))
       ;
     else if ((re->flags & PCRE2_FIRSTSET) != 0)
-      fast_forward_first_char(common, (PCRE2_UCHAR)(re->first_codeunit), (re->flags & PCRE2_FIRSTCASELESS) != 0, (re->overall_options & PCRE2_FIRSTLINE) != 0);
+      fast_forward_first_char(common, (PCRE2_UCHAR)(re->first_codeunit), (re->flags & PCRE2_FIRSTCASELESS) != 0);
     else if ((re->flags & PCRE2_STARTLINE) != 0)
-      fast_forward_newline(common, (re->overall_options & PCRE2_FIRSTLINE) != 0);
+      fast_forward_newline(common);
     else if ((re->flags & PCRE2_FIRSTMAPSET) != 0)
-      fast_forward_start_bits(common, re->start_bitmap, (re->overall_options & PCRE2_FIRSTLINE) != 0);
+      fast_forward_start_bits(common, re->start_bitmap);
     }
   }
 else
@@ -10335,6 +11107,8 @@ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), STR_PTR, 0);
 OP1(SLJIT_MOV, COUNT_MATCH, 0, SLJIT_MEM1(SLJIT_SP), LIMIT_MATCH);
 if (common->capture_last_ptr != 0)
   OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, 0);
+if (common->fast_forward_bc_ptr != NULL)
+  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), PRIVATE_DATA(common->fast_forward_bc_ptr + 1), STR_PTR, 0);
 
 if (common->start_ptr != OVECTOR(0))
   OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_ptr, STR_PTR, 0);
@@ -10413,28 +11187,37 @@ if (mode == PCRE2_JIT_PARTIAL_SOFT)
   }
 
 /* Check we have remaining characters. */
-if ((re->overall_options & PCRE2_ANCHORED) == 0 && (re->overall_options & PCRE2_FIRSTLINE) != 0)
+if ((re->overall_options & PCRE2_ANCHORED) == 0 && common->match_end_ptr != 0)
   {
-  SLJIT_ASSERT(common->first_line_end != 0);
-  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end);
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
   }
 
-OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr);
+if (common->fast_forward_bc_ptr != NULL)
+  OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), PRIVATE_DATA(common->fast_forward_bc_ptr + 1));
+else
+  OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr);
 
 if ((re->overall_options & PCRE2_ANCHORED) == 0)
   {
   if (common->ff_newline_shortcut != NULL)
     {
+    /* There cannot be more newlines if PCRE2_FIRSTLINE is set. */
     if ((re->overall_options & PCRE2_FIRSTLINE) == 0)
-      CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, common->ff_newline_shortcut);
-    /* There cannot be more newlines here. */
+      {
+      if (common->match_end_ptr != 0)
+        {
+        OP1(SLJIT_MOV, TMP3, 0, STR_END, 0);
+        OP1(SLJIT_MOV, STR_END, 0, TMP1, 0);
+        CMPTO(SLJIT_LESS, STR_PTR, 0, TMP1, 0, common->ff_newline_shortcut);
+        OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
+        }
+      else
+        CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, common->ff_newline_shortcut);
+      }
     }
   else
     {
-    if ((re->overall_options & PCRE2_FIRSTLINE) == 0)
-      CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, mainloop_label);
-    else
-      CMPTO(SLJIT_LESS, STR_PTR, 0, TMP1, 0, mainloop_label);
+    CMPTO(SLJIT_LESS, STR_PTR, 0, (common->match_end_ptr == 0) ? STR_END : TMP1, 0, mainloop_label);
     }
   }
 
@@ -10464,6 +11247,9 @@ if (common->might_be_empty)
   JUMPTO(SLJIT_JUMP, empty_match_backtrack_label);
   }
 
+common->fast_forward_bc_ptr = NULL;
+common->fast_fail_start_ptr = 0;
+common->fast_fail_end_ptr = 0;
 common->currententry = common->entries;
 common->local_exit = TRUE;
 quit_label = common->quit_label;
index d8d941e467bdbda3ad093c8b3e409130c5e1240f..d804cfea4d3871987815ead2e8a7d3cacef2cbbc 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -129,10 +129,12 @@ arguments.match_data = match_data;
 arguments.startchar_ptr = subject;
 arguments.mark_ptr = NULL;
 arguments.options = options;
+
 if (mcontext != NULL)
   {
   arguments.callout = mcontext->callout;
   arguments.callout_data = mcontext->callout_data;
+  arguments.offset_limit = mcontext->offset_limit;
   arguments.limit_match = (mcontext->match_limit < re->limit_match)?
     mcontext->match_limit : re->limit_match;
   if (mcontext->jit_callback != NULL)
@@ -144,6 +146,7 @@ else
   {
   arguments.callout = NULL;
   arguments.callout_data = NULL;
+  arguments.offset_limit = PCRE2_UNSET;
   arguments.limit_match = (MATCH_LIMIT < re->limit_match)?
     MATCH_LIMIT : re->limit_match;
   jit_stack = NULL;
index f5b51286ec1c3dbd8c4fcd187b061c44bd96bcce..efdb05580f565d60cb40317d1e4e9aca52b846c2 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
index b076c67d12190334146fe6a8f051fbbd4c9a40c7..78837cf56a30edddca2f01f515e3dafa6c5cf159 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -188,6 +188,7 @@ static struct regression_test_case regression_test_cases[] = {
        { CMUP, A, 0, 0, "\xf0\x90\x90\x80{2}", "\xf0\x90\x90\x80#\xf0\x90\x90\xa8\xf0\x90\x90\x80" },
        { CMUP, A, 0, 0, "\xf0\x90\x90\xa8{2}", "\xf0\x90\x90\x80#\xf0\x90\x90\xa8\xf0\x90\x90\x80" },
        { CMUP, A, 0, 0, "\xe1\xbd\xb8\xe1\xbf\xb8", "\xe1\xbf\xb8\xe1\xbd\xb8" },
+       { M, A, 0, 0, "[3-57-9]", "5" },
 
        /* Assertions. */
        { MU, A, 0, 0, "\\b[^A]", "A_B#" },
@@ -247,13 +248,17 @@ static struct regression_test_case regression_test_cases[] = {
        { M, A, 0, 0, "a\\z", "aaa" },
        { M, A, 0, 0 | F_NOMATCH, "a\\z", "aab" },
 
-       /* Brackets. */
+       /* Brackets and alternatives. */
        { MU, A, 0, 0, "(ab|bb|cd)", "bacde" },
        { MU, A, 0, 0, "(?:ab|a)(bc|c)", "ababc" },
        { MU, A, 0, 0, "((ab|(cc))|(bb)|(?:cd|efg))", "abac" },
        { CMU, A, 0, 0, "((aB|(Cc))|(bB)|(?:cd|EFg))", "AcCe" },
        { MU, A, 0, 0, "((ab|(cc))|(bb)|(?:cd|ebg))", "acebebg" },
        { MU, A, 0, 0, "(?:(a)|(?:b))(cc|(?:d|e))(a|b)k", "accabdbbccbk" },
+       { MU, A, 0, 0, "\xc7\x82|\xc6\x82", "\xf1\x83\x82\x82\xc7\x82\xc7\x83" },
+       { MU, A, 0, 0, "=\xc7\x82|#\xc6\x82", "\xf1\x83\x82\x82=\xc7\x82\xc7\x83" },
+       { MU, A, 0, 0, "\xc7\x82\xc7\x83|\xc6\x82\xc6\x82", "\xf1\x83\x82\x82\xc7\x82\xc7\x83" },
+       { MU, A, 0, 0, "\xc6\x82\xc6\x82|\xc7\x83\xc7\x83|\xc8\x84\xc8\x84", "\xf1\x83\x82\x82\xc8\x84\xc8\x84" },
 
        /* Greedy and non-greedy ? operators. */
        { MU, A, 0, 0, "(?:a)?a", "laab" },
@@ -323,6 +328,14 @@ static struct regression_test_case regression_test_cases[] = {
        { CMU, A, 0, 0, "[^\xe1\xbd\xb8][^\xc3\xa9]", "\xe1\xbd\xb8\xe1\xbf\xb8\xc3\xa9\xc3\x89#" },
        { MU, A, 0, 0, "[^\xe1\xbd\xb8][^\xc3\xa9]", "\xe1\xbd\xb8\xe1\xbf\xb8\xc3\xa9\xc3\x89#" },
        { MU, A, 0, 0, "[^\xe1\xbd\xb8]{3,}?", "##\xe1\xbd\xb8#\xe1\xbd\xb8#\xc3\x89#\xe1\xbd\xb8" },
+       { MU, A, 0, 0, "\\d+123", "987654321,01234" },
+       { MU, A, 0, 0, "abcd*|\\w+xy", "aaaaa,abxyz" },
+       { MU, A, 0, 0, "(?:abc|((?:amc|\\b\\w*xy)))", "aaaaa,abxyz" },
+       { MU, A, 0, 0, "a(?R)|([a-z]++)#", ".abcd.abcd#."},
+       { MU, A, 0, 0, "a(?R)|([a-z]++)#", ".abcd.mbcd#."},
+       { MU, A, 0, 0, ".[ab]*.", "xx" },
+       { MU, A, 0, 0, ".[ab]*a", "xxa" },
+       { MU, A, 0, 0, ".[ab]?.", "xx" },
 
        /* Bracket repeats with limit. */
        { MU, A, 0, 0, "(?:(ab){2}){5}M", "abababababababababababM" },
@@ -679,6 +692,7 @@ static struct regression_test_case regression_test_cases[] = {
        { MU | PCRE2_FIRSTLINE, PCRE2_NEWLINE_CRLF, 0, 1, ".", "\r\n" },
        { PCRE2_FIRSTLINE | PCRE2_DOTALL, PCRE2_NEWLINE_LF, 0, 0 | F_NOMATCH, "ab.", "ab" },
        { MU | PCRE2_FIRSTLINE, A, 0, 1 | F_NOMATCH, "^[a-d0-9]", "\nxx\nd" },
+       { PCRE2_FIRSTLINE | PCRE2_DOTALL, PCRE2_NEWLINE_ANY, 0, 0, "....a", "012\n0a" },
 
        /* Recurse. */
        { MU, A, 0, 0, "(a)(?1)", "aa" },
@@ -813,6 +827,9 @@ static struct regression_test_case regression_test_cases[] = {
 
        /* (*SKIP) verb. */
        { MU, A, 0, 0 | F_NOMATCH, "(?=a(*SKIP)b)ab|ad", "ad" },
+       { MU, A, 0, 0, "(\\w+(*SKIP)#)", "abcd,xyz#," },
+       { MU, A, 0, 0, "\\w+(*SKIP)#|mm", "abcd,xyz#," },
+       { MU, A, 0, 0 | F_NOMATCH, "b+(?<=(*SKIP)#c)|b+", "#bbb" },
 
        /* (*THEN) verb. */
        { MU, A, 0, 0, "((?:a(*THEN)|aab)(*THEN)c|a+)+m", "aabcaabcaabcaabcnacm" },
index ca68bca2ae9005b18d4c432b02ed260626452cf4..2c7ae84d864dce07621e82af4ec248dacf3372f8 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
index d3d5c1dfa321f1484e0d6856595a3da292dafd83..f5275c7c4cdef5379c74bce103af5d3ddf7b8c04 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -194,7 +194,7 @@ if (caseless)
       GETCHARINC(c, eptr);
       GETCHARINC(d, p);
       ur = GET_UCD(d);
-      if (c != d && c != d + ur->other_case)
+      if (c != d && c != (uint32_t)((int)d + ur->other_case))
         {
         const uint32_t *pp = PRIV(ucd_caseless_sets) + ur->caseset;
         for (;;)
@@ -211,7 +211,7 @@ if (caseless)
     /* Not in UTF mode */
 
     {
-    while (length-- > 0)
+    for (; length > 0; length--)
       {
       uint32_t cc, cp;
       if (eptr >= mb->end_subject) return 1;   /* Partial match */
@@ -226,11 +226,11 @@ if (caseless)
   }
 
 /* In the caseful case, we can just compare the code units, whether or not we
-are in UT mode. */
+are in UTF mode. */
 
 else
   {
-  while (length-- > 0)
+  for (; length > 0; length--)
     {
     if (eptr >= mb->end_subject) return 1;   /* Partial match */
     if (UCHAR21INCTEST(p) != UCHAR21INCTEST(eptr)) return -1;  /*No match */
@@ -1704,14 +1704,14 @@ for (;;)
     back a number of characters, not bytes. */
 
     case OP_REVERSE:
+    i = GET(ecode, 1);
 #ifdef SUPPORT_UNICODE
     if (utf)
       {
-      i = GET(ecode, 1);
       while (i-- > 0)
         {
+        if (eptr <= mb->start_subject) RRETURN(MATCH_NOMATCH);
         eptr--;
-        if (eptr < mb->start_subject) RRETURN(MATCH_NOMATCH);
         BACKCHAR(eptr);
         }
       }
@@ -1721,8 +1721,8 @@ for (;;)
     /* No UTF-8 support, or not in UTF-8 mode: count is byte count */
 
       {
-      eptr -= GET(ecode, 1);
-      if (eptr < mb->start_subject) RRETURN(MATCH_NOMATCH);
+      if (i > eptr - mb->start_subject) RRETURN(MATCH_NOMATCH);
+      eptr -= i;
       }
 
     /* Save the earliest consulted character, then skip to next op code */
@@ -2408,8 +2408,9 @@ for (;;)
     ecode++;
     break;
 
-    /* Match a single byte, even in UTF-8 mode. This opcode really does match
-    any byte, even newline, independent of the setting of PCRE2_DOTALL. */
+    /* Match a single code unit, even in UTF-8 mode. This opcode really does
+    match any code unit, even newline. (It really should be called ANYCODEUNIT,
+    of course - the byte name is from pre-16 bit days.) */
 
     case OP_ANYBYTE:
     if (eptr >= mb->end_subject)   /* DO NOT merge the eptr++ here; it must */
@@ -3342,7 +3343,10 @@ for (;;)
         CHECK_PARTIAL();             /* Not SCHECK_PARTIAL() */
         RRETURN(MATCH_NOMATCH);
         }
-      while (length-- > 0) if (*ecode++ != UCHAR21INC(eptr)) RRETURN(MATCH_NOMATCH);
+      for (; length > 0; length--)
+        {
+        if (*ecode++ != UCHAR21INC(eptr)) RRETURN(MATCH_NOMATCH);
+        }
       }
     else
 #endif
@@ -6459,6 +6463,7 @@ PCRE2_UCHAR first_cu2 = 0;
 PCRE2_UCHAR req_cu = 0;
 PCRE2_UCHAR req_cu2 = 0;
 
+PCRE2_SPTR bumpalong_limit;
 PCRE2_SPTR end_subject;
 PCRE2_SPTR start_match = subject + start_offset;
 PCRE2_SPTR req_cu_ptr = start_match - 1;
@@ -6482,6 +6487,7 @@ mb->match_frames_base = &frame_zero;
 subject string. */
 
 if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject);
+end_subject = subject + length;
 
 /* Plausibility checks */
 
@@ -6513,7 +6519,7 @@ occur. */
 
 #define FF (PCRE2_NOTEMPTY_SET|PCRE2_NE_ATST_SET)
 #define OO (PCRE2_NOTEMPTY|PCRE2_NOTEMPTY_ATSTART)
-options |= (re->flags & FF) / ((FF & -FF) / (OO & -OO));
+options |= (re->flags & FF) / ((FF & (~FF+1)) / (OO & (~OO+1)));
 #undef FF
 #undef OO
 
@@ -6533,21 +6539,66 @@ mb->partial = ((options & PCRE2_PARTIAL_HARD) != 0)? 2 :
 
 /* Check a UTF string for validity if required. For 8-bit and 16-bit strings,
 we must also check that a starting offset does not point into the middle of a
-multiunit character. */
+multiunit character. We check only the portion of the subject that is going to
+be inspected during matching - from the offset minus the maximum back reference
+to the given length. This saves time when a small part of a large subject is
+being matched by the use of a starting offset. Note that the maximum lookbehind
+is a number of characters, not code units. */
 
 #ifdef SUPPORT_UNICODE
 if (utf && (options & PCRE2_NO_UTF_CHECK) == 0)
   {
-  match_data->rc = PRIV(valid_utf)(subject, length, &(match_data->startchar));
-  if (match_data->rc != 0) return match_data->rc;
+  PCRE2_SPTR check_subject = start_match;  /* start_match includes offset */
+
+  if (start_offset > 0)
+    {
 #if PCRE2_CODE_UNIT_WIDTH != 32
-  if (start_offset > 0 && start_offset < length &&
-      NOT_FIRSTCHAR(subject[start_offset]))
-    return PCRE2_ERROR_BADUTFOFFSET;
+    unsigned int i;
+    if (start_match < end_subject && NOT_FIRSTCU(*start_match))
+      return PCRE2_ERROR_BADUTFOFFSET;
+    for (i = re->max_lookbehind; i > 0 && check_subject > subject; i--)
+      {
+      check_subject--;
+      while (check_subject > subject &&
+#if PCRE2_CODE_UNIT_WIDTH == 8
+      (*check_subject & 0xc0) == 0x80)
+#else  /* 16-bit */
+      (*check_subject & 0xfc00) == 0xdc00)
+#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
+        check_subject--;
+      }
+#else
+    /* In the 32-bit library, one code unit equals one character. However,
+    we cannot just subtract the lookbehind and then compare pointers, because
+    a very large lookbehind could create an invalid pointer. */
+
+    if (start_offset >= re->max_lookbehind)
+      check_subject -= re->max_lookbehind;
+    else
+      check_subject = subject;
 #endif  /* PCRE2_CODE_UNIT_WIDTH != 32 */
+    }
+
+  /* Validate the relevant portion of the subject. After an error, adjust the
+  offset to be an absolute offset in the whole string. */
+
+  match_data->rc = PRIV(valid_utf)(check_subject,
+    length - (check_subject - subject), &(match_data->startchar));
+  if (match_data->rc != 0)
+    {
+    match_data->startchar += check_subject - subject;
+    return match_data->rc;
+    }
   }
 #endif  /* SUPPORT_UNICODE */
 
+/* It is an error to set an offset limit without setting the flag at compile
+time. */
+
+if (mcontext->offset_limit != PCRE2_UNSET &&
+     (re->overall_options & PCRE2_USE_OFFSET_LIMIT) == 0)
+  return PCRE2_ERROR_BADOFFSETLIMIT;
+
 /* If the pattern was successfully studied with JIT support, run the JIT
 executable instead of the rest of this function. Most options must be set at
 compile time for the JIT code to be usable. Fallback to the normal code path if
@@ -6568,30 +6619,21 @@ if (re->executable_jit != NULL && (options & ~PUBLIC_JIT_MATCH_OPTIONS) == 0)
 anchored = ((re->overall_options | options) & PCRE2_ANCHORED) != 0;
 firstline = (re->overall_options & PCRE2_FIRSTLINE) != 0;
 startline = (re->flags & PCRE2_STARTLINE) != 0;
+bumpalong_limit =  (mcontext->offset_limit == PCRE2_UNSET)?
+  end_subject : subject + mcontext->offset_limit;
 
 /* Fill in the fields in the match block. */
 
-if (mcontext == NULL)
-  {
-  mb->callout = NULL;
-  mb->memctl = re->memctl;
+mb->callout = mcontext->callout;
+mb->callout_data = mcontext->callout_data;
+mb->memctl = mcontext->memctl;
 #ifdef HEAP_MATCH_RECURSE
-  mb->stack_memctl = re->memctl;
+mb->stack_memctl = mcontext->stack_memctl;
 #endif
-  }
-else
-  {
-  mb->callout = mcontext->callout;
-  mb->callout_data = mcontext->callout_data;
-  mb->memctl = mcontext->memctl;
-#ifdef HEAP_MATCH_RECURSE
-  mb->stack_memctl = mcontext->stack_memctl;
-#endif
-  }
 
 mb->start_subject = subject;
 mb->start_offset = start_offset;
-mb->end_subject = end_subject = mb->start_subject + length;
+mb->end_subject = end_subject;
 mb->hasthen = (re->flags & PCRE2_HASTHEN) != 0;
 
 mb->moptions = options;                 /* Match options */
@@ -6783,7 +6825,8 @@ for(;;)
       end_subject = t;
       }
 
-    /* Advance to a unique first code unit if there is one. */
+    /* Advance to a unique first code unit if there is one. In 8-bit mode, the
+    use of memchr() gives a big speed up. */
 
     if (has_first_cu)
       {
@@ -6793,8 +6836,15 @@ for(;;)
           (smc = UCHAR21TEST(start_match)) != first_cu && smc != first_cu2)
           start_match++;
       else
+        {
+#if PCRE2_CODE_UNIT_WIDTH != 8
         while (start_match < end_subject && UCHAR21TEST(start_match) != first_cu)
           start_match++;
+#else
+        start_match = memchr(start_match, first_cu, end_subject - start_match);
+        if (start_match == NULL) start_match = end_subject;
+#endif
+        }
       }
 
     /* Or to just after a linebreak for a multiline match */
@@ -6926,6 +6976,14 @@ for(;;)
 
   /* ------------ End of start of match optimizations ------------ */
 
+  /* Give no match if we have passed the bumpalong limit. */
+
+  if (start_match > bumpalong_limit)
+    {
+    rc = MATCH_NOMATCH;
+    break;
+    }
+
   /* OK, we can now run the match. If "hitend" is set afterwards, remember the
   first starting point for which a partial match was found. */
 
@@ -7044,7 +7102,7 @@ for(;;)
 
 (2) The pattern is anchored or the match was failed by (*COMMIT);
 
-(3) We are past the end of the subject;
+(3) We are past the end of the subject or the bumpalong limit;
 
 (4) PCRE2_FIRSTLINE is set and we have failed to match at a newline, because
     this option requests that a match occur at or before the first newline in
index 1f2fb1536e948ec9032edda495cd3b2540a28d64..85ac9983485eb6c002f8f2979fa4b09a78c0adaa 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
index 7f482f245718ce266a82b7fc6ccdfd937254987d..6e9366db93c6b8bbacf8dd123a55f67d97a7ec28 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
index d268e94ee0594a1595a215a3a364ce93c517c416..75252b763a2f5e1a3bc67f3e87039dd3d2e7b466 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
index a0e734c9b47abb4b002562960a559b29eed96ce8..5b32a905b01ecf744c1429a8164f7e184fe79dd0 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -77,6 +77,7 @@ if (where == NULL)   /* Requests field length */
     case PCRE2_INFO_CAPTURECOUNT:
     case PCRE2_INFO_FIRSTCODETYPE:
     case PCRE2_INFO_FIRSTCODEUNIT:
+    case PCRE2_INFO_HASBACKSLASHC:
     case PCRE2_INFO_HASCRORLF:
     case PCRE2_INFO_JCHANGED:
     case PCRE2_INFO_LASTCODETYPE:
@@ -151,6 +152,10 @@ switch(what)
     &(re->start_bitmap[0]) : NULL;
   break;
 
+  case PCRE2_INFO_HASBACKSLASHC:
+  *((uint32_t *)where) = (re->flags & PCRE2_HASBKC) != 0;
+  break;
+
   case PCRE2_INFO_HASCRORLF:
   *((uint32_t *)where) = (re->flags & PCRE2_HASCRORLF) != 0;
   break;
index 2cd01ab6365c11d9579ddc355878dc25be8164fb..40a633cfd6895811ee5d1264c835404464bca389 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -58,12 +58,13 @@ static const char *OP_names[] = { OP_NAME_LIST };
 
 /* The functions and tables herein must all have mode-dependent names. */
 
-#define OP_lengths        PCRE2_SUFFIX(OP_lengths_)
-#define get_ucpname       PCRE2_SUFFIX(get_ucpname_)
-#define pcre2_printint    PCRE2_SUFFIX(pcre2_printint_)
-#define print_char        PCRE2_SUFFIX(print_char_)
-#define print_custring    PCRE2_SUFFIX(print_custring_)
-#define print_prop        PCRE2_SUFFIX(print_prop_)
+#define OP_lengths            PCRE2_SUFFIX(OP_lengths_)
+#define get_ucpname           PCRE2_SUFFIX(get_ucpname_)
+#define pcre2_printint        PCRE2_SUFFIX(pcre2_printint_)
+#define print_char            PCRE2_SUFFIX(print_char_)
+#define print_custring        PCRE2_SUFFIX(print_custring_)
+#define print_custring_bylen  PCRE2_SUFFIX(print_custring_bylen_)
+#define print_prop            PCRE2_SUFFIX(print_prop_)
 
 /* Table of sizes for the fixed-length opcodes. It's defined in a macro so that
 the definition is next to the definition of the opcodes in pcre2_internal.h.
@@ -188,12 +189,14 @@ return 0;
 *     Print string as a list of code units       *
 *************************************************/
 
-/* This takes no account of UTF as it always prints each individual code unit.
-The string is zero-terminated.
+/* These take no account of UTF as they always print each individual code unit.
+The string is zero-terminated for print_custring(); the length is given for
+print_custring_bylen().
 
 Arguments:
   f          file to write to
   ptr        point to the string
+  len        length for print_custring_bylen()
 
 Returns:     nothing
 */
@@ -208,6 +211,16 @@ while (*ptr != '\0')
   }
 }
 
+static void
+print_custring_bylen(FILE *f, PCRE2_SPTR ptr, PCRE2_UCHAR len)
+{
+while (len-- > 0)
+  {
+  register uint32_t c = *ptr++;
+  if (PRINTABLE(c)) fprintf(f, "%c", c); else fprintf(f, "\\x{%x}", c);
+  }
+}
+
 
 
 /*************************************************
@@ -603,7 +616,7 @@ for(;;)
     c = code[1 + 4*LINK_SIZE];
     fprintf(f, "    %s %c", OP_names[*code], c);
     extra = GET(code, 1 + 2*LINK_SIZE);
-    print_custring(f, code + 2 + 4*LINK_SIZE);
+    print_custring_bylen(f, code + 2 + 4*LINK_SIZE, extra - 3 - 4*LINK_SIZE);
     for (i = 0; PRIV(callout_start_delims)[i] != 0; i++)
       if (c == PRIV(callout_start_delims)[i])
         {
@@ -791,7 +804,7 @@ for(;;)
     case OP_SKIP_ARG:
     case OP_THEN_ARG:
     fprintf(f, "    %s ", OP_names[*code]);
-    print_custring(f, code + 2);
+    print_custring_bylen(f, code + 2, code[1]);
     extra += code[1];
     break;
 
index 828b9461eb55474f189ff39e55cb64cf6ce99976..8c44acfdcaf1944a0a8ad7451f035ee54f1d1ec4 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2015 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -104,7 +104,7 @@ for (i = 0; i < number_of_codes; i++)
     return PCRE2_ERROR_MIXEDTABLES;
   total_size += re->blocksize;
   }
-  
+
 /* Initialize the byte stream. */
 bytes = memctl->malloc(total_size + sizeof(pcre2_memctl), memctl->memory_data);
 if (bytes == NULL) return PCRE2_ERROR_NOMEMORY;
@@ -167,7 +167,7 @@ if (number_of_codes > data->number_of_codes)
 
 src_bytes = bytes + sizeof(pcre2_serialized_data);
 
-/* Decode tables. The reference count for the tables is stored immediately 
+/* Decode tables. The reference count for the tables is stored immediately
 following them. */
 
 tables = memctl->malloc(tables_length + sizeof(PCRE2_SIZE), memctl->memory_data);
@@ -179,8 +179,8 @@ src_bytes += tables_length;
 
 /* Decode the byte stream. We must not try to read the size from the compiled
 code block in the stream, because it might be unaligned, which causes errors on
-hardware such as Sparc-64 that doesn't like unaligned memory accesses. The type 
-of the blocksize field is given its own name to ensure that it is the same here 
+hardware such as Sparc-64 that doesn't like unaligned memory accesses. The type
+of the blocksize field is given its own name to ensure that it is the same here
 as in the block. */
 
 for (i = 0; i < number_of_codes; i++)
@@ -190,8 +190,8 @@ for (i = 0; i < number_of_codes; i++)
     sizeof(CODE_BLOCKSIZE_TYPE));
 
   /* The allocator provided by gcontext replaces the original one. */
-   
-  dst_re = (pcre2_real_code *)PRIV(memctl_malloc)(blocksize, 
+
+  dst_re = (pcre2_real_code *)PRIV(memctl_malloc)(blocksize,
     (pcre2_memctl *)gcontext);
   if (dst_re == NULL)
     {
@@ -205,12 +205,12 @@ for (i = 0; i < number_of_codes; i++)
     }
 
   /* The new allocator must be preserved. */
-   
+
   memcpy(((uint8_t *)dst_re) + sizeof(pcre2_memctl),
     src_bytes + sizeof(pcre2_memctl), blocksize - sizeof(pcre2_memctl));
 
   /* At the moment only one table is supported. */
-   
+
   dst_re->tables = tables;
   dst_re->executable_jit = NULL;
   dst_re->flags |= PCRE2_DEREF_TABLES;
@@ -252,7 +252,7 @@ if (bytes != NULL)
   {
   pcre2_memctl *memctl = (pcre2_memctl *)(bytes - sizeof(pcre2_memctl));
   memctl->free(memctl, memctl->memory_data);
-  } 
+  }
 }
 
 /* End of pcre2_serialize.c */
index 888620e198332a939bed3699e3dbdda34d696a51..2a1f282629aba2d99778a7d6f50a22a5f3282fac 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -121,7 +121,7 @@ int
 PRIV(strncmp)(PCRE2_SPTR str1, PCRE2_SPTR str2, size_t len)
 {
 PCRE2_UCHAR c1, c2;
-while (len-- > 0)
+for (; len > 0; len--)
   {
   c1 = *str1++;
   c2 = *str2++;
@@ -150,7 +150,7 @@ int
 PRIV(strncmp_c8)(PCRE2_SPTR str1, const char *str2, size_t len)
 {
 PCRE2_UCHAR c1, c2;
-while (len-- > 0)
+for (; len > 0; len--)
   {
   c1 = *str1++;
   c2 = *str2++;
index 25d7e51404859eadb0162657bb383031b9645c90..18932adeffe98048f88ba0490cc866d84f1e29cd 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -59,15 +59,17 @@ collecting data (e.g. minimum matching length). */
 enum { SSB_FAIL, SSB_DONE, SSB_CONTINUE, SSB_UNKNOWN };
 
 
-
 /*************************************************
 *   Find the minimum subject length for a group  *
 *************************************************/
 
 /* Scan a parenthesized group and compute the minimum length of subject that
 is needed to match it. This is a lower bound; it does not mean there is a
-string of that length that matches. In UTF8 mode, the result is in characters
-rather than bytes.
+string of that length that matches. In UTF mode, the result is in characters
+rather than code units. The field in a compiled pattern for storing the minimum
+length is 16-bits long (on the grounds that anything longer than that is
+pathological), so we give up when we reach that amount. This also means that
+integer overflow for really crazy patterns cannot happen.
 
 Arguments:
   re              compiled pattern block
@@ -75,36 +77,57 @@ Arguments:
   startcode       pointer to start of the whole pattern's code
   utf             UTF flag
   recurses        chain of recurse_check to catch mutual recursion
+  countptr        pointer to call count (to catch over complexity)
 
 Returns:   the minimum length
            -1 \C in UTF-8 mode
               or (*ACCEPT)
+              or pattern too complicated
+              or back reference to duplicate name/number
            -2 internal error (missing capturing bracket)
            -3 internal error (opcode not listed)
 */
 
 static int
 find_minlength(const pcre2_real_code *re, PCRE2_SPTR code,
-  PCRE2_SPTR startcode, BOOL utf, recurse_check *recurses)
+  PCRE2_SPTR startcode, BOOL utf, recurse_check *recurses, int *countptr)
 {
 int length = -1;
+int prev_cap_recno = -1;
+int prev_cap_d = 0;
+int prev_recurse_recno = -1;
+int prev_recurse_d = 0;
+uint32_t once_fudge = 0;
 BOOL had_recurse = FALSE;
+BOOL dupcapused = (re->flags & PCRE2_DUPCAPUSED) != 0;
 recurse_check this_recurse;
 register int branchlength = 0;
 register PCRE2_UCHAR *cc = (PCRE2_UCHAR *)code + 1 + LINK_SIZE;
 
-if (*code == OP_CBRA || *code == OP_SCBRA ||
-    *code == OP_CBRAPOS || *code == OP_SCBRAPOS) cc += IMM2_SIZE;
+/* If this is a "could be empty" group, its minimum length is 0. */
+
+if (*code >= OP_SBRA && *code <= OP_SCOND) return 0;
+
+/* Skip over capturing bracket number */
+
+if (*code == OP_CBRA || *code == OP_CBRAPOS) cc += IMM2_SIZE;
 
-/* Scan along the opcodes for this branch. If we get to the end of the
-branch, check the length against that of the other branches. */
+/* A large and/or complex regex can take too long to process. */
+
+if ((*countptr)++ > 1000) return -1;
+
+/* Scan along the opcodes for this branch. If we get to the end of the branch,
+check the length against that of the other branches. If the accumulated length
+passes 16-bits, stop. */
 
 for (;;)
   {
-  int d, min;
+  int d, min, recno;
   PCRE2_UCHAR *cs, *ce;
   register PCRE2_UCHAR op = *cc;
 
+  if (branchlength >= UINT16_MAX) return UINT16_MAX;
+
   switch (op)
     {
     case OP_COND:
@@ -112,7 +135,8 @@ for (;;)
 
     /* If there is only one branch in a condition, the implied branch has zero
     length, so we don't add anything. This covers the DEFINE "condition"
-    automatically. */
+    automatically. If there are two branches we can treat it the same as any
+    other non-capturing subpattern. */
 
     cs = cc + GET(cc, 1);
     if (*cs != OP_ALT)
@@ -120,27 +144,56 @@ for (;;)
       cc = cs + 1 + LINK_SIZE;
       break;
       }
+    goto PROCESS_NON_CAPTURE;
 
-    /* Otherwise we can fall through and treat it the same as any other
-    subpattern. */
+    /* There's a special case of OP_ONCE, when it is wrapped round an
+    OP_RECURSE. We'd like to process the latter at this level so that
+    remembering the value works for repeated cases. So we do nothing, but
+    set a fudge value to skip over the OP_KET after the recurse. */
 
-    case OP_CBRA:
-    case OP_SCBRA:
+    case OP_ONCE:
+    if (cc[1+LINK_SIZE] == OP_RECURSE && cc[2*(1+LINK_SIZE)] == OP_KET)
+      {
+      once_fudge = 1 + LINK_SIZE;
+      cc += 1 + LINK_SIZE;
+      break;
+      }
+    /* Fall through */
+
+    case OP_ONCE_NC:
     case OP_BRA:
     case OP_SBRA:
-    case OP_CBRAPOS:
-    case OP_SCBRAPOS:
     case OP_BRAPOS:
     case OP_SBRAPOS:
-    case OP_ONCE:
-    case OP_ONCE_NC:
-    d = find_minlength(re, cc, startcode, utf, recurses);
+    PROCESS_NON_CAPTURE:
+    d = find_minlength(re, cc, startcode, utf, recurses, countptr);
     if (d < 0) return d;
     branchlength += d;
     do cc += GET(cc, 1); while (*cc == OP_ALT);
     cc += 1 + LINK_SIZE;
     break;
 
+    /* To save time for repeated capturing subpatterns, we remember the
+    length of the previous one. Unfortunately we can't do the same for
+    the unnumbered ones above. Nor can we do this if (?| is present in the
+    pattern because captures with the same number are not then identical. */
+
+    case OP_CBRA:
+    case OP_SCBRA:
+    case OP_CBRAPOS:
+    case OP_SCBRAPOS:
+    recno = dupcapused? prev_cap_recno - 1 : (int)GET2(cc, 1+LINK_SIZE);
+    if (recno != prev_cap_recno)
+      {
+      prev_cap_recno = recno;
+      prev_cap_d = find_minlength(re, cc, startcode, utf, recurses, countptr);
+      if (prev_cap_d < 0) return prev_cap_d;
+      }
+    branchlength += prev_cap_d;
+    do cc += GET(cc, 1); while (*cc == OP_ALT);
+    cc += 1 + LINK_SIZE;
+    break;
+
     /* ACCEPT makes things far too complicated; we have to give up. */
 
     case OP_ACCEPT:
@@ -388,8 +441,12 @@ for (;;)
     matches an empty string (by default it causes a matching failure), so in
     that case we must set the minimum length to zero. */
 
-    case OP_DNREF:     /* Duplicate named pattern back reference */
+    /* Duplicate named pattern back reference. We cannot reliably find a length
+    for this if duplicate numbers are present in the pattern. */
+
+    case OP_DNREF:
     case OP_DNREFI:
+    if (dupcapused) return -1;
     if ((re->overall_options & PCRE2_MATCH_UNSET_BACKREF) == 0)
       {
       int count = GET2(cc, 1+IMM2_SIZE);
@@ -427,7 +484,7 @@ for (;;)
             int dd;
             this_recurse.prev = recurses;
             this_recurse.group = cs;
-            dd = find_minlength(re, cs, startcode, utf, &this_recurse);
+            dd = find_minlength(re, cs, startcode, utf, &this_recurse, countptr);
             if (dd < d) d = dd;
             }
           }
@@ -438,8 +495,12 @@ for (;;)
     cc += 1 + 2*IMM2_SIZE;
     goto REPEAT_BACK_REFERENCE;
 
-    case OP_REF:      /* Single back reference */
+    /* Single back reference. We cannot find a length for this if duplicate
+    numbers are present in the pattern. */
+
+    case OP_REF:
     case OP_REFI:
+    if (dupcapused) return -1;
     if ((re->overall_options & PCRE2_MATCH_UNSET_BACKREF) == 0)
       {
       ce = cs = (PCRE2_UCHAR *)PRIV(find_bracket)(startcode, utf, GET2(cc, 1));
@@ -463,7 +524,7 @@ for (;;)
           {
           this_recurse.prev = recurses;
           this_recurse.group = cs;
-          d = find_minlength(re, cs, startcode, utf, &this_recurse);
+          d = find_minlength(re, cs, startcode, utf, &this_recurse, countptr);
           }
         }
       }
@@ -504,28 +565,51 @@ for (;;)
       break;
       }
 
-    branchlength += min * d;
+     /* Take care not to overflow: (1) min and d are ints, so check that their
+     product is not greater than INT_MAX. (2) branchlength is limited to
+     UINT16_MAX (checked at the top of the loop). */
+
+    if ((d > 0 && (INT_MAX/d) < min) || UINT16_MAX - branchlength < min*d)
+      branchlength = UINT16_MAX;
+    else branchlength += min * d;
     break;
 
+    /* Recursion always refers to the first occurrence of a subpattern with a
+    given number. Therefore, we can always make use of caching, even when the
+    pattern contains multiple subpatterns with the same number. */
+
     case OP_RECURSE:
     cs = ce = (PCRE2_UCHAR *)startcode + GET(cc, 1);
-    do ce += GET(ce, 1); while (*ce == OP_ALT);
-    if (cc > cs && cc < ce)    /* Simple recursion */
-      had_recurse = TRUE;
+    recno = GET2(cs, 1+LINK_SIZE);
+    if (recno == prev_recurse_recno)
+      {
+      branchlength += prev_recurse_d;
+      }
     else
       {
-      recurse_check *r = recurses;
-      for (r = recurses; r != NULL; r = r->prev) if (r->group == cs) break;
-      if (r != NULL)          /* Mutual recursion */
+      do ce += GET(ce, 1); while (*ce == OP_ALT);
+      if (cc > cs && cc < ce)    /* Simple recursion */
         had_recurse = TRUE;
       else
         {
-        this_recurse.prev = recurses;
-        this_recurse.group = cs;
-        branchlength += find_minlength(re, cs, startcode, utf, &this_recurse);
+        recurse_check *r = recurses;
+        for (r = recurses; r != NULL; r = r->prev) if (r->group == cs) break;
+        if (r != NULL)          /* Mutual recursion */
+          had_recurse = TRUE;
+        else
+          {
+          this_recurse.prev = recurses;
+          this_recurse.group = cs;
+          prev_recurse_d = find_minlength(re, cs, startcode, utf, &this_recurse,
+            countptr);
+          if (prev_recurse_d < 0) return prev_recurse_d;
+          prev_recurse_recno = recno;
+          branchlength += prev_recurse_d;
+          }
         }
       }
-    cc += 1 + LINK_SIZE;
+    cc += 1 + LINK_SIZE + once_fudge;
+    once_fudge = 0;
     break;
 
     /* Anything else does not or need not match a character. We can get the
@@ -1441,6 +1525,7 @@ int
 PRIV(study)(pcre2_real_code *re)
 {
 int min;
+int count = 0;
 PCRE2_UCHAR *code;
 BOOL utf = (re->overall_options & PCRE2_UTF) != 0;
 
@@ -1461,22 +1546,27 @@ if ((re->overall_options & PCRE2_ANCHORED) == 0 &&
   if (rc == SSB_DONE) re->flags |= PCRE2_FIRSTMAPSET;
   }
 
-/* Find the minimum length of subject string. */
+/* Find the minimum length of subject string. If it can match an empty string,
+the minimum length is already known. */
 
-switch(min = find_minlength(re, code, code, utf, NULL))
+if ((re->flags & PCRE2_MATCH_EMPTY) == 0)
   {
-  case -1:  /* \C in UTF mode or (*ACCEPT) */
-  break;    /* Leave minlength unchanged (will be zero) */
+  switch(min = find_minlength(re, code, code, utf, NULL, &count))
+    {
+    case -1:  /* \C in UTF mode or (*ACCEPT) or over-complex regex */
+    break;    /* Leave minlength unchanged (will be zero) */
 
-  case -2:
-  return 2; /* missing capturing bracket */
+    case -2:
+    return 2; /* missing capturing bracket */
 
-  case -3:
-  return 3; /* unrecognized opcode */
+    case -3:
+    return 3; /* unrecognized opcode */
 
-  default:
-  re->minlength = min;
-  break;
+    default:
+    if (min > UINT16_MAX) min = UINT16_MAX;
+    re->minlength = min;
+    break;
+    }
   }
 
 return 0;
index ec00ebb86d416ce72254563f2e901ba7476d8833..0bf781efc1f1a755d4071d4830d7f508afc0677f 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,121 @@ POSSIBILITY OF SUCH DAMAGE.
 
 #include "pcre2_internal.h"
 
+#define PTR_STACK_SIZE 20
+
+#define SUBSTITUTE_OPTIONS \
+  (PCRE2_SUBSTITUTE_EXTENDED|PCRE2_SUBSTITUTE_GLOBAL| \
+   PCRE2_SUBSTITUTE_OVERFLOW_LENGTH|PCRE2_SUBSTITUTE_UNKNOWN_UNSET| \
+   PCRE2_SUBSTITUTE_UNSET_EMPTY)
+
+
+
+/*************************************************
+*           Find end of substitute text          *
+*************************************************/
+
+/* In extended mode, we recognize ${name:+set text:unset text} and similar
+constructions. This requires the identification of unescaped : and }
+characters. This function scans for such. It must deal with nested ${
+constructions. The pointer to the text is updated, either to the required end
+character, or to where an error was detected.
+
+Arguments:
+  code      points to the compiled expression (for options)
+  ptrptr    points to the pointer to the start of the text (updated)
+  ptrend    end of the whole string
+  last      TRUE if the last expected string (only } recognized)
+
+Returns:    0 on success
+            negative error code on failure
+*/
+
+static int
+find_text_end(const pcre2_code *code, PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend,
+  BOOL last)
+{
+int rc = 0;
+uint32_t nestlevel = 0;
+BOOL literal = FALSE;
+PCRE2_SPTR ptr = *ptrptr;
+
+for (; ptr < ptrend; ptr++)
+  {
+  if (literal)
+    {
+    if (ptr[0] == CHAR_BACKSLASH && ptr < ptrend - 1 && ptr[1] == CHAR_E)
+      {
+      literal = FALSE;
+      ptr += 1;
+      }
+    }
+
+  else if (*ptr == CHAR_RIGHT_CURLY_BRACKET)
+    {
+    if (nestlevel == 0) goto EXIT;
+    nestlevel--;
+    }
+
+  else if (*ptr == CHAR_COLON && !last && nestlevel == 0) goto EXIT;
+
+  else if (*ptr == CHAR_DOLLAR_SIGN)
+    {
+    if (ptr < ptrend - 1 && ptr[1] == CHAR_LEFT_CURLY_BRACKET)
+      {
+      nestlevel++;
+      ptr += 1;
+      }
+    }
+
+  else if (*ptr == CHAR_BACKSLASH)
+    {
+    int erc;
+    int errorcode = 0;
+    uint32_t ch;
+
+    if (ptr < ptrend - 1) switch (ptr[1])
+      {
+      case CHAR_L:
+      case CHAR_l:
+      case CHAR_U:
+      case CHAR_u:
+      ptr += 1;
+      continue;
+      }
+
+    erc = PRIV(check_escape)(&ptr, ptrend, &ch, &errorcode,
+      code->overall_options, FALSE, NULL);
+    if (errorcode != 0)
+      {
+      rc = errorcode;
+      goto EXIT;
+      }
+
+    switch(erc)
+      {
+      case 0:      /* Data character */
+      case ESC_E:  /* Isolated \E is ignored */
+      break;
+
+      case ESC_Q:
+      literal = TRUE;
+      break;
+
+      default:
+      rc = PCRE2_ERROR_BADREPESCAPE;
+      goto EXIT;
+      }
+    }
+  }
+
+rc = PCRE2_ERROR_REPMISSINGBRACE;   /* Terminator not found */
+
+EXIT:
+*ptrptr = ptr;
+return rc;
+}
+
+
 
 /*************************************************
 *              Match and substitute              *
@@ -72,6 +187,30 @@ Returns:          >= 0 number of substitutions made
                   PCRE2_ERROR_BADREPLACEMENT means invalid use of $
 */
 
+/* This macro checks for space in the buffer before copying into it. On
+overflow, either give an error immediately, or keep on, accumulating the
+length. */
+
+#define CHECKMEMCPY(from,length) \
+  if (!overflowed && lengthleft < length) \
+    { \
+    if ((suboptions & PCRE2_SUBSTITUTE_OVERFLOW_LENGTH) == 0) goto NOROOM; \
+    overflowed = TRUE; \
+    extra_needed = length - lengthleft; \
+    } \
+  else if (overflowed) \
+    { \
+    extra_needed += length; \
+    }  \
+  else \
+    {  \
+    memcpy(buffer + buff_offset, from, CU2BYTES(length)); \
+    buff_offset += length; \
+    lengthleft -= length; \
+    }
+
+/* Here's the function */
+
 PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
 pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length,
   PCRE2_SIZE start_offset, uint32_t options, pcre2_match_data *match_data,
@@ -80,13 +219,28 @@ pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length,
 {
 int rc;
 int subs;
+int forcecase = 0;
+int forcecasereset = 0;
 uint32_t ovector_count;
 uint32_t goptions = 0;
+uint32_t suboptions;
 BOOL match_data_created = FALSE;
-BOOL global = FALSE;
-PCRE2_SIZE buff_offset, lengthleft, fraglength;
+BOOL literal = FALSE;
+BOOL overflowed = FALSE;
+#ifdef SUPPORT_UNICODE
+BOOL utf = (code->overall_options & PCRE2_UTF) != 0;
+#endif
+PCRE2_UCHAR temp[6];
+PCRE2_SPTR ptr;
+PCRE2_SPTR repend;
+PCRE2_SIZE extra_needed = 0;
+PCRE2_SIZE buff_offset, buff_length, lengthleft, fraglength;
 PCRE2_SIZE *ovector;
 
+buff_offset = 0;
+lengthleft = buff_length = *blength;
+*blength = PCRE2_UNSET;
+
 /* Partial matching is not valid. */
 
 if ((options & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) != 0)
@@ -106,11 +260,16 @@ if (match_data == NULL)
 ovector = pcre2_get_ovector_pointer(match_data);
 ovector_count = pcre2_get_ovector_count(match_data);
 
+/* Find lengths of zero-terminated strings and the end of the replacement. */
+
+if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject);
+if (rlength == PCRE2_ZERO_TERMINATED) rlength = PRIV(strlen)(replacement);
+repend = replacement + rlength;
+
 /* Check UTF replacement string if necessary. */
 
 #ifdef SUPPORT_UNICODE
-if ((code->overall_options & PCRE2_UTF) != 0 &&
-    (options & PCRE2_NO_UTF_CHECK) == 0)
+if (utf && (options & PCRE2_NO_UTF_CHECK) == 0)
   {
   rc = PRIV(valid_utf)(replacement, rlength, &(match_data->rightchar));
   if (rc != 0)
@@ -121,37 +280,30 @@ if ((code->overall_options & PCRE2_UTF) != 0 &&
   }
 #endif  /* SUPPORT_UNICODE */
 
-/* Notice the global option and remove it from the options that are passed to
-pcre2_match(). */
+/* Save the substitute options and remove them from the match options. */
 
-if ((options & PCRE2_SUBSTITUTE_GLOBAL) != 0)
-  {
-  options &= ~PCRE2_SUBSTITUTE_GLOBAL;
-  global = TRUE;
-  }
-
-/* Find lengths of zero-terminated strings. */
-
-if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject);
-if (rlength == PCRE2_ZERO_TERMINATED) rlength = PRIV(strlen)(replacement);
+suboptions = options & SUBSTITUTE_OPTIONS;
+options &= ~SUBSTITUTE_OPTIONS;
 
 /* Copy up to the start offset */
 
-if (start_offset > *blength) goto NOROOM;
-memcpy(buffer, subject, start_offset * (PCRE2_CODE_UNIT_WIDTH/8));
-buff_offset = start_offset;
-lengthleft = *blength - start_offset;
+CHECKMEMCPY(subject, start_offset);
 
 /* Loop for global substituting. */
 
 subs = 0;
 do
   {
-  PCRE2_SIZE i;
+  PCRE2_SPTR ptrstack[PTR_STACK_SIZE];
+  uint32_t ptrstackptr = 0;
 
   rc = pcre2_match(code, subject, length, start_offset, options|goptions,
     match_data, mcontext);
 
+#ifdef SUPPORT_UNICODE
+  if (utf) options |= PCRE2_NO_UTF_CHECK;  /* Only need to check once */
+#endif
+
   /* Any error other than no match returns the error code. No match when not
   doing the special after-empty-match global rematch, or when at the end of the
   subject, breaks the global loop. Otherwise, advance the starting point by one
@@ -164,8 +316,22 @@ do
     if (rc != PCRE2_ERROR_NOMATCH) goto EXIT;
     if (goptions == 0 || start_offset >= length) break;
 
+    /* Advance by one code point. Then, if CRLF is a valid newline sequence and
+    we have advanced into the middle of it, advance one more code point. In
+    other words, do not start in the middle of CRLF, even if CR and LF on their
+    own are valid newlines. */
+
     save_start = start_offset++;
-    if ((code->overall_options & PCRE2_UTF) != 0)
+    if (subject[start_offset-1] == CHAR_CR &&
+        code->newline_convention != PCRE2_NEWLINE_CR &&
+        code->newline_convention != PCRE2_NEWLINE_LF &&
+        start_offset < length &&
+        subject[start_offset] == CHAR_LF)
+      start_offset++;
+
+    /* Otherwise, in UTF mode, advance past any secondary code points. */
+
+    else if ((code->overall_options & PCRE2_UTF) != 0)
       {
 #if PCRE2_CODE_UNIT_WIDTH == 8
       while (start_offset < length && (subject[start_offset] & 0xc0) == 0x80)
@@ -177,60 +343,138 @@ do
 #endif
       }
 
-    fraglength = start_offset - save_start;
-    if (lengthleft < fraglength) goto NOROOM;
-    memcpy(buffer + buff_offset, subject + save_start,
-      fraglength*(PCRE2_CODE_UNIT_WIDTH/8));
-    buff_offset += fraglength;
-    lengthleft -= fraglength;
+    /* Copy what we have advanced past, reset the special global options, and
+    continue to the next match. */
 
+    fraglength = start_offset - save_start;
+    CHECKMEMCPY(subject + save_start, fraglength);
     goptions = 0;
     continue;
     }
 
-  /* Handle a successful match. */
+  /* Handle a successful match. Matches that use \K to end before they start
+  are not supported. */
+
+  if (ovector[1] < ovector[0])
+    {
+    rc = PCRE2_ERROR_BADSUBSPATTERN;
+    goto EXIT;
+    }
+
+  /* Count substitutions with a paranoid check for integer overflow; surely no
+  real call to this function would ever hit this! */
 
+  if (subs == INT_MAX)
+    {
+    rc = PCRE2_ERROR_TOOMANYREPLACE;
+    goto EXIT;
+    }
   subs++;
+
+  /* Copy the text leading up to the match. */
+
   if (rc == 0) rc = ovector_count;
   fraglength = ovector[0] - start_offset;
-  if (fraglength >= lengthleft) goto NOROOM;
-  memcpy(buffer + buff_offset, subject + start_offset,
-    fraglength*(PCRE2_CODE_UNIT_WIDTH/8));
-  buff_offset += fraglength;
-  lengthleft -= fraglength;
+  CHECKMEMCPY(subject + start_offset, fraglength);
 
-  for (i = 0; i < rlength; i++)
+  /* Process the replacement string. Literal mode is set by \Q, but only in
+  extended mode when backslashes are being interpreted. In extended mode we
+  must handle nested substrings that are to be reprocessed. */
+
+  ptr = replacement;
+  for (;;)
     {
-    if (replacement[i] == CHAR_DOLLAR_SIGN)
+    uint32_t ch;
+    unsigned int chlen;
+
+    /* If at the end of a nested substring, pop the stack. */
+
+    if (ptr >= repend)
+      {
+      if (ptrstackptr <= 0) break;       /* End of replacement string */
+      repend = ptrstack[--ptrstackptr];
+      ptr = ptrstack[--ptrstackptr];
+      continue;
+      }
+
+    /* Handle the next character */
+
+    if (literal)
+      {
+      if (ptr[0] == CHAR_BACKSLASH && ptr < repend - 1 && ptr[1] == CHAR_E)
+        {
+        literal = FALSE;
+        ptr += 2;
+        continue;
+        }
+      goto LOADLITERAL;
+      }
+
+    /* Not in literal mode. */
+
+    if (*ptr == CHAR_DOLLAR_SIGN)
       {
       int group, n;
+      uint32_t special = 0;
       BOOL inparens;
+      BOOL star;
       PCRE2_SIZE sublength;
+      PCRE2_SPTR text1_start = NULL;
+      PCRE2_SPTR text1_end = NULL;
+      PCRE2_SPTR text2_start = NULL;
+      PCRE2_SPTR text2_end = NULL;
       PCRE2_UCHAR next;
       PCRE2_UCHAR name[33];
 
-      if (++i == rlength) goto BAD;
-      if ((next = replacement[i]) == CHAR_DOLLAR_SIGN) goto LITERAL;
+      if (++ptr >= repend) goto BAD;
+      if ((next = *ptr) == CHAR_DOLLAR_SIGN) goto LOADLITERAL;
 
       group = -1;
       n = 0;
       inparens = FALSE;
+      star = FALSE;
 
       if (next == CHAR_LEFT_CURLY_BRACKET)
         {
-        if (++i == rlength) goto BAD;
-        next = replacement[i];
+        if (++ptr >= repend) goto BAD;
+        next = *ptr;
         inparens = TRUE;
         }
 
-      if (next >= CHAR_0 && next <= CHAR_9)
+      if (next == CHAR_ASTERISK)
+        {
+        if (++ptr >= repend) goto BAD;
+        next = *ptr;
+        star = TRUE;
+        }
+
+      if (!star && next >= CHAR_0 && next <= CHAR_9)
         {
         group = next - CHAR_0;
-        while (++i < rlength)
+        while (++ptr < repend)
           {
-          next = replacement[i];
+          next = *ptr;
           if (next < CHAR_0 || next > CHAR_9) break;
           group = group * 10 + next - CHAR_0;
+
+          /* A check for a number greater than the hightest captured group
+          is sufficient here; no need for a separate overflow check. If unknown
+          groups are to be treated as unset, just skip over any remaining
+          digits and carry on. */
+
+          if (group > code->top_bracket)
+            {
+            if ((suboptions & PCRE2_SUBSTITUTE_UNKNOWN_UNSET) != 0)
+              {
+              while (++ptr < repend && *ptr >= CHAR_0 && *ptr <= CHAR_9);
+              break;
+              }
+            else
+              {
+              rc = PCRE2_ERROR_NOSUBSTRING;
+              goto PTREXIT;
+              }
+            }
           }
         }
       else
@@ -240,43 +484,312 @@ do
           {
           name[n++] = next;
           if (n > 32) goto BAD;
-          if (i == rlength) break;
-          next = replacement[++i];
+          if (++ptr >= repend) break;
+          next = *ptr;
           }
         if (n == 0) goto BAD;
         name[n] = 0;
         }
 
+      /* In extended mode we recognize ${name:+set text:unset text} and
+      ${name:-default text}. */
+
       if (inparens)
         {
-        if (i == rlength || next != CHAR_RIGHT_CURLY_BRACKET) goto BAD;
+        if ((suboptions & PCRE2_SUBSTITUTE_EXTENDED) != 0 &&
+             !star && ptr < repend - 2 && next == CHAR_COLON)
+          {
+          special = *(++ptr);
+          if (special != CHAR_PLUS && special != CHAR_MINUS)
+            {
+            rc = PCRE2_ERROR_BADSUBSTITUTION;
+            goto PTREXIT;
+            }
+
+          text1_start = ++ptr;
+          rc = find_text_end(code, &ptr, repend, special == CHAR_MINUS);
+          if (rc != 0) goto PTREXIT;
+          text1_end = ptr;
+
+          if (special == CHAR_PLUS && *ptr == CHAR_COLON)
+            {
+            text2_start = ++ptr;
+            rc = find_text_end(code, &ptr, repend, TRUE);
+            if (rc != 0) goto PTREXIT;
+            text2_end = ptr;
+            }
+          }
+
+        else
+          {
+          if (ptr >= repend || *ptr != CHAR_RIGHT_CURLY_BRACKET)
+            {
+            rc = PCRE2_ERROR_REPMISSINGBRACE;
+            goto PTREXIT;
+            }
+          }
+
+        ptr++;
         }
-      else i--;   /* Last code unit of name/number */
 
-      /* Have found a syntactically correct group number or name. */
+      /* Have found a syntactically correct group number or name, or *name.
+      Only *MARK is currently recognized. */
+
+      if (star)
+        {
+        if (PRIV(strcmp_c8)(name, STRING_MARK) == 0)
+          {
+          PCRE2_SPTR mark = pcre2_get_mark(match_data);
+          if (mark != NULL)
+            {
+            PCRE2_SPTR mark_start = mark;
+            while (*mark != 0) mark++;
+            fraglength = mark - mark_start;
+            CHECKMEMCPY(mark_start, fraglength);
+            }
+          }
+        else goto BAD;
+        }
+
+      /* Substitute the contents of a group. We don't use substring_copy
+      functions any more, in order to support case forcing. */
 
-      sublength = lengthleft;
-      if (group < 0)
-        rc = pcre2_substring_copy_byname(match_data, name,
-          buffer + buff_offset, &sublength);
       else
-        rc = pcre2_substring_copy_bynumber(match_data, group,
-          buffer + buff_offset, &sublength);
+        {
+        PCRE2_SPTR subptr, subptrend;
+
+        /* Find a number for a named group. In case there are duplicate names,
+        search for the first one that is set. If the name is not found when
+        PCRE2_SUBSTITUTE_UNKNOWN_EMPTY is set, set the group number to a
+        non-existent group. */
+
+        if (group < 0)
+          {
+          PCRE2_SPTR first, last, entry;
+          rc = pcre2_substring_nametable_scan(code, name, &first, &last);
+          if (rc == PCRE2_ERROR_NOSUBSTRING &&
+              (suboptions & PCRE2_SUBSTITUTE_UNKNOWN_UNSET) != 0)
+            {
+            group = code->top_bracket + 1;
+            }
+          else
+            {
+            if (rc < 0) goto PTREXIT;
+            for (entry = first; entry <= last; entry += rc)
+              {
+              uint32_t ng = GET2(entry, 0);
+              if (ng < ovector_count)
+                {
+                if (group < 0) group = ng;          /* First in ovector */
+                if (ovector[ng*2] != PCRE2_UNSET)
+                  {
+                  group = ng;                       /* First that is set */
+                  break;
+                  }
+                }
+              }
+
+            /* If group is still negative, it means we did not find a group
+            that is in the ovector. Just set the first group. */
+
+            if (group < 0) group = GET2(first, 0);
+            }
+          }
+
+        /* We now have a group that is identified by number. Find the length of
+        the captured string. If a group in a non-special substitution is unset
+        when PCRE2_SUBSTITUTE_UNSET_EMPTY is set, substitute nothing. */
+
+        rc = pcre2_substring_length_bynumber(match_data, group, &sublength);
+        if (rc < 0)
+          {
+          if (rc == PCRE2_ERROR_NOSUBSTRING &&
+              (suboptions & PCRE2_SUBSTITUTE_UNKNOWN_UNSET) != 0)
+            {
+            rc = PCRE2_ERROR_UNSET;
+            }
+          if (rc != PCRE2_ERROR_UNSET) goto PTREXIT;  /* Non-unset errors */
+          if (special == 0)                           /* Plain substitution */
+            {
+            if ((suboptions & PCRE2_SUBSTITUTE_UNSET_EMPTY) != 0) continue;
+            goto PTREXIT;                             /* Else error */
+            }
+          }
+
+        /* If special is '+' we have a 'set' and possibly an 'unset' text,
+        both of which are reprocessed when used. If special is '-' we have a
+        default text for when the group is unset; it must be reprocessed. */
+
+        if (special != 0)
+          {
+          if (special == CHAR_MINUS)
+            {
+            if (rc == 0) goto LITERAL_SUBSTITUTE;
+            text2_start = text1_start;
+            text2_end = text1_end;
+            }
+
+          if (ptrstackptr >= PTR_STACK_SIZE) goto BAD;
+          ptrstack[ptrstackptr++] = ptr;
+          ptrstack[ptrstackptr++] = repend;
+
+          if (rc == 0)
+            {
+            ptr = text1_start;
+            repend = text1_end;
+            }
+          else
+            {
+            ptr = text2_start;
+            repend = text2_end;
+            }
+          continue;
+          }
+
+        /* Otherwise we have a literal substitution of a group's contents. */
+
+        LITERAL_SUBSTITUTE:
+        subptr = subject + ovector[group*2];
+        subptrend = subject + ovector[group*2 + 1];
+
+        /* Substitute a literal string, possibly forcing alphabetic case. */
+
+        while (subptr < subptrend)
+          {
+          GETCHARINCTEST(ch, subptr);
+          if (forcecase != 0)
+            {
+#ifdef SUPPORT_UNICODE
+            if (utf)
+              {
+              uint32_t type = UCD_CHARTYPE(ch);
+              if (PRIV(ucp_gentype)[type] == ucp_L &&
+                  type != ((forcecase > 0)? ucp_Lu : ucp_Ll))
+                ch = UCD_OTHERCASE(ch);
+              }
+            else
+#endif
+              {
+              if (((code->tables + cbits_offset +
+                  ((forcecase > 0)? cbit_upper:cbit_lower)
+                  )[ch/8] & (1 << (ch%8))) == 0)
+                ch = (code->tables + fcc_offset)[ch];
+              }
+            forcecase = forcecasereset;
+            }
 
-      if (rc < 0) goto EXIT;
-      buff_offset += sublength;
-      lengthleft -= sublength;
+#ifdef SUPPORT_UNICODE
+          if (utf) chlen = PRIV(ord2utf)(ch, temp); else
+#endif
+            {
+            temp[0] = ch;
+            chlen = 1;
+            }
+          CHECKMEMCPY(temp, chlen);
+          }
+        }
       }
 
-   /* Handle a literal code unit */
+    /* Handle an escape sequence in extended mode. We can use check_escape()
+    to process \Q, \E, \c, \o, \x and \ followed by non-alphanumerics, but
+    the case-forcing escapes are not supported in pcre2_compile() so must be
+    recognized here. */
 
-   else
+    else if ((suboptions & PCRE2_SUBSTITUTE_EXTENDED) != 0 &&
+              *ptr == CHAR_BACKSLASH)
       {
-      LITERAL:
-      if (lengthleft-- < 1) goto NOROOM;
-      buffer[buff_offset++] = replacement[i];
+      int errorcode = 0;
+
+      if (ptr < repend - 1) switch (ptr[1])
+        {
+        case CHAR_L:
+        forcecase = forcecasereset = -1;
+        ptr += 2;
+        continue;
+
+        case CHAR_l:
+        forcecase = -1;
+        forcecasereset = 0;
+        ptr += 2;
+        continue;
+
+        case CHAR_U:
+        forcecase = forcecasereset = 1;
+        ptr += 2;
+        continue;
+
+        case CHAR_u:
+        forcecase = 1;
+        forcecasereset = 0;
+        ptr += 2;
+        continue;
+
+        default:
+        break;
+        }
+
+      rc = PRIV(check_escape)(&ptr, repend, &ch, &errorcode,
+        code->overall_options, FALSE, NULL);
+      if (errorcode != 0) goto BADESCAPE;
+      ptr++;
+
+      switch(rc)
+        {
+        case ESC_E:
+        forcecase = forcecasereset = 0;
+        continue;
+
+        case ESC_Q:
+        literal = TRUE;
+        continue;
+
+        case 0:      /* Data character */
+        goto LITERAL;
+
+        default:
+        goto BADESCAPE;
+        }
       }
-    }
+
+    /* Handle a literal code unit */
+
+    else
+      {
+      LOADLITERAL:
+      GETCHARINCTEST(ch, ptr);    /* Get character value, increment pointer */
+
+      LITERAL:
+      if (forcecase != 0)
+        {
+#ifdef SUPPORT_UNICODE
+        if (utf)
+          {
+          uint32_t type = UCD_CHARTYPE(ch);
+          if (PRIV(ucp_gentype)[type] == ucp_L &&
+              type != ((forcecase > 0)? ucp_Lu : ucp_Ll))
+            ch = UCD_OTHERCASE(ch);
+          }
+        else
+#endif
+          {
+          if (((code->tables + cbits_offset +
+              ((forcecase > 0)? cbit_upper:cbit_lower)
+              )[ch/8] & (1 << (ch%8))) == 0)
+            ch = (code->tables + fcc_offset)[ch];
+          }
+        forcecase = forcecasereset;
+        }
+
+#ifdef SUPPORT_UNICODE
+      if (utf) chlen = PRIV(ord2utf)(ch, temp); else
+#endif
+        {
+        temp[0] = ch;
+        chlen = 1;
+        }
+      CHECKMEMCPY(temp, chlen);
+      } /* End handling a literal code unit */
+    }   /* End of loop for scanning the replacement. */
 
   /* The replacement has been copied to the output. Update the start offset to
   point to the rest of the subject string. If we matched an empty string,
@@ -285,18 +798,33 @@ do
   start_offset = ovector[1];
   goptions = (ovector[0] != ovector[1])? 0 :
     PCRE2_ANCHORED|PCRE2_NOTEMPTY_ATSTART;
-  } while (global);  /* Repeat "do" loop */
+  } while ((suboptions & PCRE2_SUBSTITUTE_GLOBAL) != 0);  /* Repeat "do" loop */
 
-/* Copy the rest of the subject and return the number of substitutions. */
+/* Copy the rest of the subject. */
 
-rc = subs;
 fraglength = length - start_offset;
-if (fraglength + 1 > lengthleft) goto NOROOM;
-memcpy(buffer + buff_offset, subject + start_offset,
-  fraglength*(PCRE2_CODE_UNIT_WIDTH/8));
-buff_offset += fraglength;
-buffer[buff_offset] = 0;
-*blength = buff_offset;
+CHECKMEMCPY(subject + start_offset, fraglength);
+temp[0] = 0;
+CHECKMEMCPY(temp , 1);
+
+/* If overflowed is set it means the PCRE2_SUBSTITUTE_OVERFLOW_LENGTH is set,
+and matching has carried on after a full buffer, in order to compute the length
+needed. Otherwise, an overflow generates an immediate error return. */
+
+if (overflowed)
+  {
+  rc = PCRE2_ERROR_NOMEMORY;
+  *blength = buff_length + extra_needed;
+  }
+
+/* After a successful execution, return the number of substitutions and set the
+length of buffer used, excluding the trailing zero. */
+
+else
+  {
+  rc = subs;
+  *blength = buff_offset - 1;
+  }
 
 EXIT:
 if (match_data_created) pcre2_match_data_free(match_data);
@@ -309,6 +837,13 @@ goto EXIT;
 
 BAD:
 rc = PCRE2_ERROR_BADREPLACEMENT;
+goto PTREXIT;
+
+BADESCAPE:
+rc = PCRE2_ERROR_BADREPESCAPE;
+
+PTREXIT:
+*blength = (PCRE2_SIZE)(ptr - replacement);
 goto EXIT;
 }
 
index eb72ad7d0fbcd78b4918955ed6d5534e8158c108..58b504d5ce08a0e7b3feeb18ad3ffd11e9a0146c 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
index 17e4537d4ec2e24c00c61d0caef019c4ae7d043d..b945ed7a7f98f582c54add08ed24e89c0f032f6f 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -227,6 +227,8 @@ version. Like all other character and string literals that are compared against
 the regular expression pattern, we must use STR_ macros instead of literal
 strings to make sure that UTF-8 support works on EBCDIC platforms. */
 
+#define STRING_Ahom0 STR_A STR_h STR_o STR_m "\0"
+#define STRING_Anatolian_Hieroglyphs0 STR_A STR_n STR_a STR_t STR_o STR_l STR_i STR_a STR_n STR_UNDERSCORE STR_H STR_i STR_e STR_r STR_o STR_g STR_l STR_y STR_p STR_h STR_s "\0"
 #define STRING_Any0 STR_A STR_n STR_y "\0"
 #define STRING_Arabic0 STR_A STR_r STR_a STR_b STR_i STR_c "\0"
 #define STRING_Armenian0 STR_A STR_r STR_m STR_e STR_n STR_i STR_a STR_n "\0"
@@ -274,6 +276,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
 #define STRING_Han0 STR_H STR_a STR_n "\0"
 #define STRING_Hangul0 STR_H STR_a STR_n STR_g STR_u STR_l "\0"
 #define STRING_Hanunoo0 STR_H STR_a STR_n STR_u STR_n STR_o STR_o "\0"
+#define STRING_Hatran0 STR_H STR_a STR_t STR_r STR_a STR_n "\0"
 #define STRING_Hebrew0 STR_H STR_e STR_b STR_r STR_e STR_w "\0"
 #define STRING_Hiragana0 STR_H STR_i STR_r STR_a STR_g STR_a STR_n STR_a "\0"
 #define STRING_Imperial_Aramaic0 STR_I STR_m STR_p STR_e STR_r STR_i STR_a STR_l STR_UNDERSCORE STR_A STR_r STR_a STR_m STR_a STR_i STR_c "\0"
@@ -321,6 +324,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
 #define STRING_Modi0 STR_M STR_o STR_d STR_i "\0"
 #define STRING_Mongolian0 STR_M STR_o STR_n STR_g STR_o STR_l STR_i STR_a STR_n "\0"
 #define STRING_Mro0 STR_M STR_r STR_o "\0"
+#define STRING_Multani0 STR_M STR_u STR_l STR_t STR_a STR_n STR_i "\0"
 #define STRING_Myanmar0 STR_M STR_y STR_a STR_n STR_m STR_a STR_r "\0"
 #define STRING_N0 STR_N "\0"
 #define STRING_Nabataean0 STR_N STR_a STR_b STR_a STR_t STR_a STR_e STR_a STR_n "\0"
@@ -331,6 +335,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
 #define STRING_No0 STR_N STR_o "\0"
 #define STRING_Ogham0 STR_O STR_g STR_h STR_a STR_m "\0"
 #define STRING_Ol_Chiki0 STR_O STR_l STR_UNDERSCORE STR_C STR_h STR_i STR_k STR_i "\0"
+#define STRING_Old_Hungarian0 STR_O STR_l STR_d STR_UNDERSCORE STR_H STR_u STR_n STR_g STR_a STR_r STR_i STR_a STR_n "\0"
 #define STRING_Old_Italic0 STR_O STR_l STR_d STR_UNDERSCORE STR_I STR_t STR_a STR_l STR_i STR_c "\0"
 #define STRING_Old_North_Arabian0 STR_O STR_l STR_d STR_UNDERSCORE STR_N STR_o STR_r STR_t STR_h STR_UNDERSCORE STR_A STR_r STR_a STR_b STR_i STR_a STR_n "\0"
 #define STRING_Old_Permic0 STR_O STR_l STR_d STR_UNDERSCORE STR_P STR_e STR_r STR_m STR_i STR_c "\0"
@@ -362,6 +367,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
 #define STRING_Sharada0 STR_S STR_h STR_a STR_r STR_a STR_d STR_a "\0"
 #define STRING_Shavian0 STR_S STR_h STR_a STR_v STR_i STR_a STR_n "\0"
 #define STRING_Siddham0 STR_S STR_i STR_d STR_d STR_h STR_a STR_m "\0"
+#define STRING_SignWriting0 STR_S STR_i STR_g STR_n STR_W STR_r STR_i STR_t STR_i STR_n STR_g "\0"
 #define STRING_Sinhala0 STR_S STR_i STR_n STR_h STR_a STR_l STR_a "\0"
 #define STRING_Sk0 STR_S STR_k "\0"
 #define STRING_Sm0 STR_S STR_m "\0"
@@ -398,6 +404,8 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
 #define STRING_Zs0 STR_Z STR_s "\0"
 
 const char PRIV(utt_names)[] =
+  STRING_Ahom0
+  STRING_Anatolian_Hieroglyphs0
   STRING_Any0
   STRING_Arabic0
   STRING_Armenian0
@@ -445,6 +453,7 @@ const char PRIV(utt_names)[] =
   STRING_Han0
   STRING_Hangul0
   STRING_Hanunoo0
+  STRING_Hatran0
   STRING_Hebrew0
   STRING_Hiragana0
   STRING_Imperial_Aramaic0
@@ -492,6 +501,7 @@ const char PRIV(utt_names)[] =
   STRING_Modi0
   STRING_Mongolian0
   STRING_Mro0
+  STRING_Multani0
   STRING_Myanmar0
   STRING_N0
   STRING_Nabataean0
@@ -502,6 +512,7 @@ const char PRIV(utt_names)[] =
   STRING_No0
   STRING_Ogham0
   STRING_Ol_Chiki0
+  STRING_Old_Hungarian0
   STRING_Old_Italic0
   STRING_Old_North_Arabian0
   STRING_Old_Permic0
@@ -533,6 +544,7 @@ const char PRIV(utt_names)[] =
   STRING_Sharada0
   STRING_Shavian0
   STRING_Siddham0
+  STRING_SignWriting0
   STRING_Sinhala0
   STRING_Sk0
   STRING_Sm0
@@ -569,175 +581,181 @@ const char PRIV(utt_names)[] =
   STRING_Zs0;
 
 const ucp_type_table PRIV(utt)[] = {
-  {   0, PT_ANY, 0 },
-  {   4, PT_SC, ucp_Arabic },
-  {  11, PT_SC, ucp_Armenian },
-  {  20, PT_SC, ucp_Avestan },
-  {  28, PT_SC, ucp_Balinese },
-  {  37, PT_SC, ucp_Bamum },
-  {  43, PT_SC, ucp_Bassa_Vah },
-  {  53, PT_SC, ucp_Batak },
-  {  59, PT_SC, ucp_Bengali },
-  {  67, PT_SC, ucp_Bopomofo },
-  {  76, PT_SC, ucp_Brahmi },
-  {  83, PT_SC, ucp_Braille },
-  {  91, PT_SC, ucp_Buginese },
-  { 100, PT_SC, ucp_Buhid },
-  { 106, PT_GC, ucp_C },
-  { 108, PT_SC, ucp_Canadian_Aboriginal },
-  { 128, PT_SC, ucp_Carian },
-  { 135, PT_SC, ucp_Caucasian_Albanian },
-  { 154, PT_PC, ucp_Cc },
-  { 157, PT_PC, ucp_Cf },
-  { 160, PT_SC, ucp_Chakma },
-  { 167, PT_SC, ucp_Cham },
-  { 172, PT_SC, ucp_Cherokee },
-  { 181, PT_PC, ucp_Cn },
-  { 184, PT_PC, ucp_Co },
-  { 187, PT_SC, ucp_Common },
-  { 194, PT_SC, ucp_Coptic },
-  { 201, PT_PC, ucp_Cs },
-  { 204, PT_SC, ucp_Cuneiform },
-  { 214, PT_SC, ucp_Cypriot },
-  { 222, PT_SC, ucp_Cyrillic },
-  { 231, PT_SC, ucp_Deseret },
-  { 239, PT_SC, ucp_Devanagari },
-  { 250, PT_SC, ucp_Duployan },
-  { 259, PT_SC, ucp_Egyptian_Hieroglyphs },
-  { 280, PT_SC, ucp_Elbasan },
-  { 288, PT_SC, ucp_Ethiopic },
-  { 297, PT_SC, ucp_Georgian },
-  { 306, PT_SC, ucp_Glagolitic },
-  { 317, PT_SC, ucp_Gothic },
-  { 324, PT_SC, ucp_Grantha },
-  { 332, PT_SC, ucp_Greek },
-  { 338, PT_SC, ucp_Gujarati },
-  { 347, PT_SC, ucp_Gurmukhi },
-  { 356, PT_SC, ucp_Han },
-  { 360, PT_SC, ucp_Hangul },
-  { 367, PT_SC, ucp_Hanunoo },
-  { 375, PT_SC, ucp_Hebrew },
-  { 382, PT_SC, ucp_Hiragana },
-  { 391, PT_SC, ucp_Imperial_Aramaic },
-  { 408, PT_SC, ucp_Inherited },
-  { 418, PT_SC, ucp_Inscriptional_Pahlavi },
-  { 440, PT_SC, ucp_Inscriptional_Parthian },
-  { 463, PT_SC, ucp_Javanese },
-  { 472, PT_SC, ucp_Kaithi },
-  { 479, PT_SC, ucp_Kannada },
-  { 487, PT_SC, ucp_Katakana },
-  { 496, PT_SC, ucp_Kayah_Li },
-  { 505, PT_SC, ucp_Kharoshthi },
-  { 516, PT_SC, ucp_Khmer },
-  { 522, PT_SC, ucp_Khojki },
-  { 529, PT_SC, ucp_Khudawadi },
-  { 539, PT_GC, ucp_L },
-  { 541, PT_LAMP, 0 },
-  { 544, PT_SC, ucp_Lao },
-  { 548, PT_SC, ucp_Latin },
-  { 554, PT_SC, ucp_Lepcha },
-  { 561, PT_SC, ucp_Limbu },
-  { 567, PT_SC, ucp_Linear_A },
-  { 576, PT_SC, ucp_Linear_B },
-  { 585, PT_SC, ucp_Lisu },
-  { 590, PT_PC, ucp_Ll },
-  { 593, PT_PC, ucp_Lm },
-  { 596, PT_PC, ucp_Lo },
-  { 599, PT_PC, ucp_Lt },
-  { 602, PT_PC, ucp_Lu },
-  { 605, PT_SC, ucp_Lycian },
-  { 612, PT_SC, ucp_Lydian },
-  { 619, PT_GC, ucp_M },
-  { 621, PT_SC, ucp_Mahajani },
-  { 630, PT_SC, ucp_Malayalam },
-  { 640, PT_SC, ucp_Mandaic },
-  { 648, PT_SC, ucp_Manichaean },
-  { 659, PT_PC, ucp_Mc },
-  { 662, PT_PC, ucp_Me },
-  { 665, PT_SC, ucp_Meetei_Mayek },
-  { 678, PT_SC, ucp_Mende_Kikakui },
-  { 692, PT_SC, ucp_Meroitic_Cursive },
-  { 709, PT_SC, ucp_Meroitic_Hieroglyphs },
-  { 730, PT_SC, ucp_Miao },
-  { 735, PT_PC, ucp_Mn },
-  { 738, PT_SC, ucp_Modi },
-  { 743, PT_SC, ucp_Mongolian },
-  { 753, PT_SC, ucp_Mro },
-  { 757, PT_SC, ucp_Myanmar },
-  { 765, PT_GC, ucp_N },
-  { 767, PT_SC, ucp_Nabataean },
-  { 777, PT_PC, ucp_Nd },
-  { 780, PT_SC, ucp_New_Tai_Lue },
-  { 792, PT_SC, ucp_Nko },
-  { 796, PT_PC, ucp_Nl },
-  { 799, PT_PC, ucp_No },
-  { 802, PT_SC, ucp_Ogham },
-  { 808, PT_SC, ucp_Ol_Chiki },
-  { 817, PT_SC, ucp_Old_Italic },
-  { 828, PT_SC, ucp_Old_North_Arabian },
-  { 846, PT_SC, ucp_Old_Permic },
-  { 857, PT_SC, ucp_Old_Persian },
-  { 869, PT_SC, ucp_Old_South_Arabian },
-  { 887, PT_SC, ucp_Old_Turkic },
-  { 898, PT_SC, ucp_Oriya },
-  { 904, PT_SC, ucp_Osmanya },
-  { 912, PT_GC, ucp_P },
-  { 914, PT_SC, ucp_Pahawh_Hmong },
-  { 927, PT_SC, ucp_Palmyrene },
-  { 937, PT_SC, ucp_Pau_Cin_Hau },
-  { 949, PT_PC, ucp_Pc },
-  { 952, PT_PC, ucp_Pd },
-  { 955, PT_PC, ucp_Pe },
-  { 958, PT_PC, ucp_Pf },
-  { 961, PT_SC, ucp_Phags_Pa },
-  { 970, PT_SC, ucp_Phoenician },
-  { 981, PT_PC, ucp_Pi },
-  { 984, PT_PC, ucp_Po },
-  { 987, PT_PC, ucp_Ps },
-  { 990, PT_SC, ucp_Psalter_Pahlavi },
-  { 1006, PT_SC, ucp_Rejang },
-  { 1013, PT_SC, ucp_Runic },
-  { 1019, PT_GC, ucp_S },
-  { 1021, PT_SC, ucp_Samaritan },
-  { 1031, PT_SC, ucp_Saurashtra },
-  { 1042, PT_PC, ucp_Sc },
-  { 1045, PT_SC, ucp_Sharada },
-  { 1053, PT_SC, ucp_Shavian },
-  { 1061, PT_SC, ucp_Siddham },
-  { 1069, PT_SC, ucp_Sinhala },
-  { 1077, PT_PC, ucp_Sk },
-  { 1080, PT_PC, ucp_Sm },
-  { 1083, PT_PC, ucp_So },
-  { 1086, PT_SC, ucp_Sora_Sompeng },
-  { 1099, PT_SC, ucp_Sundanese },
-  { 1109, PT_SC, ucp_Syloti_Nagri },
-  { 1122, PT_SC, ucp_Syriac },
-  { 1129, PT_SC, ucp_Tagalog },
-  { 1137, PT_SC, ucp_Tagbanwa },
-  { 1146, PT_SC, ucp_Tai_Le },
-  { 1153, PT_SC, ucp_Tai_Tham },
-  { 1162, PT_SC, ucp_Tai_Viet },
-  { 1171, PT_SC, ucp_Takri },
-  { 1177, PT_SC, ucp_Tamil },
-  { 1183, PT_SC, ucp_Telugu },
-  { 1190, PT_SC, ucp_Thaana },
-  { 1197, PT_SC, ucp_Thai },
-  { 1202, PT_SC, ucp_Tibetan },
-  { 1210, PT_SC, ucp_Tifinagh },
-  { 1219, PT_SC, ucp_Tirhuta },
-  { 1227, PT_SC, ucp_Ugaritic },
-  { 1236, PT_SC, ucp_Vai },
-  { 1240, PT_SC, ucp_Warang_Citi },
-  { 1252, PT_ALNUM, 0 },
-  { 1256, PT_PXSPACE, 0 },
-  { 1260, PT_SPACE, 0 },
-  { 1264, PT_UCNC, 0 },
-  { 1268, PT_WORD, 0 },
-  { 1272, PT_SC, ucp_Yi },
-  { 1275, PT_GC, ucp_Z },
-  { 1277, PT_PC, ucp_Zl },
-  { 1280, PT_PC, ucp_Zp },
-  { 1283, PT_PC, ucp_Zs }
+  {   0, PT_SC, ucp_Ahom },
+  {   5, PT_SC, ucp_Anatolian_Hieroglyphs },
+  {  27, PT_ANY, 0 },
+  {  31, PT_SC, ucp_Arabic },
+  {  38, PT_SC, ucp_Armenian },
+  {  47, PT_SC, ucp_Avestan },
+  {  55, PT_SC, ucp_Balinese },
+  {  64, PT_SC, ucp_Bamum },
+  {  70, PT_SC, ucp_Bassa_Vah },
+  {  80, PT_SC, ucp_Batak },
+  {  86, PT_SC, ucp_Bengali },
+  {  94, PT_SC, ucp_Bopomofo },
+  { 103, PT_SC, ucp_Brahmi },
+  { 110, PT_SC, ucp_Braille },
+  { 118, PT_SC, ucp_Buginese },
+  { 127, PT_SC, ucp_Buhid },
+  { 133, PT_GC, ucp_C },
+  { 135, PT_SC, ucp_Canadian_Aboriginal },
+  { 155, PT_SC, ucp_Carian },
+  { 162, PT_SC, ucp_Caucasian_Albanian },
+  { 181, PT_PC, ucp_Cc },
+  { 184, PT_PC, ucp_Cf },
+  { 187, PT_SC, ucp_Chakma },
+  { 194, PT_SC, ucp_Cham },
+  { 199, PT_SC, ucp_Cherokee },
+  { 208, PT_PC, ucp_Cn },
+  { 211, PT_PC, ucp_Co },
+  { 214, PT_SC, ucp_Common },
+  { 221, PT_SC, ucp_Coptic },
+  { 228, PT_PC, ucp_Cs },
+  { 231, PT_SC, ucp_Cuneiform },
+  { 241, PT_SC, ucp_Cypriot },
+  { 249, PT_SC, ucp_Cyrillic },
+  { 258, PT_SC, ucp_Deseret },
+  { 266, PT_SC, ucp_Devanagari },
+  { 277, PT_SC, ucp_Duployan },
+  { 286, PT_SC, ucp_Egyptian_Hieroglyphs },
+  { 307, PT_SC, ucp_Elbasan },
+  { 315, PT_SC, ucp_Ethiopic },
+  { 324, PT_SC, ucp_Georgian },
+  { 333, PT_SC, ucp_Glagolitic },
+  { 344, PT_SC, ucp_Gothic },
+  { 351, PT_SC, ucp_Grantha },
+  { 359, PT_SC, ucp_Greek },
+  { 365, PT_SC, ucp_Gujarati },
+  { 374, PT_SC, ucp_Gurmukhi },
+  { 383, PT_SC, ucp_Han },
+  { 387, PT_SC, ucp_Hangul },
+  { 394, PT_SC, ucp_Hanunoo },
+  { 402, PT_SC, ucp_Hatran },
+  { 409, PT_SC, ucp_Hebrew },
+  { 416, PT_SC, ucp_Hiragana },
+  { 425, PT_SC, ucp_Imperial_Aramaic },
+  { 442, PT_SC, ucp_Inherited },
+  { 452, PT_SC, ucp_Inscriptional_Pahlavi },
+  { 474, PT_SC, ucp_Inscriptional_Parthian },
+  { 497, PT_SC, ucp_Javanese },
+  { 506, PT_SC, ucp_Kaithi },
+  { 513, PT_SC, ucp_Kannada },
+  { 521, PT_SC, ucp_Katakana },
+  { 530, PT_SC, ucp_Kayah_Li },
+  { 539, PT_SC, ucp_Kharoshthi },
+  { 550, PT_SC, ucp_Khmer },
+  { 556, PT_SC, ucp_Khojki },
+  { 563, PT_SC, ucp_Khudawadi },
+  { 573, PT_GC, ucp_L },
+  { 575, PT_LAMP, 0 },
+  { 578, PT_SC, ucp_Lao },
+  { 582, PT_SC, ucp_Latin },
+  { 588, PT_SC, ucp_Lepcha },
+  { 595, PT_SC, ucp_Limbu },
+  { 601, PT_SC, ucp_Linear_A },
+  { 610, PT_SC, ucp_Linear_B },
+  { 619, PT_SC, ucp_Lisu },
+  { 624, PT_PC, ucp_Ll },
+  { 627, PT_PC, ucp_Lm },
+  { 630, PT_PC, ucp_Lo },
+  { 633, PT_PC, ucp_Lt },
+  { 636, PT_PC, ucp_Lu },
+  { 639, PT_SC, ucp_Lycian },
+  { 646, PT_SC, ucp_Lydian },
+  { 653, PT_GC, ucp_M },
+  { 655, PT_SC, ucp_Mahajani },
+  { 664, PT_SC, ucp_Malayalam },
+  { 674, PT_SC, ucp_Mandaic },
+  { 682, PT_SC, ucp_Manichaean },
+  { 693, PT_PC, ucp_Mc },
+  { 696, PT_PC, ucp_Me },
+  { 699, PT_SC, ucp_Meetei_Mayek },
+  { 712, PT_SC, ucp_Mende_Kikakui },
+  { 726, PT_SC, ucp_Meroitic_Cursive },
+  { 743, PT_SC, ucp_Meroitic_Hieroglyphs },
+  { 764, PT_SC, ucp_Miao },
+  { 769, PT_PC, ucp_Mn },
+  { 772, PT_SC, ucp_Modi },
+  { 777, PT_SC, ucp_Mongolian },
+  { 787, PT_SC, ucp_Mro },
+  { 791, PT_SC, ucp_Multani },
+  { 799, PT_SC, ucp_Myanmar },
+  { 807, PT_GC, ucp_N },
+  { 809, PT_SC, ucp_Nabataean },
+  { 819, PT_PC, ucp_Nd },
+  { 822, PT_SC, ucp_New_Tai_Lue },
+  { 834, PT_SC, ucp_Nko },
+  { 838, PT_PC, ucp_Nl },
+  { 841, PT_PC, ucp_No },
+  { 844, PT_SC, ucp_Ogham },
+  { 850, PT_SC, ucp_Ol_Chiki },
+  { 859, PT_SC, ucp_Old_Hungarian },
+  { 873, PT_SC, ucp_Old_Italic },
+  { 884, PT_SC, ucp_Old_North_Arabian },
+  { 902, PT_SC, ucp_Old_Permic },
+  { 913, PT_SC, ucp_Old_Persian },
+  { 925, PT_SC, ucp_Old_South_Arabian },
+  { 943, PT_SC, ucp_Old_Turkic },
+  { 954, PT_SC, ucp_Oriya },
+  { 960, PT_SC, ucp_Osmanya },
+  { 968, PT_GC, ucp_P },
+  { 970, PT_SC, ucp_Pahawh_Hmong },
+  { 983, PT_SC, ucp_Palmyrene },
+  { 993, PT_SC, ucp_Pau_Cin_Hau },
+  { 1005, PT_PC, ucp_Pc },
+  { 1008, PT_PC, ucp_Pd },
+  { 1011, PT_PC, ucp_Pe },
+  { 1014, PT_PC, ucp_Pf },
+  { 1017, PT_SC, ucp_Phags_Pa },
+  { 1026, PT_SC, ucp_Phoenician },
+  { 1037, PT_PC, ucp_Pi },
+  { 1040, PT_PC, ucp_Po },
+  { 1043, PT_PC, ucp_Ps },
+  { 1046, PT_SC, ucp_Psalter_Pahlavi },
+  { 1062, PT_SC, ucp_Rejang },
+  { 1069, PT_SC, ucp_Runic },
+  { 1075, PT_GC, ucp_S },
+  { 1077, PT_SC, ucp_Samaritan },
+  { 1087, PT_SC, ucp_Saurashtra },
+  { 1098, PT_PC, ucp_Sc },
+  { 1101, PT_SC, ucp_Sharada },
+  { 1109, PT_SC, ucp_Shavian },
+  { 1117, PT_SC, ucp_Siddham },
+  { 1125, PT_SC, ucp_SignWriting },
+  { 1137, PT_SC, ucp_Sinhala },
+  { 1145, PT_PC, ucp_Sk },
+  { 1148, PT_PC, ucp_Sm },
+  { 1151, PT_PC, ucp_So },
+  { 1154, PT_SC, ucp_Sora_Sompeng },
+  { 1167, PT_SC, ucp_Sundanese },
+  { 1177, PT_SC, ucp_Syloti_Nagri },
+  { 1190, PT_SC, ucp_Syriac },
+  { 1197, PT_SC, ucp_Tagalog },
+  { 1205, PT_SC, ucp_Tagbanwa },
+  { 1214, PT_SC, ucp_Tai_Le },
+  { 1221, PT_SC, ucp_Tai_Tham },
+  { 1230, PT_SC, ucp_Tai_Viet },
+  { 1239, PT_SC, ucp_Takri },
+  { 1245, PT_SC, ucp_Tamil },
+  { 1251, PT_SC, ucp_Telugu },
+  { 1258, PT_SC, ucp_Thaana },
+  { 1265, PT_SC, ucp_Thai },
+  { 1270, PT_SC, ucp_Tibetan },
+  { 1278, PT_SC, ucp_Tifinagh },
+  { 1287, PT_SC, ucp_Tirhuta },
+  { 1295, PT_SC, ucp_Ugaritic },
+  { 1304, PT_SC, ucp_Vai },
+  { 1308, PT_SC, ucp_Warang_Citi },
+  { 1320, PT_ALNUM, 0 },
+  { 1324, PT_PXSPACE, 0 },
+  { 1328, PT_SPACE, 0 },
+  { 1332, PT_UCNC, 0 },
+  { 1336, PT_WORD, 0 },
+  { 1340, PT_SC, ucp_Yi },
+  { 1343, PT_GC, ucp_Z },
+  { 1345, PT_PC, ucp_Zl },
+  { 1348, PT_PC, ucp_Zp },
+  { 1351, PT_PC, ucp_Zs }
 };
 
 const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table);
index 7199cbda783c74983e03675d5b797949ef98b6ec..116f537b387a10a000e9b48138379407410f687c 100644 (file)
@@ -20,7 +20,7 @@ needed. */
 
 /* Unicode character database. */
 /* This file was autogenerated by the MultiStage2.py script. */
-/* Total size: 72576 bytes, block size: 128. */
+/* Total size: 75072 bytes, block size: 128. */
 
 /* The tables herein are needed only when UCP support is built,
 and in PCRE2 that happens automatically with UTF support.
@@ -39,7 +39,7 @@ const uint16_t PRIV(ucd_stage2)[] = {0};
 const uint32_t PRIV(ucd_caseless_sets)[] = {0};
 #else
 
-const char *PRIV(unicode_version) = "7.0.0";
+const char *PRIV(unicode_version) = "8.0.0";
 
 /* When recompiling tables with a new Unicode version, please check the
 types in this structure definition from pcre2_internal.h (the actual
@@ -82,7 +82,7 @@ const uint32_t PRIV(ucd_caseless_sets)[] = {
 
 #ifndef PCRE2_PCRE2TEST
 
-const ucd_record PRIV(ucd_records)[] = { /* 5760 bytes, record size 8 */
+const ucd_record PRIV(ucd_records)[] = { /* 5952 bytes, record size 8 */
   {     9,      0,      2,      0,      0, }, /*   0 */
   {     9,      0,      1,      0,      0, }, /*   1 */
   {     9,      0,      0,      0,      0, }, /*   2 */
@@ -188,621 +188,645 @@ const ucd_record PRIV(ucd_records)[] = { /* 5760 bytes, record size 8 */
   {    33,      5,     12,      0,   -217, }, /* 102 */
   {    33,      5,     12,      0,    -71, }, /* 103 */
   {    33,      5,     12,      0,   -219, }, /* 104 */
-  {    33,      5,     12,      0,  42258, }, /* 105 */
-  {    33,      6,     12,      0,      0, }, /* 106 */
-  {     9,      6,     12,      0,      0, }, /* 107 */
-  {     3,     24,     12,      0,      0, }, /* 108 */
-  {    27,     12,      3,      0,      0, }, /* 109 */
-  {    27,     12,      3,     21,    116, }, /* 110 */
-  {    19,      9,     12,      0,      1, }, /* 111 */
-  {    19,      5,     12,      0,     -1, }, /* 112 */
-  {    19,     24,     12,      0,      0, }, /* 113 */
-  {     9,      2,     12,      0,      0, }, /* 114 */
-  {    19,      6,     12,      0,      0, }, /* 115 */
-  {    19,      5,     12,      0,    130, }, /* 116 */
-  {    19,      9,     12,      0,    116, }, /* 117 */
-  {    19,      9,     12,      0,     38, }, /* 118 */
-  {    19,      9,     12,      0,     37, }, /* 119 */
-  {    19,      9,     12,      0,     64, }, /* 120 */
-  {    19,      9,     12,      0,     63, }, /* 121 */
-  {    19,      5,     12,      0,      0, }, /* 122 */
-  {    19,      9,     12,      0,     32, }, /* 123 */
-  {    19,      9,     12,     34,     32, }, /* 124 */
-  {    19,      9,     12,     59,     32, }, /* 125 */
-  {    19,      9,     12,     38,     32, }, /* 126 */
-  {    19,      9,     12,     21,     32, }, /* 127 */
-  {    19,      9,     12,     51,     32, }, /* 128 */
-  {    19,      9,     12,     26,     32, }, /* 129 */
-  {    19,      9,     12,     47,     32, }, /* 130 */
-  {    19,      9,     12,     55,     32, }, /* 131 */
-  {    19,      9,     12,     30,     32, }, /* 132 */
-  {    19,      9,     12,     43,     32, }, /* 133 */
-  {    19,      9,     12,     67,     32, }, /* 134 */
-  {    19,      5,     12,      0,    -38, }, /* 135 */
-  {    19,      5,     12,      0,    -37, }, /* 136 */
-  {    19,      5,     12,      0,    -32, }, /* 137 */
-  {    19,      5,     12,     34,    -32, }, /* 138 */
-  {    19,      5,     12,     59,    -32, }, /* 139 */
-  {    19,      5,     12,     38,    -32, }, /* 140 */
-  {    19,      5,     12,     21,   -116, }, /* 141 */
-  {    19,      5,     12,     51,    -32, }, /* 142 */
-  {    19,      5,     12,     26,   -775, }, /* 143 */
-  {    19,      5,     12,     47,    -32, }, /* 144 */
-  {    19,      5,     12,     55,    -32, }, /* 145 */
-  {    19,      5,     12,     30,      1, }, /* 146 */
-  {    19,      5,     12,     30,    -32, }, /* 147 */
-  {    19,      5,     12,     43,    -32, }, /* 148 */
-  {    19,      5,     12,     67,    -32, }, /* 149 */
-  {    19,      5,     12,      0,    -64, }, /* 150 */
-  {    19,      5,     12,      0,    -63, }, /* 151 */
-  {    19,      9,     12,      0,      8, }, /* 152 */
-  {    19,      5,     12,     34,    -30, }, /* 153 */
-  {    19,      5,     12,     38,    -25, }, /* 154 */
-  {    19,      9,     12,      0,      0, }, /* 155 */
-  {    19,      5,     12,     43,    -15, }, /* 156 */
-  {    19,      5,     12,     47,    -22, }, /* 157 */
-  {    19,      5,     12,      0,     -8, }, /* 158 */
-  {    10,      9,     12,      0,      1, }, /* 159 */
-  {    10,      5,     12,      0,     -1, }, /* 160 */
-  {    19,      5,     12,     51,    -54, }, /* 161 */
-  {    19,      5,     12,     55,    -48, }, /* 162 */
-  {    19,      5,     12,      0,      7, }, /* 163 */
-  {    19,      5,     12,      0,   -116, }, /* 164 */
-  {    19,      9,     12,     38,    -60, }, /* 165 */
-  {    19,      5,     12,     59,    -64, }, /* 166 */
-  {    19,     25,     12,      0,      0, }, /* 167 */
-  {    19,      9,     12,      0,     -7, }, /* 168 */
-  {    19,      9,     12,      0,   -130, }, /* 169 */
-  {    12,      9,     12,      0,     80, }, /* 170 */
-  {    12,      9,     12,      0,     32, }, /* 171 */
-  {    12,      5,     12,      0,    -32, }, /* 172 */
-  {    12,      5,     12,      0,    -80, }, /* 173 */
-  {    12,      9,     12,      0,      1, }, /* 174 */
-  {    12,      5,     12,      0,     -1, }, /* 175 */
-  {    12,     26,     12,      0,      0, }, /* 176 */
-  {    12,     12,      3,      0,      0, }, /* 177 */
-  {    12,     11,      3,      0,      0, }, /* 178 */
-  {    12,      9,     12,      0,     15, }, /* 179 */
-  {    12,      5,     12,      0,    -15, }, /* 180 */
-  {     1,      9,     12,      0,     48, }, /* 181 */
-  {     1,      6,     12,      0,      0, }, /* 182 */
-  {     1,     21,     12,      0,      0, }, /* 183 */
-  {     1,      5,     12,      0,    -48, }, /* 184 */
-  {     1,      5,     12,      0,      0, }, /* 185 */
-  {     1,     17,     12,      0,      0, }, /* 186 */
-  {     1,     26,     12,      0,      0, }, /* 187 */
-  {     1,     23,     12,      0,      0, }, /* 188 */
-  {    25,     12,      3,      0,      0, }, /* 189 */
-  {    25,     17,     12,      0,      0, }, /* 190 */
-  {    25,     21,     12,      0,      0, }, /* 191 */
-  {    25,      7,     12,      0,      0, }, /* 192 */
-  {     0,      1,      2,      0,      0, }, /* 193 */
-  {     0,     25,     12,      0,      0, }, /* 194 */
-  {     0,     21,     12,      0,      0, }, /* 195 */
-  {     0,     23,     12,      0,      0, }, /* 196 */
-  {     0,     26,     12,      0,      0, }, /* 197 */
-  {     0,     12,      3,      0,      0, }, /* 198 */
-  {     0,      7,     12,      0,      0, }, /* 199 */
-  {     0,      6,     12,      0,      0, }, /* 200 */
+  {    33,      5,     12,      0,  42261, }, /* 105 */
+  {    33,      5,     12,      0,  42258, }, /* 106 */
+  {    33,      6,     12,      0,      0, }, /* 107 */
+  {     9,      6,     12,      0,      0, }, /* 108 */
+  {     3,     24,     12,      0,      0, }, /* 109 */
+  {    27,     12,      3,      0,      0, }, /* 110 */
+  {    27,     12,      3,     21,    116, }, /* 111 */
+  {    19,      9,     12,      0,      1, }, /* 112 */
+  {    19,      5,     12,      0,     -1, }, /* 113 */
+  {    19,     24,     12,      0,      0, }, /* 114 */
+  {     9,      2,     12,      0,      0, }, /* 115 */
+  {    19,      6,     12,      0,      0, }, /* 116 */
+  {    19,      5,     12,      0,    130, }, /* 117 */
+  {    19,      9,     12,      0,    116, }, /* 118 */
+  {    19,      9,     12,      0,     38, }, /* 119 */
+  {    19,      9,     12,      0,     37, }, /* 120 */
+  {    19,      9,     12,      0,     64, }, /* 121 */
+  {    19,      9,     12,      0,     63, }, /* 122 */
+  {    19,      5,     12,      0,      0, }, /* 123 */
+  {    19,      9,     12,      0,     32, }, /* 124 */
+  {    19,      9,     12,     34,     32, }, /* 125 */
+  {    19,      9,     12,     59,     32, }, /* 126 */
+  {    19,      9,     12,     38,     32, }, /* 127 */
+  {    19,      9,     12,     21,     32, }, /* 128 */
+  {    19,      9,     12,     51,     32, }, /* 129 */
+  {    19,      9,     12,     26,     32, }, /* 130 */
+  {    19,      9,     12,     47,     32, }, /* 131 */
+  {    19,      9,     12,     55,     32, }, /* 132 */
+  {    19,      9,     12,     30,     32, }, /* 133 */
+  {    19,      9,     12,     43,     32, }, /* 134 */
+  {    19,      9,     12,     67,     32, }, /* 135 */
+  {    19,      5,     12,      0,    -38, }, /* 136 */
+  {    19,      5,     12,      0,    -37, }, /* 137 */
+  {    19,      5,     12,      0,    -32, }, /* 138 */
+  {    19,      5,     12,     34,    -32, }, /* 139 */
+  {    19,      5,     12,     59,    -32, }, /* 140 */
+  {    19,      5,     12,     38,    -32, }, /* 141 */
+  {    19,      5,     12,     21,   -116, }, /* 142 */
+  {    19,      5,     12,     51,    -32, }, /* 143 */
+  {    19,      5,     12,     26,   -775, }, /* 144 */
+  {    19,      5,     12,     47,    -32, }, /* 145 */
+  {    19,      5,     12,     55,    -32, }, /* 146 */
+  {    19,      5,     12,     30,      1, }, /* 147 */
+  {    19,      5,     12,     30,    -32, }, /* 148 */
+  {    19,      5,     12,     43,    -32, }, /* 149 */
+  {    19,      5,     12,     67,    -32, }, /* 150 */
+  {    19,      5,     12,      0,    -64, }, /* 151 */
+  {    19,      5,     12,      0,    -63, }, /* 152 */
+  {    19,      9,     12,      0,      8, }, /* 153 */
+  {    19,      5,     12,     34,    -30, }, /* 154 */
+  {    19,      5,     12,     38,    -25, }, /* 155 */
+  {    19,      9,     12,      0,      0, }, /* 156 */
+  {    19,      5,     12,     43,    -15, }, /* 157 */
+  {    19,      5,     12,     47,    -22, }, /* 158 */
+  {    19,      5,     12,      0,     -8, }, /* 159 */
+  {    10,      9,     12,      0,      1, }, /* 160 */
+  {    10,      5,     12,      0,     -1, }, /* 161 */
+  {    19,      5,     12,     51,    -54, }, /* 162 */
+  {    19,      5,     12,     55,    -48, }, /* 163 */
+  {    19,      5,     12,      0,      7, }, /* 164 */
+  {    19,      5,     12,      0,   -116, }, /* 165 */
+  {    19,      9,     12,     38,    -60, }, /* 166 */
+  {    19,      5,     12,     59,    -64, }, /* 167 */
+  {    19,     25,     12,      0,      0, }, /* 168 */
+  {    19,      9,     12,      0,     -7, }, /* 169 */
+  {    19,      9,     12,      0,   -130, }, /* 170 */
+  {    12,      9,     12,      0,     80, }, /* 171 */
+  {    12,      9,     12,      0,     32, }, /* 172 */
+  {    12,      5,     12,      0,    -32, }, /* 173 */
+  {    12,      5,     12,      0,    -80, }, /* 174 */
+  {    12,      9,     12,      0,      1, }, /* 175 */
+  {    12,      5,     12,      0,     -1, }, /* 176 */
+  {    12,     26,     12,      0,      0, }, /* 177 */
+  {    12,     12,      3,      0,      0, }, /* 178 */
+  {    12,     11,      3,      0,      0, }, /* 179 */
+  {    12,      9,     12,      0,     15, }, /* 180 */
+  {    12,      5,     12,      0,    -15, }, /* 181 */
+  {     1,      9,     12,      0,     48, }, /* 182 */
+  {     1,      6,     12,      0,      0, }, /* 183 */
+  {     1,     21,     12,      0,      0, }, /* 184 */
+  {     1,      5,     12,      0,    -48, }, /* 185 */
+  {     1,      5,     12,      0,      0, }, /* 186 */
+  {     1,     17,     12,      0,      0, }, /* 187 */
+  {     1,     26,     12,      0,      0, }, /* 188 */
+  {     1,     23,     12,      0,      0, }, /* 189 */
+  {    25,     12,      3,      0,      0, }, /* 190 */
+  {    25,     17,     12,      0,      0, }, /* 191 */
+  {    25,     21,     12,      0,      0, }, /* 192 */
+  {    25,      7,     12,      0,      0, }, /* 193 */
+  {     0,      1,      2,      0,      0, }, /* 194 */
+  {     0,     25,     12,      0,      0, }, /* 195 */
+  {     0,     21,     12,      0,      0, }, /* 196 */
+  {     0,     23,     12,      0,      0, }, /* 197 */
+  {     0,     26,     12,      0,      0, }, /* 198 */
+  {     0,     12,      3,      0,      0, }, /* 199 */
+  {     0,      7,     12,      0,      0, }, /* 200 */
   {     0,     13,     12,      0,      0, }, /* 201 */
-  {    49,     21,     12,      0,      0, }, /* 202 */
-  {    49,      1,      2,      0,      0, }, /* 203 */
-  {    49,      7,     12,      0,      0, }, /* 204 */
-  {    49,     12,      3,      0,      0, }, /* 205 */
-  {    55,      7,     12,      0,      0, }, /* 206 */
-  {    55,     12,      3,      0,      0, }, /* 207 */
-  {    63,     13,     12,      0,      0, }, /* 208 */
-  {    63,      7,     12,      0,      0, }, /* 209 */
-  {    63,     12,      3,      0,      0, }, /* 210 */
-  {    63,      6,     12,      0,      0, }, /* 211 */
-  {    63,     26,     12,      0,      0, }, /* 212 */
-  {    63,     21,     12,      0,      0, }, /* 213 */
-  {    89,      7,     12,      0,      0, }, /* 214 */
-  {    89,     12,      3,      0,      0, }, /* 215 */
-  {    89,      6,     12,      0,      0, }, /* 216 */
-  {    89,     21,     12,      0,      0, }, /* 217 */
-  {    94,      7,     12,      0,      0, }, /* 218 */
-  {    94,     12,      3,      0,      0, }, /* 219 */
-  {    94,     21,     12,      0,      0, }, /* 220 */
-  {    14,     12,      3,      0,      0, }, /* 221 */
-  {    14,     10,      5,      0,      0, }, /* 222 */
-  {    14,      7,     12,      0,      0, }, /* 223 */
-  {    14,     13,     12,      0,      0, }, /* 224 */
-  {    14,     21,     12,      0,      0, }, /* 225 */
-  {    14,      6,     12,      0,      0, }, /* 226 */
-  {     2,      7,     12,      0,      0, }, /* 227 */
-  {     2,     12,      3,      0,      0, }, /* 228 */
-  {     2,     10,      5,      0,      0, }, /* 229 */
-  {     2,     10,      3,      0,      0, }, /* 230 */
-  {     2,     13,     12,      0,      0, }, /* 231 */
-  {     2,     23,     12,      0,      0, }, /* 232 */
-  {     2,     15,     12,      0,      0, }, /* 233 */
-  {     2,     26,     12,      0,      0, }, /* 234 */
-  {    21,     12,      3,      0,      0, }, /* 235 */
-  {    21,     10,      5,      0,      0, }, /* 236 */
-  {    21,      7,     12,      0,      0, }, /* 237 */
-  {    21,     13,     12,      0,      0, }, /* 238 */
-  {    20,     12,      3,      0,      0, }, /* 239 */
-  {    20,     10,      5,      0,      0, }, /* 240 */
-  {    20,      7,     12,      0,      0, }, /* 241 */
-  {    20,     13,     12,      0,      0, }, /* 242 */
-  {    20,     21,     12,      0,      0, }, /* 243 */
-  {    20,     23,     12,      0,      0, }, /* 244 */
-  {    43,     12,      3,      0,      0, }, /* 245 */
-  {    43,     10,      5,      0,      0, }, /* 246 */
-  {    43,      7,     12,      0,      0, }, /* 247 */
-  {    43,     10,      3,      0,      0, }, /* 248 */
-  {    43,     13,     12,      0,      0, }, /* 249 */
-  {    43,     26,     12,      0,      0, }, /* 250 */
-  {    43,     15,     12,      0,      0, }, /* 251 */
-  {    53,     12,      3,      0,      0, }, /* 252 */
-  {    53,      7,     12,      0,      0, }, /* 253 */
-  {    53,     10,      3,      0,      0, }, /* 254 */
-  {    53,     10,      5,      0,      0, }, /* 255 */
-  {    53,     13,     12,      0,      0, }, /* 256 */
-  {    53,     15,     12,      0,      0, }, /* 257 */
-  {    53,     26,     12,      0,      0, }, /* 258 */
-  {    53,     23,     12,      0,      0, }, /* 259 */
-  {    54,     12,      3,      0,      0, }, /* 260 */
-  {    54,     10,      5,      0,      0, }, /* 261 */
-  {    54,      7,     12,      0,      0, }, /* 262 */
-  {    54,     13,     12,      0,      0, }, /* 263 */
-  {    54,     15,     12,      0,      0, }, /* 264 */
-  {    54,     26,     12,      0,      0, }, /* 265 */
-  {    28,     12,      3,      0,      0, }, /* 266 */
-  {    28,     10,      5,      0,      0, }, /* 267 */
-  {    28,      7,     12,      0,      0, }, /* 268 */
-  {    28,     10,      3,      0,      0, }, /* 269 */
-  {    28,     13,     12,      0,      0, }, /* 270 */
-  {    36,     12,      3,      0,      0, }, /* 271 */
-  {    36,     10,      5,      0,      0, }, /* 272 */
-  {    36,      7,     12,      0,      0, }, /* 273 */
-  {    36,     10,      3,      0,      0, }, /* 274 */
-  {    36,     13,     12,      0,      0, }, /* 275 */
-  {    36,     15,     12,      0,      0, }, /* 276 */
-  {    36,     26,     12,      0,      0, }, /* 277 */
-  {    47,     10,      5,      0,      0, }, /* 278 */
-  {    47,      7,     12,      0,      0, }, /* 279 */
-  {    47,     12,      3,      0,      0, }, /* 280 */
-  {    47,     10,      3,      0,      0, }, /* 281 */
-  {    47,     13,     12,      0,      0, }, /* 282 */
-  {    47,     21,     12,      0,      0, }, /* 283 */
-  {    56,      7,     12,      0,      0, }, /* 284 */
-  {    56,     12,      3,      0,      0, }, /* 285 */
-  {    56,      7,      5,      0,      0, }, /* 286 */
-  {    56,      6,     12,      0,      0, }, /* 287 */
-  {    56,     21,     12,      0,      0, }, /* 288 */
-  {    56,     13,     12,      0,      0, }, /* 289 */
-  {    32,      7,     12,      0,      0, }, /* 290 */
-  {    32,     12,      3,      0,      0, }, /* 291 */
-  {    32,      7,      5,      0,      0, }, /* 292 */
-  {    32,      6,     12,      0,      0, }, /* 293 */
-  {    32,     13,     12,      0,      0, }, /* 294 */
-  {    57,      7,     12,      0,      0, }, /* 295 */
-  {    57,     26,     12,      0,      0, }, /* 296 */
-  {    57,     21,     12,      0,      0, }, /* 297 */
-  {    57,     12,      3,      0,      0, }, /* 298 */
-  {    57,     13,     12,      0,      0, }, /* 299 */
-  {    57,     15,     12,      0,      0, }, /* 300 */
-  {    57,     22,     12,      0,      0, }, /* 301 */
-  {    57,     18,     12,      0,      0, }, /* 302 */
-  {    57,     10,      5,      0,      0, }, /* 303 */
-  {    38,      7,     12,      0,      0, }, /* 304 */
-  {    38,     10,     12,      0,      0, }, /* 305 */
-  {    38,     12,      3,      0,      0, }, /* 306 */
-  {    38,     10,      5,      0,      0, }, /* 307 */
-  {    38,     13,     12,      0,      0, }, /* 308 */
-  {    38,     21,     12,      0,      0, }, /* 309 */
-  {    38,     26,     12,      0,      0, }, /* 310 */
-  {    16,      9,     12,      0,   7264, }, /* 311 */
-  {    16,      7,     12,      0,      0, }, /* 312 */
-  {    16,      6,     12,      0,      0, }, /* 313 */
-  {    23,      7,      6,      0,      0, }, /* 314 */
-  {    23,      7,      7,      0,      0, }, /* 315 */
-  {    23,      7,      8,      0,      0, }, /* 316 */
-  {    15,      7,     12,      0,      0, }, /* 317 */
-  {    15,     12,      3,      0,      0, }, /* 318 */
-  {    15,     21,     12,      0,      0, }, /* 319 */
-  {    15,     15,     12,      0,      0, }, /* 320 */
-  {    15,     26,     12,      0,      0, }, /* 321 */
-  {     8,      7,     12,      0,      0, }, /* 322 */
-  {     7,     17,     12,      0,      0, }, /* 323 */
-  {     7,      7,     12,      0,      0, }, /* 324 */
-  {     7,     21,     12,      0,      0, }, /* 325 */
-  {    40,     29,     12,      0,      0, }, /* 326 */
-  {    40,      7,     12,      0,      0, }, /* 327 */
-  {    40,     22,     12,      0,      0, }, /* 328 */
-  {    40,     18,     12,      0,      0, }, /* 329 */
-  {    45,      7,     12,      0,      0, }, /* 330 */
-  {    45,     14,     12,      0,      0, }, /* 331 */
-  {    50,      7,     12,      0,      0, }, /* 332 */
-  {    50,     12,      3,      0,      0, }, /* 333 */
-  {    24,      7,     12,      0,      0, }, /* 334 */
-  {    24,     12,      3,      0,      0, }, /* 335 */
-  {     6,      7,     12,      0,      0, }, /* 336 */
-  {     6,     12,      3,      0,      0, }, /* 337 */
-  {    51,      7,     12,      0,      0, }, /* 338 */
-  {    51,     12,      3,      0,      0, }, /* 339 */
-  {    31,      7,     12,      0,      0, }, /* 340 */
-  {    31,     12,      3,      0,      0, }, /* 341 */
-  {    31,     10,      5,      0,      0, }, /* 342 */
-  {    31,     21,     12,      0,      0, }, /* 343 */
-  {    31,      6,     12,      0,      0, }, /* 344 */
-  {    31,     23,     12,      0,      0, }, /* 345 */
-  {    31,     13,     12,      0,      0, }, /* 346 */
-  {    31,     15,     12,      0,      0, }, /* 347 */
-  {    37,     21,     12,      0,      0, }, /* 348 */
-  {    37,     17,     12,      0,      0, }, /* 349 */
-  {    37,     12,      3,      0,      0, }, /* 350 */
-  {    37,      1,      2,      0,      0, }, /* 351 */
-  {    37,     13,     12,      0,      0, }, /* 352 */
-  {    37,      7,     12,      0,      0, }, /* 353 */
-  {    37,      6,     12,      0,      0, }, /* 354 */
-  {    34,      7,     12,      0,      0, }, /* 355 */
-  {    34,     12,      3,      0,      0, }, /* 356 */
-  {    34,     10,      5,      0,      0, }, /* 357 */
-  {    34,     26,     12,      0,      0, }, /* 358 */
-  {    34,     21,     12,      0,      0, }, /* 359 */
-  {    34,     13,     12,      0,      0, }, /* 360 */
-  {    52,      7,     12,      0,      0, }, /* 361 */
-  {    39,      7,     12,      0,      0, }, /* 362 */
-  {    39,     10,     12,      0,      0, }, /* 363 */
-  {    39,     10,      5,      0,      0, }, /* 364 */
-  {    39,     13,     12,      0,      0, }, /* 365 */
-  {    39,     15,     12,      0,      0, }, /* 366 */
-  {    39,     26,     12,      0,      0, }, /* 367 */
-  {    31,     26,     12,      0,      0, }, /* 368 */
-  {     5,      7,     12,      0,      0, }, /* 369 */
-  {     5,     12,      3,      0,      0, }, /* 370 */
-  {     5,     10,      5,      0,      0, }, /* 371 */
-  {     5,     21,     12,      0,      0, }, /* 372 */
-  {    90,      7,     12,      0,      0, }, /* 373 */
-  {    90,     10,      5,      0,      0, }, /* 374 */
-  {    90,     12,      3,      0,      0, }, /* 375 */
-  {    90,     10,     12,      0,      0, }, /* 376 */
-  {    90,     13,     12,      0,      0, }, /* 377 */
-  {    90,     21,     12,      0,      0, }, /* 378 */
-  {    90,      6,     12,      0,      0, }, /* 379 */
-  {    27,     11,      3,      0,      0, }, /* 380 */
-  {    61,     12,      3,      0,      0, }, /* 381 */
-  {    61,     10,      5,      0,      0, }, /* 382 */
-  {    61,      7,     12,      0,      0, }, /* 383 */
-  {    61,     13,     12,      0,      0, }, /* 384 */
-  {    61,     21,     12,      0,      0, }, /* 385 */
-  {    61,     26,     12,      0,      0, }, /* 386 */
-  {    75,     12,      3,      0,      0, }, /* 387 */
-  {    75,     10,      5,      0,      0, }, /* 388 */
-  {    75,      7,     12,      0,      0, }, /* 389 */
-  {    75,     13,     12,      0,      0, }, /* 390 */
-  {    92,      7,     12,      0,      0, }, /* 391 */
-  {    92,     12,      3,      0,      0, }, /* 392 */
-  {    92,     10,      5,      0,      0, }, /* 393 */
-  {    92,     21,     12,      0,      0, }, /* 394 */
-  {    69,      7,     12,      0,      0, }, /* 395 */
-  {    69,     10,      5,      0,      0, }, /* 396 */
-  {    69,     12,      3,      0,      0, }, /* 397 */
-  {    69,     21,     12,      0,      0, }, /* 398 */
-  {    69,     13,     12,      0,      0, }, /* 399 */
-  {    72,     13,     12,      0,      0, }, /* 400 */
-  {    72,      7,     12,      0,      0, }, /* 401 */
-  {    72,      6,     12,      0,      0, }, /* 402 */
-  {    72,     21,     12,      0,      0, }, /* 403 */
-  {    75,     21,     12,      0,      0, }, /* 404 */
-  {     9,     10,      5,      0,      0, }, /* 405 */
-  {     9,      7,     12,      0,      0, }, /* 406 */
-  {    12,      5,     12,      0,      0, }, /* 407 */
-  {    12,      6,     12,      0,      0, }, /* 408 */
-  {    33,      5,     12,      0,  35332, }, /* 409 */
-  {    33,      5,     12,      0,   3814, }, /* 410 */
-  {    33,      9,     12,     63,      1, }, /* 411 */
-  {    33,      5,     12,     63,     -1, }, /* 412 */
-  {    33,      5,     12,     63,    -58, }, /* 413 */
-  {    33,      9,     12,      0,  -7615, }, /* 414 */
-  {    19,      5,     12,      0,      8, }, /* 415 */
-  {    19,      9,     12,      0,     -8, }, /* 416 */
-  {    19,      5,     12,      0,     74, }, /* 417 */
-  {    19,      5,     12,      0,     86, }, /* 418 */
-  {    19,      5,     12,      0,    100, }, /* 419 */
-  {    19,      5,     12,      0,    128, }, /* 420 */
-  {    19,      5,     12,      0,    112, }, /* 421 */
-  {    19,      5,     12,      0,    126, }, /* 422 */
-  {    19,      8,     12,      0,     -8, }, /* 423 */
-  {    19,      5,     12,      0,      9, }, /* 424 */
-  {    19,      9,     12,      0,    -74, }, /* 425 */
-  {    19,      8,     12,      0,     -9, }, /* 426 */
-  {    19,      5,     12,     21,  -7173, }, /* 427 */
-  {    19,      9,     12,      0,    -86, }, /* 428 */
-  {    19,      9,     12,      0,   -100, }, /* 429 */
-  {    19,      9,     12,      0,   -112, }, /* 430 */
-  {    19,      9,     12,      0,   -128, }, /* 431 */
-  {    19,      9,     12,      0,   -126, }, /* 432 */
-  {    27,      1,      3,      0,      0, }, /* 433 */
-  {     9,     27,      2,      0,      0, }, /* 434 */
-  {     9,     28,      2,      0,      0, }, /* 435 */
-  {     9,      2,      2,      0,      0, }, /* 436 */
-  {     9,      9,     12,      0,      0, }, /* 437 */
-  {     9,      5,     12,      0,      0, }, /* 438 */
-  {    19,      9,     12,     67,  -7517, }, /* 439 */
-  {    33,      9,     12,     71,  -8383, }, /* 440 */
-  {    33,      9,     12,     75,  -8262, }, /* 441 */
-  {    33,      9,     12,      0,     28, }, /* 442 */
-  {    33,      5,     12,      0,    -28, }, /* 443 */
-  {    33,     14,     12,      0,     16, }, /* 444 */
-  {    33,     14,     12,      0,    -16, }, /* 445 */
-  {    33,     14,     12,      0,      0, }, /* 446 */
-  {     9,     26,     12,      0,     26, }, /* 447 */
-  {     9,     26,     12,      0,    -26, }, /* 448 */
-  {     4,     26,     12,      0,      0, }, /* 449 */
-  {    17,      9,     12,      0,     48, }, /* 450 */
-  {    17,      5,     12,      0,    -48, }, /* 451 */
-  {    33,      9,     12,      0, -10743, }, /* 452 */
-  {    33,      9,     12,      0,  -3814, }, /* 453 */
-  {    33,      9,     12,      0, -10727, }, /* 454 */
-  {    33,      5,     12,      0, -10795, }, /* 455 */
-  {    33,      5,     12,      0, -10792, }, /* 456 */
-  {    33,      9,     12,      0, -10780, }, /* 457 */
-  {    33,      9,     12,      0, -10749, }, /* 458 */
-  {    33,      9,     12,      0, -10783, }, /* 459 */
-  {    33,      9,     12,      0, -10782, }, /* 460 */
-  {    33,      9,     12,      0, -10815, }, /* 461 */
-  {    10,      5,     12,      0,      0, }, /* 462 */
-  {    10,     26,     12,      0,      0, }, /* 463 */
-  {    10,     12,      3,      0,      0, }, /* 464 */
-  {    10,     21,     12,      0,      0, }, /* 465 */
-  {    10,     15,     12,      0,      0, }, /* 466 */
-  {    16,      5,     12,      0,  -7264, }, /* 467 */
-  {    58,      7,     12,      0,      0, }, /* 468 */
-  {    58,      6,     12,      0,      0, }, /* 469 */
-  {    58,     21,     12,      0,      0, }, /* 470 */
-  {    58,     12,      3,      0,      0, }, /* 471 */
-  {    22,     26,     12,      0,      0, }, /* 472 */
-  {    22,      6,     12,      0,      0, }, /* 473 */
-  {    22,     14,     12,      0,      0, }, /* 474 */
-  {    23,     10,      3,      0,      0, }, /* 475 */
-  {    26,      7,     12,      0,      0, }, /* 476 */
-  {    26,      6,     12,      0,      0, }, /* 477 */
-  {    29,      7,     12,      0,      0, }, /* 478 */
-  {    29,      6,     12,      0,      0, }, /* 479 */
-  {     3,      7,     12,      0,      0, }, /* 480 */
-  {    23,      7,     12,      0,      0, }, /* 481 */
-  {    23,     26,     12,      0,      0, }, /* 482 */
-  {    29,     26,     12,      0,      0, }, /* 483 */
-  {    22,      7,     12,      0,      0, }, /* 484 */
-  {    60,      7,     12,      0,      0, }, /* 485 */
-  {    60,      6,     12,      0,      0, }, /* 486 */
-  {    60,     26,     12,      0,      0, }, /* 487 */
-  {    85,      7,     12,      0,      0, }, /* 488 */
-  {    85,      6,     12,      0,      0, }, /* 489 */
-  {    85,     21,     12,      0,      0, }, /* 490 */
-  {    76,      7,     12,      0,      0, }, /* 491 */
-  {    76,      6,     12,      0,      0, }, /* 492 */
-  {    76,     21,     12,      0,      0, }, /* 493 */
-  {    76,     13,     12,      0,      0, }, /* 494 */
-  {    12,      7,     12,      0,      0, }, /* 495 */
-  {    12,     21,     12,      0,      0, }, /* 496 */
-  {    78,      7,     12,      0,      0, }, /* 497 */
-  {    78,     14,     12,      0,      0, }, /* 498 */
-  {    78,     12,      3,      0,      0, }, /* 499 */
-  {    78,     21,     12,      0,      0, }, /* 500 */
-  {    33,      9,     12,      0, -35332, }, /* 501 */
-  {    33,      9,     12,      0, -42280, }, /* 502 */
-  {    33,      9,     12,      0, -42308, }, /* 503 */
-  {    33,      9,     12,      0, -42319, }, /* 504 */
-  {    33,      9,     12,      0, -42315, }, /* 505 */
-  {    33,      9,     12,      0, -42305, }, /* 506 */
-  {    33,      9,     12,      0, -42258, }, /* 507 */
-  {    33,      9,     12,      0, -42282, }, /* 508 */
-  {    48,      7,     12,      0,      0, }, /* 509 */
-  {    48,     12,      3,      0,      0, }, /* 510 */
-  {    48,     10,      5,      0,      0, }, /* 511 */
-  {    48,     26,     12,      0,      0, }, /* 512 */
-  {    64,      7,     12,      0,      0, }, /* 513 */
-  {    64,     21,     12,      0,      0, }, /* 514 */
-  {    74,     10,      5,      0,      0, }, /* 515 */
-  {    74,      7,     12,      0,      0, }, /* 516 */
-  {    74,     12,      3,      0,      0, }, /* 517 */
-  {    74,     21,     12,      0,      0, }, /* 518 */
-  {    74,     13,     12,      0,      0, }, /* 519 */
-  {    68,     13,     12,      0,      0, }, /* 520 */
-  {    68,      7,     12,      0,      0, }, /* 521 */
-  {    68,     12,      3,      0,      0, }, /* 522 */
-  {    68,     21,     12,      0,      0, }, /* 523 */
-  {    73,      7,     12,      0,      0, }, /* 524 */
-  {    73,     12,      3,      0,      0, }, /* 525 */
-  {    73,     10,      5,      0,      0, }, /* 526 */
-  {    73,     21,     12,      0,      0, }, /* 527 */
-  {    83,     12,      3,      0,      0, }, /* 528 */
-  {    83,     10,      5,      0,      0, }, /* 529 */
-  {    83,      7,     12,      0,      0, }, /* 530 */
-  {    83,     21,     12,      0,      0, }, /* 531 */
-  {    83,     13,     12,      0,      0, }, /* 532 */
-  {    38,      6,     12,      0,      0, }, /* 533 */
-  {    67,      7,     12,      0,      0, }, /* 534 */
-  {    67,     12,      3,      0,      0, }, /* 535 */
-  {    67,     10,      5,      0,      0, }, /* 536 */
-  {    67,     13,     12,      0,      0, }, /* 537 */
-  {    67,     21,     12,      0,      0, }, /* 538 */
-  {    91,      7,     12,      0,      0, }, /* 539 */
-  {    91,     12,      3,      0,      0, }, /* 540 */
-  {    91,      6,     12,      0,      0, }, /* 541 */
-  {    91,     21,     12,      0,      0, }, /* 542 */
-  {    86,      7,     12,      0,      0, }, /* 543 */
-  {    86,     10,      5,      0,      0, }, /* 544 */
-  {    86,     12,      3,      0,      0, }, /* 545 */
-  {    86,     21,     12,      0,      0, }, /* 546 */
-  {    86,      6,     12,      0,      0, }, /* 547 */
-  {    86,     13,     12,      0,      0, }, /* 548 */
-  {    23,      7,      9,      0,      0, }, /* 549 */
-  {    23,      7,     10,      0,      0, }, /* 550 */
-  {     9,      4,      2,      0,      0, }, /* 551 */
-  {     9,      3,     12,      0,      0, }, /* 552 */
-  {    25,     25,     12,      0,      0, }, /* 553 */
-  {     0,     24,     12,      0,      0, }, /* 554 */
-  {     9,      6,      3,      0,      0, }, /* 555 */
-  {    35,      7,     12,      0,      0, }, /* 556 */
-  {    19,     14,     12,      0,      0, }, /* 557 */
-  {    19,     15,     12,      0,      0, }, /* 558 */
-  {    19,     26,     12,      0,      0, }, /* 559 */
-  {    70,      7,     12,      0,      0, }, /* 560 */
-  {    66,      7,     12,      0,      0, }, /* 561 */
-  {    41,      7,     12,      0,      0, }, /* 562 */
-  {    41,     15,     12,      0,      0, }, /* 563 */
-  {    18,      7,     12,      0,      0, }, /* 564 */
-  {    18,     14,     12,      0,      0, }, /* 565 */
-  {   117,      7,     12,      0,      0, }, /* 566 */
-  {   117,     12,      3,      0,      0, }, /* 567 */
-  {    59,      7,     12,      0,      0, }, /* 568 */
-  {    59,     21,     12,      0,      0, }, /* 569 */
-  {    42,      7,     12,      0,      0, }, /* 570 */
-  {    42,     21,     12,      0,      0, }, /* 571 */
-  {    42,     14,     12,      0,      0, }, /* 572 */
-  {    13,      9,     12,      0,     40, }, /* 573 */
-  {    13,      5,     12,      0,    -40, }, /* 574 */
-  {    46,      7,     12,      0,      0, }, /* 575 */
-  {    44,      7,     12,      0,      0, }, /* 576 */
-  {    44,     13,     12,      0,      0, }, /* 577 */
-  {   105,      7,     12,      0,      0, }, /* 578 */
-  {   103,      7,     12,      0,      0, }, /* 579 */
-  {   103,     21,     12,      0,      0, }, /* 580 */
-  {   109,      7,     12,      0,      0, }, /* 581 */
-  {    11,      7,     12,      0,      0, }, /* 582 */
-  {    80,      7,     12,      0,      0, }, /* 583 */
-  {    80,     21,     12,      0,      0, }, /* 584 */
-  {    80,     15,     12,      0,      0, }, /* 585 */
-  {   119,      7,     12,      0,      0, }, /* 586 */
-  {   119,     26,     12,      0,      0, }, /* 587 */
-  {   119,     15,     12,      0,      0, }, /* 588 */
-  {   115,      7,     12,      0,      0, }, /* 589 */
-  {   115,     15,     12,      0,      0, }, /* 590 */
-  {    65,      7,     12,      0,      0, }, /* 591 */
-  {    65,     15,     12,      0,      0, }, /* 592 */
-  {    65,     21,     12,      0,      0, }, /* 593 */
-  {    71,      7,     12,      0,      0, }, /* 594 */
-  {    71,     21,     12,      0,      0, }, /* 595 */
-  {    97,      7,     12,      0,      0, }, /* 596 */
-  {    96,      7,     12,      0,      0, }, /* 597 */
-  {    30,      7,     12,      0,      0, }, /* 598 */
-  {    30,     12,      3,      0,      0, }, /* 599 */
-  {    30,     15,     12,      0,      0, }, /* 600 */
-  {    30,     21,     12,      0,      0, }, /* 601 */
-  {    87,      7,     12,      0,      0, }, /* 602 */
-  {    87,     15,     12,      0,      0, }, /* 603 */
-  {    87,     21,     12,      0,      0, }, /* 604 */
-  {   116,      7,     12,      0,      0, }, /* 605 */
-  {   116,     15,     12,      0,      0, }, /* 606 */
-  {   111,      7,     12,      0,      0, }, /* 607 */
-  {   111,     26,     12,      0,      0, }, /* 608 */
-  {   111,     12,      3,      0,      0, }, /* 609 */
-  {   111,     15,     12,      0,      0, }, /* 610 */
-  {   111,     21,     12,      0,      0, }, /* 611 */
-  {    77,      7,     12,      0,      0, }, /* 612 */
-  {    77,     21,     12,      0,      0, }, /* 613 */
-  {    82,      7,     12,      0,      0, }, /* 614 */
-  {    82,     15,     12,      0,      0, }, /* 615 */
-  {    81,      7,     12,      0,      0, }, /* 616 */
-  {    81,     15,     12,      0,      0, }, /* 617 */
-  {   120,      7,     12,      0,      0, }, /* 618 */
-  {   120,     21,     12,      0,      0, }, /* 619 */
-  {   120,     15,     12,      0,      0, }, /* 620 */
-  {    88,      7,     12,      0,      0, }, /* 621 */
-  {     0,     15,     12,      0,      0, }, /* 622 */
-  {    93,     10,      5,      0,      0, }, /* 623 */
-  {    93,     12,      3,      0,      0, }, /* 624 */
-  {    93,      7,     12,      0,      0, }, /* 625 */
-  {    93,     21,     12,      0,      0, }, /* 626 */
-  {    93,     15,     12,      0,      0, }, /* 627 */
-  {    93,     13,     12,      0,      0, }, /* 628 */
-  {    84,     12,      3,      0,      0, }, /* 629 */
-  {    84,     10,      5,      0,      0, }, /* 630 */
-  {    84,      7,     12,      0,      0, }, /* 631 */
-  {    84,     21,     12,      0,      0, }, /* 632 */
-  {    84,      1,      2,      0,      0, }, /* 633 */
-  {   100,      7,     12,      0,      0, }, /* 634 */
-  {   100,     13,     12,      0,      0, }, /* 635 */
-  {    95,     12,      3,      0,      0, }, /* 636 */
-  {    95,      7,     12,      0,      0, }, /* 637 */
-  {    95,     10,      5,      0,      0, }, /* 638 */
-  {    95,     13,     12,      0,      0, }, /* 639 */
-  {    95,     21,     12,      0,      0, }, /* 640 */
-  {   110,      7,     12,      0,      0, }, /* 641 */
-  {   110,     12,      3,      0,      0, }, /* 642 */
-  {   110,     21,     12,      0,      0, }, /* 643 */
-  {    99,     12,      3,      0,      0, }, /* 644 */
-  {    99,     10,      5,      0,      0, }, /* 645 */
-  {    99,      7,     12,      0,      0, }, /* 646 */
-  {    99,     21,     12,      0,      0, }, /* 647 */
-  {    99,     13,     12,      0,      0, }, /* 648 */
-  {    47,     15,     12,      0,      0, }, /* 649 */
-  {   107,      7,     12,      0,      0, }, /* 650 */
-  {   107,     10,      5,      0,      0, }, /* 651 */
-  {   107,     12,      3,      0,      0, }, /* 652 */
-  {   107,     21,     12,      0,      0, }, /* 653 */
-  {   108,      7,     12,      0,      0, }, /* 654 */
-  {   108,     12,      3,      0,      0, }, /* 655 */
-  {   108,     10,      5,      0,      0, }, /* 656 */
-  {   108,     13,     12,      0,      0, }, /* 657 */
-  {   106,     12,      3,      0,      0, }, /* 658 */
-  {   106,     10,      5,      0,      0, }, /* 659 */
-  {   106,      7,     12,      0,      0, }, /* 660 */
-  {   106,     10,      3,      0,      0, }, /* 661 */
-  {   123,      7,     12,      0,      0, }, /* 662 */
-  {   123,     10,      3,      0,      0, }, /* 663 */
-  {   123,     10,      5,      0,      0, }, /* 664 */
-  {   123,     12,      3,      0,      0, }, /* 665 */
-  {   123,     21,     12,      0,      0, }, /* 666 */
-  {   123,     13,     12,      0,      0, }, /* 667 */
-  {   122,      7,     12,      0,      0, }, /* 668 */
-  {   122,     10,      3,      0,      0, }, /* 669 */
-  {   122,     10,      5,      0,      0, }, /* 670 */
-  {   122,     12,      3,      0,      0, }, /* 671 */
-  {   122,     21,     12,      0,      0, }, /* 672 */
-  {   113,      7,     12,      0,      0, }, /* 673 */
-  {   113,     10,      5,      0,      0, }, /* 674 */
-  {   113,     12,      3,      0,      0, }, /* 675 */
-  {   113,     21,     12,      0,      0, }, /* 676 */
-  {   113,     13,     12,      0,      0, }, /* 677 */
-  {   101,      7,     12,      0,      0, }, /* 678 */
-  {   101,     12,      3,      0,      0, }, /* 679 */
-  {   101,     10,      5,      0,      0, }, /* 680 */
-  {   101,     13,     12,      0,      0, }, /* 681 */
-  {   124,      9,     12,      0,     32, }, /* 682 */
-  {   124,      5,     12,      0,    -32, }, /* 683 */
-  {   124,     13,     12,      0,      0, }, /* 684 */
-  {   124,     15,     12,      0,      0, }, /* 685 */
-  {   124,      7,     12,      0,      0, }, /* 686 */
-  {   121,      7,     12,      0,      0, }, /* 687 */
-  {    62,      7,     12,      0,      0, }, /* 688 */
-  {    62,     14,     12,      0,      0, }, /* 689 */
-  {    62,     21,     12,      0,      0, }, /* 690 */
-  {    79,      7,     12,      0,      0, }, /* 691 */
-  {   114,      7,     12,      0,      0, }, /* 692 */
-  {   114,     13,     12,      0,      0, }, /* 693 */
-  {   114,     21,     12,      0,      0, }, /* 694 */
-  {   102,      7,     12,      0,      0, }, /* 695 */
-  {   102,     12,      3,      0,      0, }, /* 696 */
-  {   102,     21,     12,      0,      0, }, /* 697 */
-  {   118,      7,     12,      0,      0, }, /* 698 */
-  {   118,     12,      3,      0,      0, }, /* 699 */
-  {   118,     21,     12,      0,      0, }, /* 700 */
-  {   118,     26,     12,      0,      0, }, /* 701 */
-  {   118,      6,     12,      0,      0, }, /* 702 */
-  {   118,     13,     12,      0,      0, }, /* 703 */
-  {   118,     15,     12,      0,      0, }, /* 704 */
-  {    98,      7,     12,      0,      0, }, /* 705 */
-  {    98,     10,      5,      0,      0, }, /* 706 */
-  {    98,     12,      3,      0,      0, }, /* 707 */
-  {    98,      6,     12,      0,      0, }, /* 708 */
-  {   104,      7,     12,      0,      0, }, /* 709 */
-  {   104,     26,     12,      0,      0, }, /* 710 */
-  {   104,     12,      3,      0,      0, }, /* 711 */
-  {   104,     21,     12,      0,      0, }, /* 712 */
-  {     9,     10,      3,      0,      0, }, /* 713 */
-  {    19,     12,      3,      0,      0, }, /* 714 */
-  {   112,      7,     12,      0,      0, }, /* 715 */
-  {   112,     15,     12,      0,      0, }, /* 716 */
-  {   112,     12,      3,      0,      0, }, /* 717 */
-  {     9,     26,     11,      0,      0, }, /* 718 */
-  {    26,     26,     12,      0,      0, }, /* 719 */
+  {     0,      6,     12,      0,      0, }, /* 202 */
+  {    49,     21,     12,      0,      0, }, /* 203 */
+  {    49,      1,      2,      0,      0, }, /* 204 */
+  {    49,      7,     12,      0,      0, }, /* 205 */
+  {    49,     12,      3,      0,      0, }, /* 206 */
+  {    55,      7,     12,      0,      0, }, /* 207 */
+  {    55,     12,      3,      0,      0, }, /* 208 */
+  {    63,     13,     12,      0,      0, }, /* 209 */
+  {    63,      7,     12,      0,      0, }, /* 210 */
+  {    63,     12,      3,      0,      0, }, /* 211 */
+  {    63,      6,     12,      0,      0, }, /* 212 */
+  {    63,     26,     12,      0,      0, }, /* 213 */
+  {    63,     21,     12,      0,      0, }, /* 214 */
+  {    89,      7,     12,      0,      0, }, /* 215 */
+  {    89,     12,      3,      0,      0, }, /* 216 */
+  {    89,      6,     12,      0,      0, }, /* 217 */
+  {    89,     21,     12,      0,      0, }, /* 218 */
+  {    94,      7,     12,      0,      0, }, /* 219 */
+  {    94,     12,      3,      0,      0, }, /* 220 */
+  {    94,     21,     12,      0,      0, }, /* 221 */
+  {    14,     12,      3,      0,      0, }, /* 222 */
+  {    14,     10,      5,      0,      0, }, /* 223 */
+  {    14,      7,     12,      0,      0, }, /* 224 */
+  {    14,     13,     12,      0,      0, }, /* 225 */
+  {    14,     21,     12,      0,      0, }, /* 226 */
+  {    14,      6,     12,      0,      0, }, /* 227 */
+  {     2,      7,     12,      0,      0, }, /* 228 */
+  {     2,     12,      3,      0,      0, }, /* 229 */
+  {     2,     10,      5,      0,      0, }, /* 230 */
+  {     2,     10,      3,      0,      0, }, /* 231 */
+  {     2,     13,     12,      0,      0, }, /* 232 */
+  {     2,     23,     12,      0,      0, }, /* 233 */
+  {     2,     15,     12,      0,      0, }, /* 234 */
+  {     2,     26,     12,      0,      0, }, /* 235 */
+  {    21,     12,      3,      0,      0, }, /* 236 */
+  {    21,     10,      5,      0,      0, }, /* 237 */
+  {    21,      7,     12,      0,      0, }, /* 238 */
+  {    21,     13,     12,      0,      0, }, /* 239 */
+  {    20,     12,      3,      0,      0, }, /* 240 */
+  {    20,     10,      5,      0,      0, }, /* 241 */
+  {    20,      7,     12,      0,      0, }, /* 242 */
+  {    20,     13,     12,      0,      0, }, /* 243 */
+  {    20,     21,     12,      0,      0, }, /* 244 */
+  {    20,     23,     12,      0,      0, }, /* 245 */
+  {    43,     12,      3,      0,      0, }, /* 246 */
+  {    43,     10,      5,      0,      0, }, /* 247 */
+  {    43,      7,     12,      0,      0, }, /* 248 */
+  {    43,     10,      3,      0,      0, }, /* 249 */
+  {    43,     13,     12,      0,      0, }, /* 250 */
+  {    43,     26,     12,      0,      0, }, /* 251 */
+  {    43,     15,     12,      0,      0, }, /* 252 */
+  {    53,     12,      3,      0,      0, }, /* 253 */
+  {    53,      7,     12,      0,      0, }, /* 254 */
+  {    53,     10,      3,      0,      0, }, /* 255 */
+  {    53,     10,      5,      0,      0, }, /* 256 */
+  {    53,     13,     12,      0,      0, }, /* 257 */
+  {    53,     15,     12,      0,      0, }, /* 258 */
+  {    53,     26,     12,      0,      0, }, /* 259 */
+  {    53,     23,     12,      0,      0, }, /* 260 */
+  {    54,     12,      3,      0,      0, }, /* 261 */
+  {    54,     10,      5,      0,      0, }, /* 262 */
+  {    54,      7,     12,      0,      0, }, /* 263 */
+  {    54,     13,     12,      0,      0, }, /* 264 */
+  {    54,     15,     12,      0,      0, }, /* 265 */
+  {    54,     26,     12,      0,      0, }, /* 266 */
+  {    28,     12,      3,      0,      0, }, /* 267 */
+  {    28,     10,      5,      0,      0, }, /* 268 */
+  {    28,      7,     12,      0,      0, }, /* 269 */
+  {    28,     10,      3,      0,      0, }, /* 270 */
+  {    28,     13,     12,      0,      0, }, /* 271 */
+  {    36,     12,      3,      0,      0, }, /* 272 */
+  {    36,     10,      5,      0,      0, }, /* 273 */
+  {    36,      7,     12,      0,      0, }, /* 274 */
+  {    36,     10,      3,      0,      0, }, /* 275 */
+  {    36,     13,     12,      0,      0, }, /* 276 */
+  {    36,     15,     12,      0,      0, }, /* 277 */
+  {    36,     26,     12,      0,      0, }, /* 278 */
+  {    47,     10,      5,      0,      0, }, /* 279 */
+  {    47,      7,     12,      0,      0, }, /* 280 */
+  {    47,     12,      3,      0,      0, }, /* 281 */
+  {    47,     10,      3,      0,      0, }, /* 282 */
+  {    47,     13,     12,      0,      0, }, /* 283 */
+  {    47,     21,     12,      0,      0, }, /* 284 */
+  {    56,      7,     12,      0,      0, }, /* 285 */
+  {    56,     12,      3,      0,      0, }, /* 286 */
+  {    56,      7,      5,      0,      0, }, /* 287 */
+  {    56,      6,     12,      0,      0, }, /* 288 */
+  {    56,     21,     12,      0,      0, }, /* 289 */
+  {    56,     13,     12,      0,      0, }, /* 290 */
+  {    32,      7,     12,      0,      0, }, /* 291 */
+  {    32,     12,      3,      0,      0, }, /* 292 */
+  {    32,      7,      5,      0,      0, }, /* 293 */
+  {    32,      6,     12,      0,      0, }, /* 294 */
+  {    32,     13,     12,      0,      0, }, /* 295 */
+  {    57,      7,     12,      0,      0, }, /* 296 */
+  {    57,     26,     12,      0,      0, }, /* 297 */
+  {    57,     21,     12,      0,      0, }, /* 298 */
+  {    57,     12,      3,      0,      0, }, /* 299 */
+  {    57,     13,     12,      0,      0, }, /* 300 */
+  {    57,     15,     12,      0,      0, }, /* 301 */
+  {    57,     22,     12,      0,      0, }, /* 302 */
+  {    57,     18,     12,      0,      0, }, /* 303 */
+  {    57,     10,      5,      0,      0, }, /* 304 */
+  {    38,      7,     12,      0,      0, }, /* 305 */
+  {    38,     10,     12,      0,      0, }, /* 306 */
+  {    38,     12,      3,      0,      0, }, /* 307 */
+  {    38,     10,      5,      0,      0, }, /* 308 */
+  {    38,     13,     12,      0,      0, }, /* 309 */
+  {    38,     21,     12,      0,      0, }, /* 310 */
+  {    38,     26,     12,      0,      0, }, /* 311 */
+  {    16,      9,     12,      0,   7264, }, /* 312 */
+  {    16,      7,     12,      0,      0, }, /* 313 */
+  {    16,      6,     12,      0,      0, }, /* 314 */
+  {    23,      7,      6,      0,      0, }, /* 315 */
+  {    23,      7,      7,      0,      0, }, /* 316 */
+  {    23,      7,      8,      0,      0, }, /* 317 */
+  {    15,      7,     12,      0,      0, }, /* 318 */
+  {    15,     12,      3,      0,      0, }, /* 319 */
+  {    15,     21,     12,      0,      0, }, /* 320 */
+  {    15,     15,     12,      0,      0, }, /* 321 */
+  {    15,     26,     12,      0,      0, }, /* 322 */
+  {     8,      9,     12,      0,  38864, }, /* 323 */
+  {     8,      9,     12,      0,      8, }, /* 324 */
+  {     8,      5,     12,      0,     -8, }, /* 325 */
+  {     7,     17,     12,      0,      0, }, /* 326 */
+  {     7,      7,     12,      0,      0, }, /* 327 */
+  {     7,     21,     12,      0,      0, }, /* 328 */
+  {    40,     29,     12,      0,      0, }, /* 329 */
+  {    40,      7,     12,      0,      0, }, /* 330 */
+  {    40,     22,     12,      0,      0, }, /* 331 */
+  {    40,     18,     12,      0,      0, }, /* 332 */
+  {    45,      7,     12,      0,      0, }, /* 333 */
+  {    45,     14,     12,      0,      0, }, /* 334 */
+  {    50,      7,     12,      0,      0, }, /* 335 */
+  {    50,     12,      3,      0,      0, }, /* 336 */
+  {    24,      7,     12,      0,      0, }, /* 337 */
+  {    24,     12,      3,      0,      0, }, /* 338 */
+  {     6,      7,     12,      0,      0, }, /* 339 */
+  {     6,     12,      3,      0,      0, }, /* 340 */
+  {    51,      7,     12,      0,      0, }, /* 341 */
+  {    51,     12,      3,      0,      0, }, /* 342 */
+  {    31,      7,     12,      0,      0, }, /* 343 */
+  {    31,     12,      3,      0,      0, }, /* 344 */
+  {    31,     10,      5,      0,      0, }, /* 345 */
+  {    31,     21,     12,      0,      0, }, /* 346 */
+  {    31,      6,     12,      0,      0, }, /* 347 */
+  {    31,     23,     12,      0,      0, }, /* 348 */
+  {    31,     13,     12,      0,      0, }, /* 349 */
+  {    31,     15,     12,      0,      0, }, /* 350 */
+  {    37,     21,     12,      0,      0, }, /* 351 */
+  {    37,     17,     12,      0,      0, }, /* 352 */
+  {    37,     12,      3,      0,      0, }, /* 353 */
+  {    37,      1,      2,      0,      0, }, /* 354 */
+  {    37,     13,     12,      0,      0, }, /* 355 */
+  {    37,      7,     12,      0,      0, }, /* 356 */
+  {    37,      6,     12,      0,      0, }, /* 357 */
+  {    34,      7,     12,      0,      0, }, /* 358 */
+  {    34,     12,      3,      0,      0, }, /* 359 */
+  {    34,     10,      5,      0,      0, }, /* 360 */
+  {    34,     26,     12,      0,      0, }, /* 361 */
+  {    34,     21,     12,      0,      0, }, /* 362 */
+  {    34,     13,     12,      0,      0, }, /* 363 */
+  {    52,      7,     12,      0,      0, }, /* 364 */
+  {    39,      7,     12,      0,      0, }, /* 365 */
+  {    39,     13,     12,      0,      0, }, /* 366 */
+  {    39,     15,     12,      0,      0, }, /* 367 */
+  {    39,     26,     12,      0,      0, }, /* 368 */
+  {    31,     26,     12,      0,      0, }, /* 369 */
+  {     5,      7,     12,      0,      0, }, /* 370 */
+  {     5,     12,      3,      0,      0, }, /* 371 */
+  {     5,     10,      5,      0,      0, }, /* 372 */
+  {     5,     21,     12,      0,      0, }, /* 373 */
+  {    90,      7,     12,      0,      0, }, /* 374 */
+  {    90,     10,      5,      0,      0, }, /* 375 */
+  {    90,     12,      3,      0,      0, }, /* 376 */
+  {    90,     10,     12,      0,      0, }, /* 377 */
+  {    90,     13,     12,      0,      0, }, /* 378 */
+  {    90,     21,     12,      0,      0, }, /* 379 */
+  {    90,      6,     12,      0,      0, }, /* 380 */
+  {    27,     11,      3,      0,      0, }, /* 381 */
+  {    61,     12,      3,      0,      0, }, /* 382 */
+  {    61,     10,      5,      0,      0, }, /* 383 */
+  {    61,      7,     12,      0,      0, }, /* 384 */
+  {    61,     13,     12,      0,      0, }, /* 385 */
+  {    61,     21,     12,      0,      0, }, /* 386 */
+  {    61,     26,     12,      0,      0, }, /* 387 */
+  {    75,     12,      3,      0,      0, }, /* 388 */
+  {    75,     10,      5,      0,      0, }, /* 389 */
+  {    75,      7,     12,      0,      0, }, /* 390 */
+  {    75,     13,     12,      0,      0, }, /* 391 */
+  {    92,      7,     12,      0,      0, }, /* 392 */
+  {    92,     12,      3,      0,      0, }, /* 393 */
+  {    92,     10,      5,      0,      0, }, /* 394 */
+  {    92,     21,     12,      0,      0, }, /* 395 */
+  {    69,      7,     12,      0,      0, }, /* 396 */
+  {    69,     10,      5,      0,      0, }, /* 397 */
+  {    69,     12,      3,      0,      0, }, /* 398 */
+  {    69,     21,     12,      0,      0, }, /* 399 */
+  {    69,     13,     12,      0,      0, }, /* 400 */
+  {    72,     13,     12,      0,      0, }, /* 401 */
+  {    72,      7,     12,      0,      0, }, /* 402 */
+  {    72,      6,     12,      0,      0, }, /* 403 */
+  {    72,     21,     12,      0,      0, }, /* 404 */
+  {    75,     21,     12,      0,      0, }, /* 405 */
+  {     9,     10,      5,      0,      0, }, /* 406 */
+  {     9,      7,     12,      0,      0, }, /* 407 */
+  {    12,      5,     12,      0,      0, }, /* 408 */
+  {    12,      6,     12,      0,      0, }, /* 409 */
+  {    33,      5,     12,      0,  35332, }, /* 410 */
+  {    33,      5,     12,      0,   3814, }, /* 411 */
+  {    33,      9,     12,     63,      1, }, /* 412 */
+  {    33,      5,     12,     63,     -1, }, /* 413 */
+  {    33,      5,     12,     63,    -58, }, /* 414 */
+  {    33,      9,     12,      0,  -7615, }, /* 415 */
+  {    19,      5,     12,      0,      8, }, /* 416 */
+  {    19,      9,     12,      0,     -8, }, /* 417 */
+  {    19,      5,     12,      0,     74, }, /* 418 */
+  {    19,      5,     12,      0,     86, }, /* 419 */
+  {    19,      5,     12,      0,    100, }, /* 420 */
+  {    19,      5,     12,      0,    128, }, /* 421 */
+  {    19,      5,     12,      0,    112, }, /* 422 */
+  {    19,      5,     12,      0,    126, }, /* 423 */
+  {    19,      8,     12,      0,     -8, }, /* 424 */
+  {    19,      5,     12,      0,      9, }, /* 425 */
+  {    19,      9,     12,      0,    -74, }, /* 426 */
+  {    19,      8,     12,      0,     -9, }, /* 427 */
+  {    19,      5,     12,     21,  -7173, }, /* 428 */
+  {    19,      9,     12,      0,    -86, }, /* 429 */
+  {    19,      9,     12,      0,   -100, }, /* 430 */
+  {    19,      9,     12,      0,   -112, }, /* 431 */
+  {    19,      9,     12,      0,   -128, }, /* 432 */
+  {    19,      9,     12,      0,   -126, }, /* 433 */
+  {    27,      1,      3,      0,      0, }, /* 434 */
+  {     9,     27,      2,      0,      0, }, /* 435 */
+  {     9,     28,      2,      0,      0, }, /* 436 */
+  {     9,      2,      2,      0,      0, }, /* 437 */
+  {     9,      9,     12,      0,      0, }, /* 438 */
+  {     9,      5,     12,      0,      0, }, /* 439 */
+  {    19,      9,     12,     67,  -7517, }, /* 440 */
+  {    33,      9,     12,     71,  -8383, }, /* 441 */
+  {    33,      9,     12,     75,  -8262, }, /* 442 */
+  {    33,      9,     12,      0,     28, }, /* 443 */
+  {    33,      5,     12,      0,    -28, }, /* 444 */
+  {    33,     14,     12,      0,     16, }, /* 445 */
+  {    33,     14,     12,      0,    -16, }, /* 446 */
+  {    33,     14,     12,      0,      0, }, /* 447 */
+  {     9,     26,     12,      0,     26, }, /* 448 */
+  {     9,     26,     12,      0,    -26, }, /* 449 */
+  {     4,     26,     12,      0,      0, }, /* 450 */
+  {    17,      9,     12,      0,     48, }, /* 451 */
+  {    17,      5,     12,      0,    -48, }, /* 452 */
+  {    33,      9,     12,      0, -10743, }, /* 453 */
+  {    33,      9,     12,      0,  -3814, }, /* 454 */
+  {    33,      9,     12,      0, -10727, }, /* 455 */
+  {    33,      5,     12,      0, -10795, }, /* 456 */
+  {    33,      5,     12,      0, -10792, }, /* 457 */
+  {    33,      9,     12,      0, -10780, }, /* 458 */
+  {    33,      9,     12,      0, -10749, }, /* 459 */
+  {    33,      9,     12,      0, -10783, }, /* 460 */
+  {    33,      9,     12,      0, -10782, }, /* 461 */
+  {    33,      9,     12,      0, -10815, }, /* 462 */
+  {    10,      5,     12,      0,      0, }, /* 463 */
+  {    10,     26,     12,      0,      0, }, /* 464 */
+  {    10,     12,      3,      0,      0, }, /* 465 */
+  {    10,     21,     12,      0,      0, }, /* 466 */
+  {    10,     15,     12,      0,      0, }, /* 467 */
+  {    16,      5,     12,      0,  -7264, }, /* 468 */
+  {    58,      7,     12,      0,      0, }, /* 469 */
+  {    58,      6,     12,      0,      0, }, /* 470 */
+  {    58,     21,     12,      0,      0, }, /* 471 */
+  {    58,     12,      3,      0,      0, }, /* 472 */
+  {    22,     26,     12,      0,      0, }, /* 473 */
+  {    22,      6,     12,      0,      0, }, /* 474 */
+  {    22,     14,     12,      0,      0, }, /* 475 */
+  {    23,     10,      3,      0,      0, }, /* 476 */
+  {    26,      7,     12,      0,      0, }, /* 477 */
+  {    26,      6,     12,      0,      0, }, /* 478 */
+  {    29,      7,     12,      0,      0, }, /* 479 */
+  {    29,      6,     12,      0,      0, }, /* 480 */
+  {     3,      7,     12,      0,      0, }, /* 481 */
+  {    23,      7,     12,      0,      0, }, /* 482 */
+  {    23,     26,     12,      0,      0, }, /* 483 */
+  {    29,     26,     12,      0,      0, }, /* 484 */
+  {    22,      7,     12,      0,      0, }, /* 485 */
+  {    60,      7,     12,      0,      0, }, /* 486 */
+  {    60,      6,     12,      0,      0, }, /* 487 */
+  {    60,     26,     12,      0,      0, }, /* 488 */
+  {    85,      7,     12,      0,      0, }, /* 489 */
+  {    85,      6,     12,      0,      0, }, /* 490 */
+  {    85,     21,     12,      0,      0, }, /* 491 */
+  {    76,      7,     12,      0,      0, }, /* 492 */
+  {    76,      6,     12,      0,      0, }, /* 493 */
+  {    76,     21,     12,      0,      0, }, /* 494 */
+  {    76,     13,     12,      0,      0, }, /* 495 */
+  {    12,      7,     12,      0,      0, }, /* 496 */
+  {    12,     21,     12,      0,      0, }, /* 497 */
+  {    78,      7,     12,      0,      0, }, /* 498 */
+  {    78,     14,     12,      0,      0, }, /* 499 */
+  {    78,     12,      3,      0,      0, }, /* 500 */
+  {    78,     21,     12,      0,      0, }, /* 501 */
+  {    33,      9,     12,      0, -35332, }, /* 502 */
+  {    33,      9,     12,      0, -42280, }, /* 503 */
+  {    33,      9,     12,      0, -42308, }, /* 504 */
+  {    33,      9,     12,      0, -42319, }, /* 505 */
+  {    33,      9,     12,      0, -42315, }, /* 506 */
+  {    33,      9,     12,      0, -42305, }, /* 507 */
+  {    33,      9,     12,      0, -42258, }, /* 508 */
+  {    33,      9,     12,      0, -42282, }, /* 509 */
+  {    33,      9,     12,      0, -42261, }, /* 510 */
+  {    33,      9,     12,      0,    928, }, /* 511 */
+  {    48,      7,     12,      0,      0, }, /* 512 */
+  {    48,     12,      3,      0,      0, }, /* 513 */
+  {    48,     10,      5,      0,      0, }, /* 514 */
+  {    48,     26,     12,      0,      0, }, /* 515 */
+  {    64,      7,     12,      0,      0, }, /* 516 */
+  {    64,     21,     12,      0,      0, }, /* 517 */
+  {    74,     10,      5,      0,      0, }, /* 518 */
+  {    74,      7,     12,      0,      0, }, /* 519 */
+  {    74,     12,      3,      0,      0, }, /* 520 */
+  {    74,     21,     12,      0,      0, }, /* 521 */
+  {    74,     13,     12,      0,      0, }, /* 522 */
+  {    68,     13,     12,      0,      0, }, /* 523 */
+  {    68,      7,     12,      0,      0, }, /* 524 */
+  {    68,     12,      3,      0,      0, }, /* 525 */
+  {    68,     21,     12,      0,      0, }, /* 526 */
+  {    73,      7,     12,      0,      0, }, /* 527 */
+  {    73,     12,      3,      0,      0, }, /* 528 */
+  {    73,     10,      5,      0,      0, }, /* 529 */
+  {    73,     21,     12,      0,      0, }, /* 530 */
+  {    83,     12,      3,      0,      0, }, /* 531 */
+  {    83,     10,      5,      0,      0, }, /* 532 */
+  {    83,      7,     12,      0,      0, }, /* 533 */
+  {    83,     21,     12,      0,      0, }, /* 534 */
+  {    83,     13,     12,      0,      0, }, /* 535 */
+  {    38,      6,     12,      0,      0, }, /* 536 */
+  {    67,      7,     12,      0,      0, }, /* 537 */
+  {    67,     12,      3,      0,      0, }, /* 538 */
+  {    67,     10,      5,      0,      0, }, /* 539 */
+  {    67,     13,     12,      0,      0, }, /* 540 */
+  {    67,     21,     12,      0,      0, }, /* 541 */
+  {    91,      7,     12,      0,      0, }, /* 542 */
+  {    91,     12,      3,      0,      0, }, /* 543 */
+  {    91,      6,     12,      0,      0, }, /* 544 */
+  {    91,     21,     12,      0,      0, }, /* 545 */
+  {    86,      7,     12,      0,      0, }, /* 546 */
+  {    86,     10,      5,      0,      0, }, /* 547 */
+  {    86,     12,      3,      0,      0, }, /* 548 */
+  {    86,     21,     12,      0,      0, }, /* 549 */
+  {    86,      6,     12,      0,      0, }, /* 550 */
+  {    33,      5,     12,      0,   -928, }, /* 551 */
+  {     8,      5,     12,      0, -38864, }, /* 552 */
+  {    86,     13,     12,      0,      0, }, /* 553 */
+  {    23,      7,      9,      0,      0, }, /* 554 */
+  {    23,      7,     10,      0,      0, }, /* 555 */
+  {     9,      4,      2,      0,      0, }, /* 556 */
+  {     9,      3,     12,      0,      0, }, /* 557 */
+  {    25,     25,     12,      0,      0, }, /* 558 */
+  {     0,     24,     12,      0,      0, }, /* 559 */
+  {     9,      6,      3,      0,      0, }, /* 560 */
+  {    35,      7,     12,      0,      0, }, /* 561 */
+  {    19,     14,     12,      0,      0, }, /* 562 */
+  {    19,     15,     12,      0,      0, }, /* 563 */
+  {    19,     26,     12,      0,      0, }, /* 564 */
+  {    70,      7,     12,      0,      0, }, /* 565 */
+  {    66,      7,     12,      0,      0, }, /* 566 */
+  {    41,      7,     12,      0,      0, }, /* 567 */
+  {    41,     15,     12,      0,      0, }, /* 568 */
+  {    18,      7,     12,      0,      0, }, /* 569 */
+  {    18,     14,     12,      0,      0, }, /* 570 */
+  {   117,      7,     12,      0,      0, }, /* 571 */
+  {   117,     12,      3,      0,      0, }, /* 572 */
+  {    59,      7,     12,      0,      0, }, /* 573 */
+  {    59,     21,     12,      0,      0, }, /* 574 */
+  {    42,      7,     12,      0,      0, }, /* 575 */
+  {    42,     21,     12,      0,      0, }, /* 576 */
+  {    42,     14,     12,      0,      0, }, /* 577 */
+  {    13,      9,     12,      0,     40, }, /* 578 */
+  {    13,      5,     12,      0,    -40, }, /* 579 */
+  {    46,      7,     12,      0,      0, }, /* 580 */
+  {    44,      7,     12,      0,      0, }, /* 581 */
+  {    44,     13,     12,      0,      0, }, /* 582 */
+  {   105,      7,     12,      0,      0, }, /* 583 */
+  {   103,      7,     12,      0,      0, }, /* 584 */
+  {   103,     21,     12,      0,      0, }, /* 585 */
+  {   109,      7,     12,      0,      0, }, /* 586 */
+  {    11,      7,     12,      0,      0, }, /* 587 */
+  {    80,      7,     12,      0,      0, }, /* 588 */
+  {    80,     21,     12,      0,      0, }, /* 589 */
+  {    80,     15,     12,      0,      0, }, /* 590 */
+  {   119,      7,     12,      0,      0, }, /* 591 */
+  {   119,     26,     12,      0,      0, }, /* 592 */
+  {   119,     15,     12,      0,      0, }, /* 593 */
+  {   115,      7,     12,      0,      0, }, /* 594 */
+  {   115,     15,     12,      0,      0, }, /* 595 */
+  {   127,      7,     12,      0,      0, }, /* 596 */
+  {   127,     15,     12,      0,      0, }, /* 597 */
+  {    65,      7,     12,      0,      0, }, /* 598 */
+  {    65,     15,     12,      0,      0, }, /* 599 */
+  {    65,     21,     12,      0,      0, }, /* 600 */
+  {    71,      7,     12,      0,      0, }, /* 601 */
+  {    71,     21,     12,      0,      0, }, /* 602 */
+  {    97,      7,     12,      0,      0, }, /* 603 */
+  {    96,      7,     12,      0,      0, }, /* 604 */
+  {    96,     15,     12,      0,      0, }, /* 605 */
+  {    30,      7,     12,      0,      0, }, /* 606 */
+  {    30,     12,      3,      0,      0, }, /* 607 */
+  {    30,     15,     12,      0,      0, }, /* 608 */
+  {    30,     21,     12,      0,      0, }, /* 609 */
+  {    87,      7,     12,      0,      0, }, /* 610 */
+  {    87,     15,     12,      0,      0, }, /* 611 */
+  {    87,     21,     12,      0,      0, }, /* 612 */
+  {   116,      7,     12,      0,      0, }, /* 613 */
+  {   116,     15,     12,      0,      0, }, /* 614 */
+  {   111,      7,     12,      0,      0, }, /* 615 */
+  {   111,     26,     12,      0,      0, }, /* 616 */
+  {   111,     12,      3,      0,      0, }, /* 617 */
+  {   111,     15,     12,      0,      0, }, /* 618 */
+  {   111,     21,     12,      0,      0, }, /* 619 */
+  {    77,      7,     12,      0,      0, }, /* 620 */
+  {    77,     21,     12,      0,      0, }, /* 621 */
+  {    82,      7,     12,      0,      0, }, /* 622 */
+  {    82,     15,     12,      0,      0, }, /* 623 */
+  {    81,      7,     12,      0,      0, }, /* 624 */
+  {    81,     15,     12,      0,      0, }, /* 625 */
+  {   120,      7,     12,      0,      0, }, /* 626 */
+  {   120,     21,     12,      0,      0, }, /* 627 */
+  {   120,     15,     12,      0,      0, }, /* 628 */
+  {    88,      7,     12,      0,      0, }, /* 629 */
+  {   129,      9,     12,      0,     64, }, /* 630 */
+  {   129,      5,     12,      0,    -64, }, /* 631 */
+  {   129,     15,     12,      0,      0, }, /* 632 */
+  {     0,     15,     12,      0,      0, }, /* 633 */
+  {    93,     10,      5,      0,      0, }, /* 634 */
+  {    93,     12,      3,      0,      0, }, /* 635 */
+  {    93,      7,     12,      0,      0, }, /* 636 */
+  {    93,     21,     12,      0,      0, }, /* 637 */
+  {    93,     15,     12,      0,      0, }, /* 638 */
+  {    93,     13,     12,      0,      0, }, /* 639 */
+  {    84,     12,      3,      0,      0, }, /* 640 */
+  {    84,     10,      5,      0,      0, }, /* 641 */
+  {    84,      7,     12,      0,      0, }, /* 642 */
+  {    84,     21,     12,      0,      0, }, /* 643 */
+  {    84,      1,      2,      0,      0, }, /* 644 */
+  {   100,      7,     12,      0,      0, }, /* 645 */
+  {   100,     13,     12,      0,      0, }, /* 646 */
+  {    95,     12,      3,      0,      0, }, /* 647 */
+  {    95,      7,     12,      0,      0, }, /* 648 */
+  {    95,     10,      5,      0,      0, }, /* 649 */
+  {    95,     13,     12,      0,      0, }, /* 650 */
+  {    95,     21,     12,      0,      0, }, /* 651 */
+  {   110,      7,     12,      0,      0, }, /* 652 */
+  {   110,     12,      3,      0,      0, }, /* 653 */
+  {   110,     21,     12,      0,      0, }, /* 654 */
+  {    99,     12,      3,      0,      0, }, /* 655 */
+  {    99,     10,      5,      0,      0, }, /* 656 */
+  {    99,      7,     12,      0,      0, }, /* 657 */
+  {    99,     21,     12,      0,      0, }, /* 658 */
+  {    99,     13,     12,      0,      0, }, /* 659 */
+  {    47,     15,     12,      0,      0, }, /* 660 */
+  {   107,      7,     12,      0,      0, }, /* 661 */
+  {   107,     10,      5,      0,      0, }, /* 662 */
+  {   107,     12,      3,      0,      0, }, /* 663 */
+  {   107,     21,     12,      0,      0, }, /* 664 */
+  {   128,      7,     12,      0,      0, }, /* 665 */
+  {   128,     21,     12,      0,      0, }, /* 666 */
+  {   108,      7,     12,      0,      0, }, /* 667 */
+  {   108,     12,      3,      0,      0, }, /* 668 */
+  {   108,     10,      5,      0,      0, }, /* 669 */
+  {   108,     13,     12,      0,      0, }, /* 670 */
+  {   106,     12,      3,      0,      0, }, /* 671 */
+  {   106,     10,      5,      0,      0, }, /* 672 */
+  {   106,      7,     12,      0,      0, }, /* 673 */
+  {   106,     10,      3,      0,      0, }, /* 674 */
+  {   123,      7,     12,      0,      0, }, /* 675 */
+  {   123,     10,      3,      0,      0, }, /* 676 */
+  {   123,     10,      5,      0,      0, }, /* 677 */
+  {   123,     12,      3,      0,      0, }, /* 678 */
+  {   123,     21,     12,      0,      0, }, /* 679 */
+  {   123,     13,     12,      0,      0, }, /* 680 */
+  {   122,      7,     12,      0,      0, }, /* 681 */
+  {   122,     10,      3,      0,      0, }, /* 682 */
+  {   122,     10,      5,      0,      0, }, /* 683 */
+  {   122,     12,      3,      0,      0, }, /* 684 */
+  {   122,     21,     12,      0,      0, }, /* 685 */
+  {   113,      7,     12,      0,      0, }, /* 686 */
+  {   113,     10,      5,      0,      0, }, /* 687 */
+  {   113,     12,      3,      0,      0, }, /* 688 */
+  {   113,     21,     12,      0,      0, }, /* 689 */
+  {   113,     13,     12,      0,      0, }, /* 690 */
+  {   101,      7,     12,      0,      0, }, /* 691 */
+  {   101,     12,      3,      0,      0, }, /* 692 */
+  {   101,     10,      5,      0,      0, }, /* 693 */
+  {   101,     13,     12,      0,      0, }, /* 694 */
+  {   125,      7,     12,      0,      0, }, /* 695 */
+  {   125,     12,      3,      0,      0, }, /* 696 */
+  {   125,     10,      5,      0,      0, }, /* 697 */
+  {   125,     13,     12,      0,      0, }, /* 698 */
+  {   125,     15,     12,      0,      0, }, /* 699 */
+  {   125,     21,     12,      0,      0, }, /* 700 */
+  {   125,     26,     12,      0,      0, }, /* 701 */
+  {   124,      9,     12,      0,     32, }, /* 702 */
+  {   124,      5,     12,      0,    -32, }, /* 703 */
+  {   124,     13,     12,      0,      0, }, /* 704 */
+  {   124,     15,     12,      0,      0, }, /* 705 */
+  {   124,      7,     12,      0,      0, }, /* 706 */
+  {   121,      7,     12,      0,      0, }, /* 707 */
+  {    62,      7,     12,      0,      0, }, /* 708 */
+  {    62,     14,     12,      0,      0, }, /* 709 */
+  {    62,     21,     12,      0,      0, }, /* 710 */
+  {    79,      7,     12,      0,      0, }, /* 711 */
+  {   126,      7,     12,      0,      0, }, /* 712 */
+  {   114,      7,     12,      0,      0, }, /* 713 */
+  {   114,     13,     12,      0,      0, }, /* 714 */
+  {   114,     21,     12,      0,      0, }, /* 715 */
+  {   102,      7,     12,      0,      0, }, /* 716 */
+  {   102,     12,      3,      0,      0, }, /* 717 */
+  {   102,     21,     12,      0,      0, }, /* 718 */
+  {   118,      7,     12,      0,      0, }, /* 719 */
+  {   118,     12,      3,      0,      0, }, /* 720 */
+  {   118,     21,     12,      0,      0, }, /* 721 */
+  {   118,     26,     12,      0,      0, }, /* 722 */
+  {   118,      6,     12,      0,      0, }, /* 723 */
+  {   118,     13,     12,      0,      0, }, /* 724 */
+  {   118,     15,     12,      0,      0, }, /* 725 */
+  {    98,      7,     12,      0,      0, }, /* 726 */
+  {    98,     10,      5,      0,      0, }, /* 727 */
+  {    98,     12,      3,      0,      0, }, /* 728 */
+  {    98,      6,     12,      0,      0, }, /* 729 */
+  {   104,      7,     12,      0,      0, }, /* 730 */
+  {   104,     26,     12,      0,      0, }, /* 731 */
+  {   104,     12,      3,      0,      0, }, /* 732 */
+  {   104,     21,     12,      0,      0, }, /* 733 */
+  {     9,     10,      3,      0,      0, }, /* 734 */
+  {    19,     12,      3,      0,      0, }, /* 735 */
+  {   130,     26,     12,      0,      0, }, /* 736 */
+  {   130,     12,      3,      0,      0, }, /* 737 */
+  {   130,     21,     12,      0,      0, }, /* 738 */
+  {   112,      7,     12,      0,      0, }, /* 739 */
+  {   112,     15,     12,      0,      0, }, /* 740 */
+  {   112,     12,      3,      0,      0, }, /* 741 */
+  {     9,     26,     11,      0,      0, }, /* 742 */
+  {    26,     26,     12,      0,      0, }, /* 743 */
 };
 
 const uint8_t PRIV(ucd_stage1)[] = { /* 8704 bytes */
@@ -839,19 +863,19 @@ const uint8_t PRIV(ucd_stage1)[] = { /* 8704 bytes */
 123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F000 */
 123,123, 95, 95,124,125,126,127,128,128,129,130,131,132,133,134, /* U+F800 */
 135,136,137,138,139,140,141,142,143,144,145,139,146,146,147,139, /* U+10000 */
-148,149,150,151,152,153,154,155,156,139,139,139,157,139,139,139, /* U+10800 */
-158,159,160,161,162,163,164,139,139,165,139,166,167,168,139,139, /* U+11000 */
-139,169,139,139,139,170,139,139,139,139,139,139,139,139,139,139, /* U+11800 */
-171,171,171,171,171,171,171,172,173,139,139,139,139,139,139,139, /* U+12000 */
+148,149,150,151,152,153,154,155,156,157,139,139,158,139,139,139, /* U+10800 */
+159,160,161,162,163,164,165,139,139,166,139,167,168,169,170,139, /* U+11000 */
+139,171,139,139,139,172,139,139,139,139,139,139,139,139,139,139, /* U+11800 */
+173,173,173,173,173,173,173,174,175,173,176,139,139,139,139,139, /* U+12000 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+12800 */
-174,174,174,174,174,174,174,174,175,139,139,139,139,139,139,139, /* U+13000 */
+177,177,177,177,177,177,177,177,178,139,139,139,139,139,139,139, /* U+13000 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+13800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+14000 */
+139,139,139,139,139,139,139,139,179,179,179,179,180,139,139,139, /* U+14000 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+14800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+15000 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+15800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+16000 */
-176,176,176,176,177,178,179,180,139,139,139,139,139,139,181,182, /* U+16800 */
+181,181,181,181,182,183,184,185,139,139,139,139,139,139,186,187, /* U+16800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+17000 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+17800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+18000 */
@@ -860,16 +884,16 @@ const uint8_t PRIV(ucd_stage1)[] = { /* 8704 bytes */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+19800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1A000 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1A800 */
-183,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1B000 */
-139,139,139,139,139,139,139,139,184,185,139,139,139,139,139,139, /* U+1B800 */
+188,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1B000 */
+139,139,139,139,139,139,139,139,189,190,139,139,139,139,139,139, /* U+1B800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1C000 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1C800 */
- 71,186,187,188,189,139,190,139,191,192,193,194,195,196,197,198, /* U+1D000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1D800 */
+ 71,191,192,193,194,139,195,139,196,197,198,199,200,201,202,203, /* U+1D000 */
+204,204,204,204,205,206,139,139,139,139,139,139,139,139,139,139, /* U+1D800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1E000 */
-199,200,139,139,139,139,139,139,139,139,139,139,201,202,139,139, /* U+1E800 */
-203,204,205,206,207,139,208,209, 71,210,211,212,213,214,215,216, /* U+1F000 */
-217,218,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1F800 */
+207,208,139,139,139,139,139,139,139,139,139,139,209,210,139,139, /* U+1E800 */
+211,212,213,214,215,139, 71,216, 71, 71,217,218, 71,219,220,221, /* U+1F000 */
+222,223,224,225,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1F800 */
  95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+20000 */
  95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+20800 */
  95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+21000 */
@@ -890,18 +914,18 @@ const uint8_t PRIV(ucd_stage1)[] = { /* 8704 bytes */
  95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+28800 */
  95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+29000 */
  95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+29800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,219, 95, 95, /* U+2A000 */
+ 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,226, 95, 95, /* U+2A000 */
  95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+2A800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,220, 95, /* U+2B000 */
-221,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2B800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2C000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2C800 */
+ 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,227, 95, /* U+2B000 */
+228, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+2B800 */
+ 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+2C000 */
+ 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,229,139,139, /* U+2C800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2D000 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2D800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2E000 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2E800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2F000 */
- 95, 95, 95, 95,221,139,139,139,139,139,139,139,139,139,139,139, /* U+2F800 */
+ 95, 95, 95, 95,230,139,139,139,139,139,139,139,139,139,139,139, /* U+2F800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+30000 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+30800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+31000 */
@@ -1254,8 +1278,8 @@ const uint8_t PRIV(ucd_stage1)[] = { /* 8704 bytes */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DE800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DF000 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DF800 */
-222,223,224,225,223,223,223,223,223,223,223,223,223,223,223,223, /* U+E0000 */
-223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223, /* U+E0800 */
+231,232,233,234,232,232,232,232,232,232,232,232,232,232,232,232, /* U+E0000 */
+232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232, /* U+E0800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E1000 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E1800 */
 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E2000 */
@@ -1317,7 +1341,7 @@ const uint8_t PRIV(ucd_stage1)[] = { /* 8704 bytes */
 123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FE000 */
 123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FE800 */
 123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FF000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,226, /* U+FF800 */
+123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,235, /* U+FF800 */
 123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+100000 */
 123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+100800 */
 123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+101000 */
@@ -1349,10 +1373,10 @@ const uint8_t PRIV(ucd_stage1)[] = { /* 8704 bytes */
 123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10E000 */
 123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10E800 */
 123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10F000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,226, /* U+10F800 */
+123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,235, /* U+10F800 */
 };
 
-const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
+const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
 /* block 0 */
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  2,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
@@ -1405,533 +1429,533 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
 
 /* block 5 */
  99, 33, 33, 99, 33, 33, 33,100, 99,101,102,102,103, 33, 33, 33,
- 33, 33,104, 33, 20, 33, 33, 33, 33, 33, 33, 33, 33, 33,105, 33,
+ 33, 33,104, 33, 20, 33, 33, 33, 33, 33, 33, 33, 33,105,106, 33,
  33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
-106,106,106,106,106,106,106,106,106,107,107,107,107,107,107,107,
-107,107, 14, 14, 14, 14,107,107,107,107,107,107,107,107,107,107,
-107,107, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-106,106,106,106,106, 14, 14, 14, 14, 14,108,108,107, 14,107, 14,
+107,107,107,107,107,107,107,107,107,108,108,108,108,108,108,108,
+108,108, 14, 14, 14, 14,108,108,108,108,108,108,108,108,108,108,
+108,108, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+107,107,107,107,107, 14, 14, 14, 14, 14,109,109,108, 14,108, 14,
  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
 
 /* block 6 */
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,110,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-111,112,111,112,107,113,111,112,114,114,115,116,116,116,  4,117,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,111,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+112,113,112,113,108,114,112,113,115,115,116,117,117,117,  4,118,
 
 /* block 7 */
-114,114,114,114,113, 14,118,  4,119,119,119,114,120,114,121,121,
-122,123,124,123,123,125,123,123,126,127,128,123,129,123,123,123,
-130,131,114,132,123,123,133,123,123,134,123,123,135,136,136,136,
-122,137,138,137,137,139,137,137,140,141,142,137,143,137,137,137,
-144,145,146,147,137,137,148,137,137,149,137,137,150,151,151,152,
-153,154,155,155,155,156,157,158,111,112,111,112,111,112,111,112,
-111,112,159,160,159,160,159,160,159,160,159,160,159,160,159,160,
-161,162,163,164,165,166,167,111,112,168,111,112,122,169,169,169,
+115,115,115,115,114, 14,119,  4,120,120,120,115,121,115,122,122,
+123,124,125,124,124,126,124,124,127,128,129,124,130,124,124,124,
+131,132,115,133,124,124,134,124,124,135,124,124,136,137,137,137,
+123,138,139,138,138,140,138,138,141,142,143,138,144,138,138,138,
+145,146,147,148,138,138,149,138,138,150,138,138,151,152,152,153,
+154,155,156,156,156,157,158,159,112,113,112,113,112,113,112,113,
+112,113,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
+162,163,164,165,166,167,168,112,113,169,112,113,123,170,170,170,
 
 /* block 8 */
-170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,
-171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,
 171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,
 172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,
 172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,
 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
+173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
+174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
 
 /* block 9 */
-174,175,176,177,177,109,109,177,178,178,174,175,174,175,174,175,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
-179,174,175,174,175,174,175,174,175,174,175,174,175,174,175,180,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
+175,176,177,178,178,110,110,178,179,179,175,176,175,176,175,176,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+180,175,176,175,176,175,176,175,176,175,176,175,176,175,176,181,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
 
 /* block 10 */
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
-114,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
-181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
-181,181,181,181,181,181,181,114,114,182,183,183,183,183,183,183,
-114,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,
-184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+115,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,
+182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,
+182,182,182,182,182,182,182,115,115,183,184,184,184,184,184,184,
+115,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,
+185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,
 
 /* block 11 */
-184,184,184,184,184,184,184,185,114,  4,186,114,114,187,187,188,
-114,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,
-189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,
-189,189,189,189,189,189,189,189,189,189,189,189,189,189,190,189,
-191,189,189,191,189,189,191,189,114,114,114,114,114,114,114,114,
-192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
-192,192,192,192,192,192,192,192,192,192,192,114,114,114,114,114,
-192,192,192,191,191,114,114,114,114,114,114,114,114,114,114,114,
+185,185,185,185,185,185,185,186,115,  4,187,115,115,188,188,189,
+115,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,
+190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,
+190,190,190,190,190,190,190,190,190,190,190,190,190,190,191,190,
+192,190,190,192,190,190,192,190,115,115,115,115,115,115,115,115,
+193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,
+193,193,193,193,193,193,193,193,193,193,193,115,115,115,115,115,
+193,193,193,192,192,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 12 */
-193,193,193,193,193, 22,194,194,194,195,195,196,  4,195,197,197,
-198,198,198,198,198,198,198,198,198,198,198,  4, 22,114,195,  4,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-107,199,199,199,199,199,199,199,199,199,199,109,109,109,109,109,
-109,109,109,109,109,109,198,198,198,198,198,198,198,198,198,198,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,195,195,195,195,199,199,
-109,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
+194,194,194,194,194, 22,195,195,195,196,196,197,  4,196,198,198,
+199,199,199,199,199,199,199,199,199,199,199,  4, 22,115,196,  4,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+108,200,200,200,200,200,200,200,200,200,200,110,110,110,110,110,
+110,110,110,110,110,110,199,199,199,199,199,199,199,199,199,199,
+201,201,201,201,201,201,201,201,201,201,196,196,196,196,200,200,
+110,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
 
 /* block 13 */
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,195,199,198,198,198,198,198,198,198, 22,197,198,
-198,198,198,198,198,200,200,198,198,197,198,198,198,198,199,199,
-201,201,201,201,201,201,201,201,201,201,199,199,199,197,197,199,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,196,200,199,199,199,199,199,199,199, 22,198,199,
+199,199,199,199,199,202,202,199,199,198,199,199,199,199,200,200,
+201,201,201,201,201,201,201,201,201,201,200,200,200,198,198,200,
 
 /* block 14 */
-202,202,202,202,202,202,202,202,202,202,202,202,202,202,114,203,
-204,205,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
-204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
+203,203,203,203,203,203,203,203,203,203,203,203,203,203,115,204,
+205,206,205,205,205,205,205,205,205,205,205,205,205,205,205,205,
 205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,
-205,205,205,205,205,205,205,205,205,205,205,114,114,204,204,204,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
+206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,
+206,206,206,206,206,206,206,206,206,206,206,115,115,205,205,205,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
 
 /* block 15 */
-206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,
-206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,
-206,206,206,206,206,206,207,207,207,207,207,207,207,207,207,207,
-207,206,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-208,208,208,208,208,208,208,208,208,208,209,209,209,209,209,209,
-209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,
-209,209,209,209,209,209,209,209,209,209,209,210,210,210,210,210,
-210,210,210,210,211,211,212,213,213,213,211,114,114,114,114,114,
+207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,
+207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,
+207,207,207,207,207,207,208,208,208,208,208,208,208,208,208,208,
+208,207,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+209,209,209,209,209,209,209,209,209,209,210,210,210,210,210,210,
+210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,
+210,210,210,210,210,210,210,210,210,210,210,211,211,211,211,211,
+211,211,211,211,212,212,213,214,214,214,212,115,115,115,115,115,
 
 /* block 16 */
-214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,
-214,214,214,214,214,214,215,215,215,215,216,215,215,215,215,215,
-215,215,215,215,216,215,215,215,216,215,215,215,215,215,114,114,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,114,
-218,218,218,218,218,218,218,218,218,218,218,218,218,218,218,218,
-218,218,218,218,218,218,218,218,218,219,219,219,114,114,220,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
+215,215,215,215,215,215,216,216,216,216,217,216,216,216,216,216,
+216,216,216,216,217,216,216,216,217,216,216,216,216,216,115,115,
+218,218,218,218,218,218,218,218,218,218,218,218,218,218,218,115,
+219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
+219,219,219,219,219,219,219,219,219,220,220,220,115,115,221,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 17 */
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,199,199,199,199,199,199,199,199,199,199,199,199,199,
 199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,198,198,198,198,198,198,198,198,198,198,198,198,
-198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,
 
 /* block 18 */
-221,221,221,222,223,223,223,223,223,223,223,223,223,223,223,223,
-223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,
-223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,
-223,223,223,223,223,223,223,223,223,223,221,222,221,223,222,222,
-222,221,221,221,221,221,221,221,221,222,222,222,222,221,222,222,
-223,109,109,221,221,221,221,221,223,223,223,223,223,223,223,223,
-223,223,221,221,  4,  4,224,224,224,224,224,224,224,224,224,224,
-225,226,223,223,223,223,223,223,223,223,223,223,223,223,223,223,
+222,222,222,223,224,224,224,224,224,224,224,224,224,224,224,224,
+224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,
+224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,
+224,224,224,224,224,224,224,224,224,224,222,223,222,224,223,223,
+223,222,222,222,222,222,222,222,222,223,223,223,223,222,223,223,
+224,110,110,222,222,222,222,222,224,224,224,224,224,224,224,224,
+224,224,222,222,  4,  4,225,225,225,225,225,225,225,225,225,225,
+226,227,224,224,224,224,224,224,224,224,224,224,224,224,224,224,
 
 /* block 19 */
-227,228,229,229,114,227,227,227,227,227,227,227,227,114,114,227,
-227,114,114,227,227,227,227,227,227,227,227,227,227,227,227,227,
-227,227,227,227,227,227,227,227,227,114,227,227,227,227,227,227,
-227,114,227,114,114,114,227,227,227,227,114,114,228,227,230,229,
-229,228,228,228,228,114,114,229,229,114,114,229,229,228,227,114,
-114,114,114,114,114,114,114,230,114,114,114,114,227,227,114,227,
-227,227,228,228,114,114,231,231,231,231,231,231,231,231,231,231,
-227,227,232,232,233,233,233,233,233,233,234,232,114,114,114,114,
+228,229,230,230,115,228,228,228,228,228,228,228,228,115,115,228,
+228,115,115,228,228,228,228,228,228,228,228,228,228,228,228,228,
+228,228,228,228,228,228,228,228,228,115,228,228,228,228,228,228,
+228,115,228,115,115,115,228,228,228,228,115,115,229,228,231,230,
+230,229,229,229,229,115,115,230,230,115,115,230,230,229,228,115,
+115,115,115,115,115,115,115,231,115,115,115,115,228,228,115,228,
+228,228,229,229,115,115,232,232,232,232,232,232,232,232,232,232,
+228,228,233,233,234,234,234,234,234,234,235,233,115,115,115,115,
 
 /* block 20 */
-114,235,235,236,114,237,237,237,237,237,237,114,114,114,114,237,
-237,114,114,237,237,237,237,237,237,237,237,237,237,237,237,237,
-237,237,237,237,237,237,237,237,237,114,237,237,237,237,237,237,
-237,114,237,237,114,237,237,114,237,237,114,114,235,114,236,236,
-236,235,235,114,114,114,114,235,235,114,114,235,235,235,114,114,
-114,235,114,114,114,114,114,114,114,237,237,237,237,114,237,114,
-114,114,114,114,114,114,238,238,238,238,238,238,238,238,238,238,
-235,235,237,237,237,235,114,114,114,114,114,114,114,114,114,114,
+115,236,236,237,115,238,238,238,238,238,238,115,115,115,115,238,
+238,115,115,238,238,238,238,238,238,238,238,238,238,238,238,238,
+238,238,238,238,238,238,238,238,238,115,238,238,238,238,238,238,
+238,115,238,238,115,238,238,115,238,238,115,115,236,115,237,237,
+237,236,236,115,115,115,115,236,236,115,115,236,236,236,115,115,
+115,236,115,115,115,115,115,115,115,238,238,238,238,115,238,115,
+115,115,115,115,115,115,239,239,239,239,239,239,239,239,239,239,
+236,236,238,238,238,236,115,115,115,115,115,115,115,115,115,115,
 
 /* block 21 */
-114,239,239,240,114,241,241,241,241,241,241,241,241,241,114,241,
-241,241,114,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,114,241,241,241,241,241,241,
-241,114,241,241,114,241,241,241,241,241,114,114,239,241,240,240,
-240,239,239,239,239,239,114,239,239,240,114,240,240,239,114,114,
-241,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-241,241,239,239,114,114,242,242,242,242,242,242,242,242,242,242,
-243,244,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+115,240,240,241,115,242,242,242,242,242,242,242,242,242,115,242,
+242,242,115,242,242,242,242,242,242,242,242,242,242,242,242,242,
+242,242,242,242,242,242,242,242,242,115,242,242,242,242,242,242,
+242,115,242,242,115,242,242,242,242,242,115,115,240,242,241,241,
+241,240,240,240,240,240,115,240,240,241,115,241,241,240,115,115,
+242,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+242,242,240,240,115,115,243,243,243,243,243,243,243,243,243,243,
+244,245,115,115,115,115,115,115,115,242,115,115,115,115,115,115,
 
 /* block 22 */
-114,245,246,246,114,247,247,247,247,247,247,247,247,114,114,247,
-247,114,114,247,247,247,247,247,247,247,247,247,247,247,247,247,
-247,247,247,247,247,247,247,247,247,114,247,247,247,247,247,247,
-247,114,247,247,114,247,247,247,247,247,114,114,245,247,248,245,
-246,245,245,245,245,114,114,246,246,114,114,246,246,245,114,114,
-114,114,114,114,114,114,245,248,114,114,114,114,247,247,114,247,
-247,247,245,245,114,114,249,249,249,249,249,249,249,249,249,249,
-250,247,251,251,251,251,251,251,114,114,114,114,114,114,114,114,
+115,246,247,247,115,248,248,248,248,248,248,248,248,115,115,248,
+248,115,115,248,248,248,248,248,248,248,248,248,248,248,248,248,
+248,248,248,248,248,248,248,248,248,115,248,248,248,248,248,248,
+248,115,248,248,115,248,248,248,248,248,115,115,246,248,249,246,
+247,246,246,246,246,115,115,247,247,115,115,247,247,246,115,115,
+115,115,115,115,115,115,246,249,115,115,115,115,248,248,115,248,
+248,248,246,246,115,115,250,250,250,250,250,250,250,250,250,250,
+251,248,252,252,252,252,252,252,115,115,115,115,115,115,115,115,
 
 /* block 23 */
-114,114,252,253,114,253,253,253,253,253,253,114,114,114,253,253,
-253,114,253,253,253,253,114,114,114,253,253,114,253,114,253,253,
-114,114,114,253,253,114,114,114,253,253,253,114,114,114,253,253,
-253,253,253,253,253,253,253,253,253,253,114,114,114,114,254,255,
-252,255,255,114,114,114,255,255,255,114,255,255,255,252,114,114,
-253,114,114,114,114,114,114,254,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,256,256,256,256,256,256,256,256,256,256,
-257,257,257,258,258,258,258,258,258,259,258,114,114,114,114,114,
+115,115,253,254,115,254,254,254,254,254,254,115,115,115,254,254,
+254,115,254,254,254,254,115,115,115,254,254,115,254,115,254,254,
+115,115,115,254,254,115,115,115,254,254,254,115,115,115,254,254,
+254,254,254,254,254,254,254,254,254,254,115,115,115,115,255,256,
+253,256,256,115,115,115,256,256,256,115,256,256,256,253,115,115,
+254,115,115,115,115,115,115,255,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,257,257,257,257,257,257,257,257,257,257,
+258,258,258,259,259,259,259,259,259,260,259,115,115,115,115,115,
 
 /* block 24 */
-260,261,261,261,114,262,262,262,262,262,262,262,262,114,262,262,
-262,114,262,262,262,262,262,262,262,262,262,262,262,262,262,262,
-262,262,262,262,262,262,262,262,262,114,262,262,262,262,262,262,
-262,262,262,262,262,262,262,262,262,262,114,114,114,262,260,260,
-260,261,261,261,261,114,260,260,260,114,260,260,260,260,114,114,
-114,114,114,114,114,260,260,114,262,262,114,114,114,114,114,114,
-262,262,260,260,114,114,263,263,263,263,263,263,263,263,263,263,
-114,114,114,114,114,114,114,114,264,264,264,264,264,264,264,265,
+261,262,262,262,115,263,263,263,263,263,263,263,263,115,263,263,
+263,115,263,263,263,263,263,263,263,263,263,263,263,263,263,263,
+263,263,263,263,263,263,263,263,263,115,263,263,263,263,263,263,
+263,263,263,263,263,263,263,263,263,263,115,115,115,263,261,261,
+261,262,262,262,262,115,261,261,261,115,261,261,261,261,115,115,
+115,115,115,115,115,261,261,115,263,263,263,115,115,115,115,115,
+263,263,261,261,115,115,264,264,264,264,264,264,264,264,264,264,
+115,115,115,115,115,115,115,115,265,265,265,265,265,265,265,266,
 
 /* block 25 */
-114,266,267,267,114,268,268,268,268,268,268,268,268,114,268,268,
-268,114,268,268,268,268,268,268,268,268,268,268,268,268,268,268,
-268,268,268,268,268,268,268,268,268,114,268,268,268,268,268,268,
-268,268,268,268,114,268,268,268,268,268,114,114,266,268,267,266,
-267,267,269,267,267,114,266,267,267,114,267,267,266,266,114,114,
-114,114,114,114,114,269,269,114,114,114,114,114,114,114,268,114,
-268,268,266,266,114,114,270,270,270,270,270,270,270,270,270,270,
-114,268,268,114,114,114,114,114,114,114,114,114,114,114,114,114,
+115,267,268,268,115,269,269,269,269,269,269,269,269,115,269,269,
+269,115,269,269,269,269,269,269,269,269,269,269,269,269,269,269,
+269,269,269,269,269,269,269,269,269,115,269,269,269,269,269,269,
+269,269,269,269,115,269,269,269,269,269,115,115,267,269,268,267,
+268,268,270,268,268,115,267,268,268,115,268,268,267,267,115,115,
+115,115,115,115,115,270,270,115,115,115,115,115,115,115,269,115,
+269,269,267,267,115,115,271,271,271,271,271,271,271,271,271,271,
+115,269,269,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 26 */
-114,271,272,272,114,273,273,273,273,273,273,273,273,114,273,273,
-273,114,273,273,273,273,273,273,273,273,273,273,273,273,273,273,
-273,273,273,273,273,273,273,273,273,273,273,273,273,273,273,273,
-273,273,273,273,273,273,273,273,273,273,273,114,114,273,274,272,
-272,271,271,271,271,114,272,272,272,114,272,272,272,271,273,114,
-114,114,114,114,114,114,114,274,114,114,114,114,114,114,114,114,
-273,273,271,271,114,114,275,275,275,275,275,275,275,275,275,275,
-276,276,276,276,276,276,114,114,114,277,273,273,273,273,273,273,
+115,272,273,273,115,274,274,274,274,274,274,274,274,115,274,274,
+274,115,274,274,274,274,274,274,274,274,274,274,274,274,274,274,
+274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,
+274,274,274,274,274,274,274,274,274,274,274,115,115,274,275,273,
+273,272,272,272,272,115,273,273,273,115,273,273,273,272,274,115,
+115,115,115,115,115,115,115,275,115,115,115,115,115,115,115,274,
+274,274,272,272,115,115,276,276,276,276,276,276,276,276,276,276,
+277,277,277,277,277,277,115,115,115,278,274,274,274,274,274,274,
 
 /* block 27 */
-114,114,278,278,114,279,279,279,279,279,279,279,279,279,279,279,
-279,279,279,279,279,279,279,114,114,114,279,279,279,279,279,279,
-279,279,279,279,279,279,279,279,279,279,279,279,279,279,279,279,
-279,279,114,279,279,279,279,279,279,279,279,279,114,279,114,114,
-279,279,279,279,279,279,279,114,114,114,280,114,114,114,114,281,
-278,278,280,280,280,114,280,114,278,278,278,278,278,278,278,281,
-114,114,114,114,114,114,282,282,282,282,282,282,282,282,282,282,
-114,114,278,278,283,114,114,114,114,114,114,114,114,114,114,114,
+115,115,279,279,115,280,280,280,280,280,280,280,280,280,280,280,
+280,280,280,280,280,280,280,115,115,115,280,280,280,280,280,280,
+280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
+280,280,115,280,280,280,280,280,280,280,280,280,115,280,115,115,
+280,280,280,280,280,280,280,115,115,115,281,115,115,115,115,282,
+279,279,281,281,281,115,281,115,279,279,279,279,279,279,279,282,
+115,115,115,115,115,115,283,283,283,283,283,283,283,283,283,283,
+115,115,279,279,284,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 28 */
-114,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,
-284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,
-284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,
-284,285,284,286,285,285,285,285,285,285,285,114,114,114,114,  5,
-284,284,284,284,284,284,287,285,285,285,285,285,285,285,285,288,
-289,289,289,289,289,289,289,289,289,289,288,288,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+115,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,
+285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,
+285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,
+285,286,285,287,286,286,286,286,286,286,286,115,115,115,115,  5,
+285,285,285,285,285,285,288,286,286,286,286,286,286,286,286,289,
+290,290,290,290,290,290,290,290,290,290,289,289,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 29 */
-114,290,290,114,290,114,114,290,290,114,290,114,114,290,114,114,
-114,114,114,114,290,290,290,290,114,290,290,290,290,290,290,290,
-114,290,290,290,114,290,114,290,114,114,290,290,114,290,290,290,
-290,291,290,292,291,291,291,291,291,291,114,291,291,290,114,114,
-290,290,290,290,290,114,293,114,291,291,291,291,291,291,114,114,
-294,294,294,294,294,294,294,294,294,294,114,114,290,290,290,290,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+115,291,291,115,291,115,115,291,291,115,291,115,115,291,115,115,
+115,115,115,115,291,291,291,291,115,291,291,291,291,291,291,291,
+115,291,291,291,115,291,115,291,115,115,291,291,115,291,291,291,
+291,292,291,293,292,292,292,292,292,292,115,292,292,291,115,115,
+291,291,291,291,291,115,294,115,292,292,292,292,292,292,115,115,
+295,295,295,295,295,295,295,295,295,295,115,115,291,291,291,291,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 30 */
-295,296,296,296,297,297,297,297,297,297,297,297,297,297,297,297,
-297,297,297,296,297,296,296,296,298,298,296,296,296,296,296,296,
-299,299,299,299,299,299,299,299,299,299,300,300,300,300,300,300,
-300,300,300,300,296,298,296,298,296,298,301,302,301,302,303,303,
-295,295,295,295,295,295,295,295,114,295,295,295,295,295,295,295,
-295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
-295,295,295,295,295,295,295,295,295,295,295,295,295,114,114,114,
-114,298,298,298,298,298,298,298,298,298,298,298,298,298,298,303,
+296,297,297,297,298,298,298,298,298,298,298,298,298,298,298,298,
+298,298,298,297,298,297,297,297,299,299,297,297,297,297,297,297,
+300,300,300,300,300,300,300,300,300,300,301,301,301,301,301,301,
+301,301,301,301,297,299,297,299,297,299,302,303,302,303,304,304,
+296,296,296,296,296,296,296,296,115,296,296,296,296,296,296,296,
+296,296,296,296,296,296,296,296,296,296,296,296,296,296,296,296,
+296,296,296,296,296,296,296,296,296,296,296,296,296,115,115,115,
+115,299,299,299,299,299,299,299,299,299,299,299,299,299,299,304,
 
 /* block 31 */
-298,298,298,298,298,297,298,298,295,295,295,295,295,298,298,298,
-298,298,298,298,298,298,298,298,114,298,298,298,298,298,298,298,
-298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,
-298,298,298,298,298,298,298,298,298,298,298,298,298,114,296,296,
-296,296,296,296,296,296,298,296,296,296,296,296,296,114,296,296,
-297,297,297,297,297, 19, 19, 19, 19,297,297,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+299,299,299,299,299,298,299,299,296,296,296,296,296,299,299,299,
+299,299,299,299,299,299,299,299,115,299,299,299,299,299,299,299,
+299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,
+299,299,299,299,299,299,299,299,299,299,299,299,299,115,297,297,
+297,297,297,297,297,297,299,297,297,297,297,297,297,115,297,297,
+298,298,298,298,298, 19, 19, 19, 19,298,298,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 32 */
-304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,
-304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,
-304,304,304,304,304,304,304,304,304,304,304,305,305,306,306,306,
-306,307,306,306,306,306,306,306,305,306,306,307,307,306,306,304,
-308,308,308,308,308,308,308,308,308,308,309,309,309,309,309,309,
-304,304,304,304,304,304,307,307,306,306,304,304,304,304,306,306,
-306,304,305,305,305,304,304,305,305,305,305,305,305,305,304,304,
-304,306,306,306,306,304,304,304,304,304,304,304,304,304,304,304,
+305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,
+305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,
+305,305,305,305,305,305,305,305,305,305,305,306,306,307,307,307,
+307,308,307,307,307,307,307,307,306,307,307,308,308,307,307,305,
+309,309,309,309,309,309,309,309,309,309,310,310,310,310,310,310,
+305,305,305,305,305,305,308,308,307,307,305,305,305,305,307,307,
+307,305,306,306,306,305,305,306,306,306,306,306,306,306,305,305,
+305,307,307,307,307,305,305,305,305,305,305,305,305,305,305,305,
 
 /* block 33 */
-304,304,306,305,307,306,306,305,305,305,305,305,305,306,304,305,
-308,308,308,308,308,308,308,308,308,308,305,305,305,306,310,310,
-311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,
-311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,
-311,311,311,311,311,311,114,311,114,114,114,114,114,311,114,114,
+305,305,307,306,308,307,307,306,306,306,306,306,306,307,305,306,
+309,309,309,309,309,309,309,309,309,309,306,306,306,307,311,311,
 312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,
 312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,
-312,312,312,312,312,312,312,312,312,312,312,  4,313,312,312,312,
+312,312,312,312,312,312,115,312,115,115,115,115,115,312,115,115,
+313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,
+313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,
+313,313,313,313,313,313,313,313,313,313,313,  4,314,313,313,313,
 
 /* block 34 */
-314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,
-314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,
-314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,
-314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,
-314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,
-314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,
 315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
 315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
-
-/* block 35 */
 315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
 315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
-315,315,315,315,315,315,315,315,316,316,316,316,316,316,316,316,
-316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,
+315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
+315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,
 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,
+
+/* block 35 */
 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,
 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,
-
-/* block 36 */
+316,316,316,316,316,316,316,316,317,317,317,317,317,317,317,317,
 317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
 317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
 317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
 317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,114,317,317,317,317,114,114,
-317,317,317,317,317,317,317,114,317,114,317,317,317,317,114,114,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
 317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
 
+/* block 36 */
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,318,318,115,318,318,318,318,115,115,
+318,318,318,318,318,318,318,115,318,115,318,318,318,318,115,115,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+
 /* block 37 */
-317,317,317,317,317,317,317,317,317,114,317,317,317,317,114,114,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,114,317,317,317,317,114,114,317,317,317,317,317,317,317,114,
-317,114,317,317,317,317,114,114,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,114,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
+318,318,318,318,318,318,318,318,318,115,318,318,318,318,115,115,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,115,318,318,318,318,115,115,318,318,318,318,318,318,318,115,
+318,115,318,318,318,318,115,115,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,115,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
 
 /* block 38 */
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,114,317,317,317,317,114,114,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,114,114,318,318,318,
-319,319,319,319,319,319,319,319,319,320,320,320,320,320,320,320,
-320,320,320,320,320,320,320,320,320,320,320,320,320,114,114,114,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,115,318,318,318,318,115,115,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,318,318,318,318,115,115,319,319,319,
+320,320,320,320,320,320,320,320,320,321,321,321,321,321,321,321,
+321,321,321,321,321,321,321,321,321,321,321,321,321,115,115,115,
 
 /* block 39 */
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-321,321,321,321,321,321,321,321,321,321,114,114,114,114,114,114,
-322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,
-322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,
-322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,
-322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,
-322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,
-322,322,322,322,322,114,114,114,114,114,114,114,114,114,114,114,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+322,322,322,322,322,322,322,322,322,322,115,115,115,115,115,115,
+323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
+323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
+323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
+323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
+323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
+324,324,324,324,324,324,115,115,325,325,325,325,325,325,115,115,
 
 /* block 40 */
-323,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
+326,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
 
 /* block 41 */
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
 
 /* block 42 */
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,325,325,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,328,328,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
 
 /* block 43 */
-326,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,328,329,114,114,114,
-330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,
-330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,
-330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,
-330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,
-330,330,330,330,330,330,330,330,330,330,330,  4,  4,  4,331,331,
-331,330,330,330,330,330,330,330,330,114,114,114,114,114,114,114,
+329,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,
+330,330,330,330,330,330,330,330,330,330,330,331,332,115,115,115,
+333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
+333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
+333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
+333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
+333,333,333,333,333,333,333,333,333,333,333,  4,  4,  4,334,334,
+334,333,333,333,333,333,333,333,333,115,115,115,115,115,115,115,
 
 /* block 44 */
-332,332,332,332,332,332,332,332,332,332,332,332,332,114,332,332,
-332,332,333,333,333,114,114,114,114,114,114,114,114,114,114,114,
-334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,
-334,334,335,335,335,  4,  4,114,114,114,114,114,114,114,114,114,
-336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
-336,336,337,337,114,114,114,114,114,114,114,114,114,114,114,114,
-338,338,338,338,338,338,338,338,338,338,338,338,338,114,338,338,
-338,114,339,339,114,114,114,114,114,114,114,114,114,114,114,114,
+335,335,335,335,335,335,335,335,335,335,335,335,335,115,335,335,
+335,335,336,336,336,115,115,115,115,115,115,115,115,115,115,115,
+337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,
+337,337,338,338,338,  4,  4,115,115,115,115,115,115,115,115,115,
+339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,
+339,339,340,340,115,115,115,115,115,115,115,115,115,115,115,115,
+341,341,341,341,341,341,341,341,341,341,341,341,341,115,341,341,
+341,115,342,342,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 45 */
-340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,
-340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,
-340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,
-340,340,340,340,341,341,342,341,341,341,341,341,341,341,342,342,
-342,342,342,342,342,342,341,342,342,341,341,341,341,341,341,341,
-341,341,341,341,343,343,343,344,343,343,343,345,340,341,114,114,
-346,346,346,346,346,346,346,346,346,346,114,114,114,114,114,114,
-347,347,347,347,347,347,347,347,347,347,114,114,114,114,114,114,
+343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
+343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
+343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
+343,343,343,343,344,344,345,344,344,344,344,344,344,344,345,345,
+345,345,345,345,345,345,344,345,345,344,344,344,344,344,344,344,
+344,344,344,344,346,346,346,347,346,346,346,348,343,344,115,115,
+349,349,349,349,349,349,349,349,349,349,115,115,115,115,115,115,
+350,350,350,350,350,350,350,350,350,350,115,115,115,115,115,115,
 
 /* block 46 */
-348,348,  4,  4,348,  4,349,348,348,348,348,350,350,350,351,114,
-352,352,352,352,352,352,352,352,352,352,114,114,114,114,114,114,
-353,353,353,353,353,353,353,353,353,353,353,353,353,353,353,353,
-353,353,353,353,353,353,353,353,353,353,353,353,353,353,353,353,
-353,353,353,354,353,353,353,353,353,353,353,353,353,353,353,353,
-353,353,353,353,353,353,353,353,353,353,353,353,353,353,353,353,
-353,353,353,353,353,353,353,353,353,353,353,353,353,353,353,353,
-353,353,353,353,353,353,353,353,114,114,114,114,114,114,114,114,
+351,351,  4,  4,351,  4,352,351,351,351,351,353,353,353,354,115,
+355,355,355,355,355,355,355,355,355,355,115,115,115,115,115,115,
+356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
+356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
+356,356,356,357,356,356,356,356,356,356,356,356,356,356,356,356,
+356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
+356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
+356,356,356,356,356,356,356,356,115,115,115,115,115,115,115,115,
 
 /* block 47 */
-353,353,353,353,353,353,353,353,353,353,353,353,353,353,353,353,
-353,353,353,353,353,353,353,353,353,353,353,353,353,353,353,353,
-353,353,353,353,353,353,353,353,353,350,353,114,114,114,114,114,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,324,
-324,324,324,324,324,324,114,114,114,114,114,114,114,114,114,114,
+356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
+356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
+356,356,356,356,356,356,356,356,356,353,356,115,115,115,115,115,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+327,327,327,327,327,327,115,115,115,115,115,115,115,115,115,115,
 
 /* block 48 */
-355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,
-355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,114,
-356,356,356,357,357,357,357,356,356,357,357,357,114,114,114,114,
-357,357,356,357,357,357,357,357,357,356,356,356,114,114,114,114,
-358,114,114,114,359,359,360,360,360,360,360,360,360,360,360,360,
-361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,
-361,361,361,361,361,361,361,361,361,361,361,361,361,361,114,114,
-361,361,361,361,361,114,114,114,114,114,114,114,114,114,114,114,
+358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,
+358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,115,
+359,359,359,360,360,360,360,359,359,360,360,360,115,115,115,115,
+360,360,359,360,360,360,360,360,360,359,359,359,115,115,115,115,
+361,115,115,115,362,362,363,363,363,363,363,363,363,363,363,363,
+364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,
+364,364,364,364,364,364,364,364,364,364,364,364,364,364,115,115,
+364,364,364,364,364,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 49 */
-362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,
-362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,
-362,362,362,362,362,362,362,362,362,362,362,362,114,114,114,114,
-363,363,363,363,363,364,364,364,363,363,364,363,363,363,363,363,
-363,362,362,362,362,362,362,362,363,363,114,114,114,114,114,114,
-365,365,365,365,365,365,365,365,365,365,366,114,114,114,367,367,
-368,368,368,368,368,368,368,368,368,368,368,368,368,368,368,368,
-368,368,368,368,368,368,368,368,368,368,368,368,368,368,368,368,
+365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,
+365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,
+365,365,365,365,365,365,365,365,365,365,365,365,115,115,115,115,
+365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,
+365,365,365,365,365,365,365,365,365,365,115,115,115,115,115,115,
+366,366,366,366,366,366,366,366,366,366,367,115,115,115,368,368,
+369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,
+369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,
 
 /* block 50 */
-369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,
-369,369,369,369,369,369,369,370,370,371,371,370,114,114,372,372,
-373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,
-373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,
-373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,
-373,373,373,373,373,374,375,374,375,375,375,375,375,375,375,114,
-375,376,375,376,376,375,375,375,375,375,375,375,375,374,374,374,
-374,374,374,375,375,375,375,375,375,375,375,375,375,114,114,375,
+370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,
+370,370,370,370,370,370,370,371,371,372,372,371,115,115,373,373,
+374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
+374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
+374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
+374,374,374,374,374,375,376,375,376,376,376,376,376,376,376,115,
+376,377,376,377,377,376,376,376,376,376,376,376,376,375,375,375,
+375,375,375,376,376,376,376,376,376,376,376,376,376,115,115,376,
 
 /* block 51 */
-377,377,377,377,377,377,377,377,377,377,114,114,114,114,114,114,
-377,377,377,377,377,377,377,377,377,377,114,114,114,114,114,114,
-378,378,378,378,378,378,378,379,378,378,378,378,378,378,114,114,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,380,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+378,378,378,378,378,378,378,378,378,378,115,115,115,115,115,115,
+378,378,378,378,378,378,378,378,378,378,115,115,115,115,115,115,
+379,379,379,379,379,379,379,380,379,379,379,379,379,379,115,115,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,381,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 52 */
-381,381,381,381,382,383,383,383,383,383,383,383,383,383,383,383,
-383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
-383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
-383,383,383,383,381,382,381,381,381,381,381,382,381,382,382,382,
-382,382,381,382,382,383,383,383,383,383,383,383,114,114,114,114,
-384,384,384,384,384,384,384,384,384,384,385,385,385,385,385,385,
-385,386,386,386,386,386,386,386,386,386,386,381,381,381,381,381,
-381,381,381,381,386,386,386,386,386,386,386,386,386,114,114,114,
+382,382,382,382,383,384,384,384,384,384,384,384,384,384,384,384,
+384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
+384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
+384,384,384,384,382,383,382,382,382,382,382,383,382,383,383,383,
+383,383,382,383,383,384,384,384,384,384,384,384,115,115,115,115,
+385,385,385,385,385,385,385,385,385,385,386,386,386,386,386,386,
+386,387,387,387,387,387,387,387,387,387,387,382,382,382,382,382,
+382,382,382,382,387,387,387,387,387,387,387,387,387,115,115,115,
 
 /* block 53 */
-387,387,388,389,389,389,389,389,389,389,389,389,389,389,389,389,
-389,389,389,389,389,389,389,389,389,389,389,389,389,389,389,389,
-389,388,387,387,387,387,388,388,387,387,388,387,387,387,389,389,
-390,390,390,390,390,390,390,390,390,390,389,389,389,389,389,389,
-391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,
-391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,
-391,391,391,391,391,391,392,393,392,392,393,393,393,392,393,392,
-392,392,393,393,114,114,114,114,114,114,114,114,394,394,394,394,
+388,388,389,390,390,390,390,390,390,390,390,390,390,390,390,390,
+390,390,390,390,390,390,390,390,390,390,390,390,390,390,390,390,
+390,389,388,388,388,388,389,389,388,388,389,388,388,388,390,390,
+391,391,391,391,391,391,391,391,391,391,390,390,390,390,390,390,
+392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,
+392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,
+392,392,392,392,392,392,393,394,393,393,394,394,394,393,394,393,
+393,393,394,394,115,115,115,115,115,115,115,115,395,395,395,395,
 
 /* block 54 */
-395,395,395,395,395,395,395,395,395,395,395,395,395,395,395,395,
-395,395,395,395,395,395,395,395,395,395,395,395,395,395,395,395,
-395,395,395,395,396,396,396,396,396,396,396,396,397,397,397,397,
-397,397,397,397,396,396,397,397,114,114,114,398,398,398,398,398,
-399,399,399,399,399,399,399,399,399,399,114,114,114,395,395,395,
-400,400,400,400,400,400,400,400,400,400,401,401,401,401,401,401,
-401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,
-401,401,401,401,401,401,401,401,402,402,402,402,402,402,403,403,
+396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,
+396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,
+396,396,396,396,397,397,397,397,397,397,397,397,398,398,398,398,
+398,398,398,398,397,397,398,398,115,115,115,399,399,399,399,399,
+400,400,400,400,400,400,400,400,400,400,115,115,115,396,396,396,
+401,401,401,401,401,401,401,401,401,401,402,402,402,402,402,402,
+402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,
+402,402,402,402,402,402,402,402,403,403,403,403,403,403,404,404,
 
 /* block 55 */
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-404,404,404,404,404,404,404,404,114,114,114,114,114,114,114,114,
-109,109,109,  4,109,109,109,109,109,109,109,109,109,109,109,109,
-109,405,109,109,109,109,109,109,109,406,406,406,406,109,406,406,
-406,406,405,405,109,406,406,114,109,109,114,114,114,114,114,114,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+405,405,405,405,405,405,405,405,115,115,115,115,115,115,115,115,
+110,110,110,  4,110,110,110,110,110,110,110,110,110,110,110,110,
+110,406,110,110,110,110,110,110,110,407,407,407,407,110,407,407,
+407,407,406,406,110,407,407,115,110,110,115,115,115,115,115,115,
 
 /* block 56 */
  33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
  33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33,122,122,122,122,122,407,106,106,106,106,
-106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,
-106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,
-106,106,106,106,106,106,106,106,106,106,106,106,106,115,115,115,
-115,115,106,106,106,106,115,115,115,115,115, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33,408,409, 33, 33, 33,410, 33, 33,
+ 33, 33, 33, 33, 33, 33,123,123,123,123,123,408,107,107,107,107,
+107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,
+107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,
+107,107,107,107,107,107,107,107,107,107,107,107,107,116,116,116,
+116,116,107,107,107,107,116,116,116,116,116, 33, 33, 33, 33, 33,
+ 33, 33, 33, 33, 33, 33, 33, 33,409,410, 33, 33, 33,411, 33, 33,
 
 /* block 57 */
  33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,106,106,106,106,106,
-106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,
-106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,115,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,114,114,114,114,114,114,109,109,109,109,
+ 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,107,107,107,107,107,
+107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,
+107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,116,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,115,115,115,115,115,115,110,110,110,110,
 
 /* block 58 */
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
@@ -1940,12 +1964,12 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
-411,412, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
+412,413, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
 
 /* block 59 */
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
- 30, 31, 30, 31, 30, 31, 33, 33, 33, 33, 33,413, 33, 33,414, 33,
+ 30, 31, 30, 31, 30, 31, 33, 33, 33, 33, 33,414, 33, 33,415, 33,
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
@@ -1954,57 +1978,57 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
 
 /* block 60 */
-415,415,415,415,415,415,415,415,416,416,416,416,416,416,416,416,
-415,415,415,415,415,415,114,114,416,416,416,416,416,416,114,114,
-415,415,415,415,415,415,415,415,416,416,416,416,416,416,416,416,
-415,415,415,415,415,415,415,415,416,416,416,416,416,416,416,416,
-415,415,415,415,415,415,114,114,416,416,416,416,416,416,114,114,
-122,415,122,415,122,415,122,415,114,416,114,416,114,416,114,416,
-415,415,415,415,415,415,415,415,416,416,416,416,416,416,416,416,
-417,417,418,418,418,418,419,419,420,420,421,421,422,422,114,114,
+416,416,416,416,416,416,416,416,417,417,417,417,417,417,417,417,
+416,416,416,416,416,416,115,115,417,417,417,417,417,417,115,115,
+416,416,416,416,416,416,416,416,417,417,417,417,417,417,417,417,
+416,416,416,416,416,416,416,416,417,417,417,417,417,417,417,417,
+416,416,416,416,416,416,115,115,417,417,417,417,417,417,115,115,
+123,416,123,416,123,416,123,416,115,417,115,417,115,417,115,417,
+416,416,416,416,416,416,416,416,417,417,417,417,417,417,417,417,
+418,418,419,419,419,419,420,420,421,421,422,422,423,423,115,115,
 
 /* block 61 */
-415,415,415,415,415,415,415,415,423,423,423,423,423,423,423,423,
-415,415,415,415,415,415,415,415,423,423,423,423,423,423,423,423,
-415,415,415,415,415,415,415,415,423,423,423,423,423,423,423,423,
-415,415,122,424,122,114,122,122,416,416,425,425,426,113,427,113,
-113,113,122,424,122,114,122,122,428,428,428,428,426,113,113,113,
-415,415,122,122,114,114,122,122,416,416,429,429,114,113,113,113,
-415,415,122,122,122,163,122,122,416,416,430,430,168,113,113,113,
-114,114,122,424,122,114,122,122,431,431,432,432,426,113,113,114,
+416,416,416,416,416,416,416,416,424,424,424,424,424,424,424,424,
+416,416,416,416,416,416,416,416,424,424,424,424,424,424,424,424,
+416,416,416,416,416,416,416,416,424,424,424,424,424,424,424,424,
+416,416,123,425,123,115,123,123,417,417,426,426,427,114,428,114,
+114,114,123,425,123,115,123,123,429,429,429,429,427,114,114,114,
+416,416,123,123,115,115,123,123,417,417,430,430,115,114,114,114,
+416,416,123,123,123,164,123,123,417,417,431,431,169,114,114,114,
+115,115,123,425,123,115,123,123,432,432,433,433,427,114,114,115,
 
 /* block 62 */
-  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3, 22,433,433, 22, 22,
+  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3, 22,434,434, 22, 22,
   9,  9,  9,  9,  9,  9,  4,  4, 21, 25,  6, 21, 21, 25,  6, 21,
-  4,  4,  4,  4,  4,  4,  4,  4,434,435, 22, 22, 22, 22, 22,  3,
+  4,  4,  4,  4,  4,  4,  4,  4,435,436, 22, 22, 22, 22, 22,  3,
   4,  4,  4,  4,  4,  4,  4,  4,  4, 21, 25,  4,  4,  4,  4, 15,
  15,  4,  4,  4,  8,  6,  7,  4,  4,  4,  4,  4,  4,  4,  4,  4,
   4,  4,  8,  4, 15,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  3,
- 22, 22, 22, 22, 22,436, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 23,106,114,114, 23, 23, 23, 23, 23, 23,  8,  8,  8,  6,  7,106,
+ 22, 22, 22, 22, 22,437, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 23,107,115,115, 23, 23, 23, 23, 23, 23,  8,  8,  8,  6,  7,107,
 
 /* block 63 */
- 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,  8,  8,  8,  6,  7,114,
-106,106,106,106,106,106,106,106,106,106,106,106,106,114,114,114,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,  8,  8,  8,  6,  7,115,
+107,107,107,107,107,107,107,107,107,107,107,107,107,115,115,115,
   5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
-  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-109,109,109,109,109,109,109,109,109,109,109,109,109,380,380,380,
-380,109,380,380,380,109,109,109,109,109,109,109,109,109,109,109,
-109,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+110,110,110,110,110,110,110,110,110,110,110,110,110,381,381,381,
+381,110,381,381,381,110,110,110,110,110,110,110,110,110,110,110,
+110,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 64 */
- 19, 19,437, 19, 19, 19, 19,437, 19, 19,438,437,437,437,438,438,
-437,437,437,438, 19,437, 19, 19,  8,437,437,437,437,437, 19, 19,
- 19, 19, 19, 19,437, 19,439, 19,437, 19,440,441,437,437, 19,438,
-437,437,442,437,438,406,406,406,406,438, 19, 19,438,438,437,437,
-  8,  8,  8,  8,  8,437,438,438,438,438, 19,  8, 19, 19,443, 19,
+ 19, 19,438, 19, 19, 19, 19,438, 19, 19,439,438,438,438,439,439,
+438,438,438,439, 19,438, 19, 19,  8,438,438,438,438,438, 19, 19,
+ 19, 19, 19, 19,438, 19,440, 19,438, 19,441,442,438,438, 19,439,
+438,438,443,438,439,407,407,407,407,439, 19, 19,439,439,438,438,
+  8,  8,  8,  8,  8,438,439,439,439,439, 19,  8, 19, 19,444, 19,
  23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
-444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,
 445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,
+446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,
 
 /* block 65 */
-446,446,446, 30, 31,446,446,446,446, 23,114,114,114,114,114,114,
+447,447,447, 30, 31,447,447,447,447, 23, 19, 19,115,115,115,115,
   8,  8,  8,  8,  8, 19, 19, 19, 19, 19,  8,  8, 19, 19, 19, 19,
   8, 19, 19,  8, 19, 19,  8, 19, 19, 19, 19, 19, 19, 19,  8, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@@ -2041,15 +2065,15 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,  8,  8,  8,  8,
   8,  8, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,114,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,
 
 /* block 69 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+ 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
  23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
  23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
 
@@ -2057,10 +2081,10 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
  23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
  23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19,447,447,447,447,447,447,447,447,447,447,
-447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,
+ 19, 19, 19, 19, 19, 19,448,448,448,448,448,448,448,448,448,448,
 448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,
-448,448,448,448,448,448,448,448,448,448, 23, 23, 23, 23, 23, 23,
+449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,
+449,449,449,449,449,449,449,449,449,449, 23, 23, 23, 23, 23, 23,
  23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
 
 /* block 71 */
@@ -2114,14 +2138,14 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
 
 /* block 76 */
-449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,
-449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,
-449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,
-449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,
-449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,
-449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,
-449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,
-449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,
+450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
+450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
+450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
+450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
+450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
+450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
+450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
+450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
 
 /* block 77 */
   8,  8,  8,  6,  7,  6,  7,  6,  7,  6,  7,  6,  7,  6,  7,  6,
@@ -2141,147 +2165,147 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
   8,  8,  8,  8,  8, 19, 19,  8,  8,  8,  8,  8,  8, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19,114,114, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19,115,115, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
 
 /* block 79 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19,114,114, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19,115,115, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19,114, 19, 19, 19, 19, 19, 19,
- 19, 19,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19,115, 19, 19, 19, 19, 19, 19,
+ 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115, 19, 19, 19, 19,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 80 */
-450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
-450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
-450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,114,
 451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,
 451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,
-451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,114,
- 30, 31,452,453,454,455,456, 30, 31, 30, 31, 30, 31,457,458,459,
-460, 33, 30, 31, 33, 30, 31, 33, 33, 33, 33, 33,106,106,461,461,
+451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,115,
+452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
+452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
+452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,115,
+ 30, 31,453,454,455,456,457, 30, 31, 30, 31, 30, 31,458,459,460,
+461, 33, 30, 31, 33, 30, 31, 33, 33, 33, 33, 33,107,107,462,462,
 
 /* block 81 */
-159,160,159,160,159,160,159,160,159,160,159,160,159,160,159,160,
-159,160,159,160,159,160,159,160,159,160,159,160,159,160,159,160,
-159,160,159,160,159,160,159,160,159,160,159,160,159,160,159,160,
-159,160,159,160,159,160,159,160,159,160,159,160,159,160,159,160,
-159,160,159,160,159,160,159,160,159,160,159,160,159,160,159,160,
-159,160,159,160,159,160,159,160,159,160,159,160,159,160,159,160,
-159,160,159,160,462,463,463,463,463,463,463,159,160,159,160,464,
-464,464,159,160,114,114,114,114,114,465,465,465,465,466,465,465,
+160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
+160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
+160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
+160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
+160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
+160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
+160,161,160,161,463,464,464,464,464,464,464,160,161,160,161,465,
+465,465,160,161,115,115,115,115,115,466,466,466,466,467,466,466,
 
 /* block 82 */
-467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
-467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
-467,467,467,467,467,467,114,467,114,114,114,114,114,467,114,114,
 468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,
 468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,
-468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,
-468,468,468,468,468,468,468,468,114,114,114,114,114,114,114,469,
-470,114,114,114,114,114,114,114,114,114,114,114,114,114,114,471,
+468,468,468,468,468,468,115,468,115,115,115,115,115,468,115,115,
+469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,
+469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,
+469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,
+469,469,469,469,469,469,469,469,115,115,115,115,115,115,115,470,
+471,115,115,115,115,115,115,115,115,115,115,115,115,115,115,472,
 
 /* block 83 */
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,114,114,114,114,114,114,114,114,114,
-317,317,317,317,317,317,317,114,317,317,317,317,317,317,317,114,
-317,317,317,317,317,317,317,114,317,317,317,317,317,317,317,114,
-317,317,317,317,317,317,317,114,317,317,317,317,317,317,317,114,
-317,317,317,317,317,317,317,114,317,317,317,317,317,317,317,114,
-177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,
-177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,
+318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+318,318,318,318,318,318,318,115,115,115,115,115,115,115,115,115,
+318,318,318,318,318,318,318,115,318,318,318,318,318,318,318,115,
+318,318,318,318,318,318,318,115,318,318,318,318,318,318,318,115,
+318,318,318,318,318,318,318,115,318,318,318,318,318,318,318,115,
+318,318,318,318,318,318,318,115,318,318,318,318,318,318,318,115,
+178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,
+178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,
 
 /* block 84 */
   4,  4, 21, 25, 21, 25,  4,  4,  4, 21, 25,  4, 21, 25,  4,  4,
   4,  4,  4,  4,  4,  4,  4,  9,  4,  4,  9,  4, 21, 25,  4,  4,
- 21, 25,  6,  7,  6,  7,  6,  7,  6,  7,  4,  4,  4,  4,  4,107,
+ 21, 25,  6,  7,  6,  7,  6,  7,  6,  7,  4,  4,  4,  4,  4,108,
   4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  9,  9,  4,  4,  4,  4,
-  9,  4,  6,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+  9,  4,  6,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 85 */
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,114,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,114,114,114,114,114,114,114,114,114,114,114,114,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,115,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 86 */
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
 
 /* block 87 */
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+473,473,473,473,473,473,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
 
 /* block 88 */
-  3,  4,  4,  4, 19,473,406,474,  6,  7,  6,  7,  6,  7,  6,  7,
+  3,  4,  4,  4, 19,474,407,475,  6,  7,  6,  7,  6,  7,  6,  7,
   6,  7, 19, 19,  6,  7,  6,  7,  6,  7,  6,  7,  9,  6,  7,  7,
- 19,474,474,474,474,474,474,474,474,474,109,109,109,109,475,475,
-  9,107,107,107,107,107, 19, 19,474,474,474,473,406,  4, 19, 19,
-114,476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,
-476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,
-476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,
-476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,
+ 19,475,475,475,475,475,475,475,475,475,110,110,110,110,476,476,
+  9,108,108,108,108,108, 19, 19,475,475,475,474,407,  4, 19, 19,
+115,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,
+477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,
+477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,
+477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,
 
 /* block 89 */
-476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,
-476,476,476,476,476,476,476,114,114,109,109, 14, 14,477,477,476,
-  9,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,
-478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,
-478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,
-478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,
-478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,
-478,478,478,478,478,478,478,478,478,478,478,  4,107,479,479,478,
+477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,
+477,477,477,477,477,477,477,115,115,110,110, 14, 14,478,478,477,
+  9,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
+479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
+479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
+479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
+479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
+479,479,479,479,479,479,479,479,479,479,479,  4,108,480,480,479,
 
 /* block 90 */
-114,114,114,114,114,480,480,480,480,480,480,480,480,480,480,480,
-480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,
-480,480,480,480,480,480,480,480,480,480,480,480,480,480,114,114,
-114,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,
-481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,
-481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,
-481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,
+115,115,115,115,115,481,481,481,481,481,481,481,481,481,481,481,
 481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,
+481,481,481,481,481,481,481,481,481,481,481,481,481,481,115,115,
+115,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
+482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
+482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
+482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
+482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
 
 /* block 91 */
-481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,114,
+482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,115,
  19, 19, 23, 23, 23, 23, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,
-480,480,480,480,480,480,480,480,480,480,480,114,114,114,114,114,
+481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,
+481,481,481,481,481,481,481,481,481,481,481,115,115,115,115,115,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19,114,114,114,114,114,114,114,114,114,114,114,114,
-478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,
+ 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,
+479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
 
 /* block 92 */
-482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
-482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,114,
+483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,
+483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,115,
  23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 23, 23, 23, 23, 23, 23, 23, 23,
  19, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
-482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
-482,482,482,482,482,482,482,482,482,482,482,482,482,482,482, 19,
+483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,
+483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, 19,
 
 /* block 93 */
  23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 19, 19, 19, 19, 19, 19,
@@ -2289,53 +2313,23 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,
-483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,
-483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,114,
-
-/* block 94 */
-483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,
-483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,
-483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,
-483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,
-483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,
-483,483,483,483,483,483,483,483, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-
-/* block 95 */
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
 484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
 484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
+484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,115,
+
+/* block 94 */
 484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
 484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-
-/* block 96 */
 484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
 484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
 484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,114,114,114,114,114,114,114,114,114,114,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+484,484,484,484,484,484,484,484, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-
-/* block 97 */
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
 
-/* block 98 */
+/* block 95 */
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,486,485,485,485,485,485,485,485,485,485,485,
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
@@ -2343,877 +2337,957 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 
-/* block 99 */
+/* block 96 */
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,115,115,115,115,115,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+
+/* block 97 */
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 98 */
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,487,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+
+/* block 99 */
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
 
 /* block 100 */
-485,485,485,485,485,485,485,485,485,485,485,485,485,114,114,114,
-487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,
-487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,
-487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,
-487,487,487,487,487,487,487,114,114,114,114,114,114,114,114,114,
+486,486,486,486,486,486,486,486,486,486,486,486,486,115,115,115,
 488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,
 488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,
-488,488,488,488,488,488,488,488,489,489,489,489,489,489,490,490,
+488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,
+488,488,488,488,488,488,488,115,115,115,115,115,115,115,115,115,
+489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,
+489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,
+489,489,489,489,489,489,489,489,490,490,490,490,490,490,491,491,
 
 /* block 101 */
-491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,
-491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,
-491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,
-491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,
-491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,
-491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,
-491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,
-491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,
+492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
 
 /* block 102 */
-491,491,491,491,491,491,491,491,491,491,491,491,492,493,493,493,
-491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,491,
-494,494,494,494,494,494,494,494,494,494,491,491,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,495,177,
-178,178,178,496,177,177,177,177,177,177,177,177,177,177,496,408,
+492,492,492,492,492,492,492,492,492,492,492,492,493,494,494,494,
+492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+495,495,495,495,495,495,495,495,495,495,492,492,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,496,178,
+179,179,179,497,178,178,178,178,178,178,178,178,178,178,497,409,
 
 /* block 103 */
-174,175,174,175,174,175,174,175,174,175,174,175,174,175,174,175,
-174,175,174,175,174,175,174,175,174,175,174,175,408,408,114,177,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,498,498,498,498,498,498,498,498,498,498,
-499,499,500,500,500,500,500,500,114,114,114,114,114,114,114,114,
+175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+175,176,175,176,175,176,175,176,175,176,175,176,409,409,178,178,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,499,499,499,499,499,499,499,499,499,499,
+500,500,501,501,501,501,501,501,115,115,115,115,115,115,115,115,
 
 /* block 104 */
  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14,107,107,107,107,107,107,107,107,107,
+ 14, 14, 14, 14, 14, 14, 14,108,108,108,108,108,108,108,108,108,
  14, 14, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
  33, 33, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
  30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
-106, 33, 33, 33, 33, 33, 33, 33, 33, 30, 31, 30, 31,501, 30, 31,
+107, 33, 33, 33, 33, 33, 33, 33, 33, 30, 31, 30, 31,502, 30, 31,
 
 /* block 105 */
- 30, 31, 30, 31, 30, 31, 30, 31,107, 14, 14, 30, 31,502, 33,114,
+ 30, 31, 30, 31, 30, 31, 30, 31,108, 14, 14, 30, 31,503, 33, 20,
  30, 31, 30, 31, 33, 33, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
- 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,503,504,505,506,114,114,
-507,508,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114, 20,106,106, 33, 20, 20, 20, 20, 20,
+ 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,504,505,506,507,115,115,
+508,509,510,511, 30, 31, 30, 31,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115, 20,107,107, 33, 20, 20, 20, 20, 20,
 
 /* block 106 */
-509,509,510,509,509,509,510,509,509,509,509,510,509,509,509,509,
-509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,
-509,509,509,511,511,510,510,511,512,512,512,512,114,114,114,114,
- 23, 23, 23, 23, 23, 23, 19, 19,  5, 19,114,114,114,114,114,114,
-513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,
-513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,
-513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,
-513,513,513,513,514,514,514,514,114,114,114,114,114,114,114,114,
-
-/* block 107 */
-515,515,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+512,512,513,512,512,512,513,512,512,512,512,513,512,512,512,512,
+512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,
+512,512,512,514,514,513,513,514,515,515,515,515,115,115,115,115,
+ 23, 23, 23, 23, 23, 23, 19, 19,  5, 19,115,115,115,115,115,115,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
-516,516,516,516,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,517,114,114,114,114,114,114,114,114,114,518,518,
-519,519,519,519,519,519,519,519,519,519,114,114,114,114,114,114,
-221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,
-221,221,223,223,223,223,223,223,225,225,225,223,114,114,114,114,
+516,516,516,516,517,517,517,517,115,115,115,115,115,115,115,115,
+
+/* block 107 */
+518,518,519,519,519,519,519,519,519,519,519,519,519,519,519,519,
+519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,
+519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,
+519,519,519,519,518,518,518,518,518,518,518,518,518,518,518,518,
+518,518,518,518,520,115,115,115,115,115,115,115,115,115,521,521,
+522,522,522,522,522,522,522,522,522,522,115,115,115,115,115,115,
+222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,
+222,222,224,224,224,224,224,224,226,226,226,224,226,224,115,115,
 
 /* block 108 */
-520,520,520,520,520,520,520,520,520,520,521,521,521,521,521,521,
-521,521,521,521,521,521,521,521,521,521,521,521,521,521,521,521,
-521,521,521,521,521,521,522,522,522,522,522,522,522,522,  4,523,
+523,523,523,523,523,523,523,523,523,523,524,524,524,524,524,524,
 524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,
-524,524,524,524,524,524,524,525,525,525,525,525,525,525,525,525,
-525,525,526,526,114,114,114,114,114,114,114,114,114,114,114,527,
-314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,
-314,314,314,314,314,314,314,314,314,314,314,314,314,114,114,114,
+524,524,524,524,524,524,525,525,525,525,525,525,525,525,  4,526,
+527,527,527,527,527,527,527,527,527,527,527,527,527,527,527,527,
+527,527,527,527,527,527,527,528,528,528,528,528,528,528,528,528,
+528,528,529,529,115,115,115,115,115,115,115,115,115,115,115,530,
+315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
+315,315,315,315,315,315,315,315,315,315,315,315,315,115,115,115,
 
 /* block 109 */
-528,528,528,529,530,530,530,530,530,530,530,530,530,530,530,530,
-530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
-530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
-530,530,530,528,529,529,528,528,528,528,529,529,528,529,529,529,
-529,531,531,531,531,531,531,531,531,531,531,531,531,531,114,107,
-532,532,532,532,532,532,532,532,532,532,114,114,114,114,531,531,
-304,304,304,304,304,306,533,304,304,304,304,304,304,304,304,304,
-308,308,308,308,308,308,308,308,308,308,304,304,304,304,304,114,
+531,531,531,532,533,533,533,533,533,533,533,533,533,533,533,533,
+533,533,533,533,533,533,533,533,533,533,533,533,533,533,533,533,
+533,533,533,533,533,533,533,533,533,533,533,533,533,533,533,533,
+533,533,533,531,532,532,531,531,531,531,532,532,531,532,532,532,
+532,534,534,534,534,534,534,534,534,534,534,534,534,534,115,108,
+535,535,535,535,535,535,535,535,535,535,115,115,115,115,534,534,
+305,305,305,305,305,307,536,305,305,305,305,305,305,305,305,305,
+309,309,309,309,309,309,309,309,309,309,305,305,305,305,305,115,
 
 /* block 110 */
-534,534,534,534,534,534,534,534,534,534,534,534,534,534,534,534,
-534,534,534,534,534,534,534,534,534,534,534,534,534,534,534,534,
-534,534,534,534,534,534,534,534,534,535,535,535,535,535,535,536,
-536,535,535,536,536,535,535,114,114,114,114,114,114,114,114,114,
-534,534,534,535,534,534,534,534,534,534,534,534,535,536,114,114,
-537,537,537,537,537,537,537,537,537,537,114,114,538,538,538,538,
-304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,
-533,304,304,304,304,304,304,310,310,310,304,305,306,305,304,304,
+537,537,537,537,537,537,537,537,537,537,537,537,537,537,537,537,
+537,537,537,537,537,537,537,537,537,537,537,537,537,537,537,537,
+537,537,537,537,537,537,537,537,537,538,538,538,538,538,538,539,
+539,538,538,539,539,538,538,115,115,115,115,115,115,115,115,115,
+537,537,537,538,537,537,537,537,537,537,537,537,538,539,115,115,
+540,540,540,540,540,540,540,540,540,540,115,115,541,541,541,541,
+305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,
+536,305,305,305,305,305,305,311,311,311,305,306,307,306,305,305,
 
 /* block 111 */
-539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,
-539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,
-539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,
-540,539,540,540,540,539,539,540,540,539,539,539,539,539,540,540,
-539,540,539,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,539,539,541,542,542,
-543,543,543,543,543,543,543,543,543,543,543,544,545,545,544,544,
-546,546,543,547,547,544,545,114,114,114,114,114,114,114,114,114,
+542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,
+542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,
+542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,
+543,542,543,543,543,542,542,543,543,542,542,542,542,542,543,543,
+542,543,542,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,542,542,544,545,545,
+546,546,546,546,546,546,546,546,546,546,546,547,548,548,547,547,
+549,549,546,550,550,547,548,115,115,115,115,115,115,115,115,115,
 
 /* block 112 */
-114,317,317,317,317,317,317,114,114,317,317,317,317,317,317,114,
-114,317,317,317,317,317,317,114,114,114,114,114,114,114,114,114,
-317,317,317,317,317,317,317,114,317,317,317,317,317,317,317,114,
+115,318,318,318,318,318,318,115,115,318,318,318,318,318,318,115,
+115,318,318,318,318,318,318,115,115,115,115,115,115,115,115,115,
+318,318,318,318,318,318,318,115,318,318,318,318,318,318,318,115,
  33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
  33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 14,106,106,106,106,
-114,114,114,114, 33,122,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+ 33, 33, 33,551, 33, 33, 33, 33, 33, 33, 33, 14,107,107,107,107,
+ 33, 33, 33, 33, 33,123,115,115,115,115,115,115,115,115,115,115,
+552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
 
 /* block 113 */
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,
-543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,
-543,543,543,544,544,545,544,544,545,544,544,546,544,545,114,114,
-548,548,548,548,548,548,548,548,548,548,114,114,114,114,114,114,
+552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
+552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
+552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
+552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
+546,546,546,546,546,546,546,546,546,546,546,546,546,546,546,546,
+546,546,546,546,546,546,546,546,546,546,546,546,546,546,546,546,
+546,546,546,547,547,548,547,547,548,547,547,549,547,548,115,115,
+553,553,553,553,553,553,553,553,553,553,115,115,115,115,115,115,
 
 /* block 114 */
-549,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,549,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,549,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,549,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-549,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
+554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
 
 /* block 115 */
-550,550,550,550,550,550,550,550,550,550,550,550,549,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,549,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,549,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-549,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,549,550,550,550,
+555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
 
 /* block 116 */
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,549,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,549,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-549,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,549,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
 
 /* block 117 */
-550,550,550,550,550,550,550,550,549,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,549,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-549,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,549,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,549,550,550,550,550,550,550,550,
+555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
 
 /* block 118 */
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,549,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-549,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,549,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,549,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
 
 /* block 119 */
-550,550,550,550,549,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-549,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,549,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,549,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,549,550,550,550,550,550,550,550,550,550,550,550,
+555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
 
 /* block 120 */
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-549,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,549,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,549,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,549,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
 
 /* block 121 */
-550,550,550,550,550,550,550,550,549,550,550,550,550,550,550,550,
-550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,
-550,550,550,550,114,114,114,114,114,114,114,114,114,114,114,114,
-315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
-315,315,315,315,315,315,315,114,114,114,114,316,316,316,316,316,
-316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,
+555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
+555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+555,555,555,555,115,115,115,115,115,115,115,115,115,115,115,115,
 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,
-316,316,316,316,316,316,316,316,316,316,316,316,114,114,114,114,
+316,316,316,316,316,316,316,115,115,115,115,317,317,317,317,317,
+317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
+317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
+317,317,317,317,317,317,317,317,317,317,317,317,115,115,115,115,
 
 /* block 122 */
-551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,
-551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,
-551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,
-551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,
-551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,
-551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,
-551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,
-551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,
+556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
+556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
+556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
+556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
+556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
+556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
+556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
+556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
 
 /* block 123 */
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
 
 /* block 124 */
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,114,114,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,115,115,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 
 /* block 125 */
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 126 */
- 33, 33, 33, 33, 33, 33, 33,114,114,114,114,114,114,114,114,114,
-114,114,114,185,185,185,185,185,114,114,114,114,114,192,189,192,
-192,192,192,192,192,192,192,192,192,553,192,192,192,192,192,192,
-192,192,192,192,192,192,192,114,192,192,192,192,192,114,192,114,
-192,192,114,192,192,114,192,192,192,192,192,192,192,192,192,192,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
+ 33, 33, 33, 33, 33, 33, 33,115,115,115,115,115,115,115,115,115,
+115,115,115,186,186,186,186,186,115,115,115,115,115,193,190,193,
+193,193,193,193,193,193,193,193,193,558,193,193,193,193,193,193,
+193,193,193,193,193,193,193,115,193,193,193,193,193,115,193,115,
+193,193,115,193,193,115,193,193,193,193,193,193,193,193,193,193,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
 
 /* block 127 */
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
-554,554,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,559,559,559,559,559,559,559,559,559,559,559,559,559,559,
+559,559,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
 
 /* block 128 */
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
 
 /* block 129 */
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,  7,  6,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,  7,  6,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
 
 /* block 130 */
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-114,114,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-199,199,199,199,199,199,199,199,199,199,199,199,196,197,114,114,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+115,115,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+200,200,200,200,200,200,200,200,200,200,200,200,197,198,115,115,
 
 /* block 131 */
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-  4,  4,  4,  4,  4,  4,  4,  6,  7,  4,114,114,114,114,114,114,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,114,114,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+  4,  4,  4,  4,  4,  4,  4,  6,  7,  4,115,115,115,115,115,115,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,178,178,
   4,  9,  9, 15, 15,  6,  7,  6,  7,  6,  7,  6,  7,  6,  7,  6,
   7,  6,  7,  6,  7,  4,  4,  6,  7,  4,  4,  4,  4, 15, 15, 15,
-  4,  4,  4,114,  4,  4,  4,  4,  9,  6,  7,  6,  7,  6,  7,  4,
-  4,  4,  8,  9,  8,  8,  8,114,  4,  5,  4,  4,114,114,114,114,
-199,199,199,199,199,114,199,199,199,199,199,199,199,199,199,199,
+  4,  4,  4,115,  4,  4,  4,  4,  9,  6,  7,  6,  7,  6,  7,  4,
+  4,  4,  8,  9,  8,  8,  8,115,  4,  5,  4,  4,115,115,115,115,
+200,200,200,200,200,115,200,200,200,200,200,200,200,200,200,200,
 
 /* block 132 */
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,114,114, 22,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,115,115, 22,
 
 /* block 133 */
-114,  4,  4,  4,  5,  4,  4,  4,  6,  7,  4,  8,  4,  9,  4,  4,
+115,  4,  4,  4,  5,  4,  4,  4,  6,  7,  4,  8,  4,  9,  4,  4,
  10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  4,  4,  8,  8,  8,  4,
   4, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  6,  4,  7, 14, 15,
  14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  6,  8,  7,  8,  6,
-  7,  4,  6,  7,  4,  4,478,478,478,478,478,478,478,478,478,478,
-107,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,
+  7,  4,  6,  7,  4,  4,479,479,479,479,479,479,479,479,479,479,
+108,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
 
 /* block 134 */
-478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,
-478,478,478,478,478,478,478,478,478,478,478,478,478,478,555,555,
-481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,
-481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,114,
-114,114,481,481,481,481,481,481,114,114,481,481,481,481,481,481,
-114,114,481,481,481,481,481,481,114,114,481,481,481,114,114,114,
-  5,  5,  8, 14, 19,  5,  5,114, 19,  8,  8,  8,  8, 19, 19,114,
-436,436,436,436,436,436,436,436,436, 22, 22, 22, 19, 19,114,114,
+479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
+479,479,479,479,479,479,479,479,479,479,479,479,479,479,560,560,
+482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
+482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,115,
+115,115,482,482,482,482,482,482,115,115,482,482,482,482,482,482,
+115,115,482,482,482,482,482,482,115,115,482,482,482,115,115,115,
+  5,  5,  8, 14, 19,  5,  5,115, 19,  8,  8,  8,  8, 19, 19,115,
+437,437,437,437,437,437,437,437,437, 22, 22, 22, 19, 19,115,115,
 
 /* block 135 */
-556,556,556,556,556,556,556,556,556,556,556,556,114,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,114,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,114,556,556,114,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,114,114,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+561,561,561,561,561,561,561,561,561,561,561,561,115,561,561,561,
+561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
+561,561,561,561,561,561,561,115,561,561,561,561,561,561,561,561,
+561,561,561,561,561,561,561,561,561,561,561,115,561,561,115,561,
+561,561,561,561,561,561,561,561,561,561,561,561,561,561,115,115,
+561,561,561,561,561,561,561,561,561,561,561,561,561,561,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 136 */
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,114,114,114,114,114,
+561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
+561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
+561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
+561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
+561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
+561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
+561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
+561,561,561,561,561,561,561,561,561,561,561,115,115,115,115,115,
 
 /* block 137 */
-  4,  4,  4,114,114,114,114, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+  4,  4,  4,115,115,115,115, 23, 23, 23, 23, 23, 23, 23, 23, 23,
  23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
  23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
- 23, 23, 23, 23,114,114,114, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,558,558,558,558,559,559,559,559,559,559,559,
+ 23, 23, 23, 23,115,115,115, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,
+562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,
+562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,
+562,562,562,562,562,563,563,563,563,564,564,564,564,564,564,564,
 
 /* block 138 */
-559,559,559,559,559,559,559,559,559,559,558,558,559,114,114,114,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,
-559,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+564,564,564,564,564,564,564,564,564,564,563,563,564,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
+564,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,109,114,114,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,110,115,115,
 
 /* block 139 */
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 140 */
-560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,
-560,560,560,560,560,560,560,560,560,560,560,560,560,114,114,114,
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
-561,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-109, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
- 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,114,114,114,114,
-
-/* block 141 */
-562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,
-562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,
-563,563,563,563,114,114,114,114,114,114,114,114,114,114,114,114,
-564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,
-564,565,564,564,564,564,564,564,564,564,565,114,114,114,114,114,
+565,565,565,565,565,565,565,565,565,565,565,565,565,565,565,565,
+565,565,565,565,565,565,565,565,565,565,565,565,565,115,115,115,
 566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,
 566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,
-566,566,566,566,566,566,567,567,567,567,567,114,114,114,114,114,
+566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,
+566,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+110, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,115,115,115,115,
 
-/* block 142 */
-568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,
-568,568,568,568,568,568,568,568,568,568,568,568,568,568,114,569,
-570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,
-570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,
-570,570,570,570,114,114,114,114,570,570,570,570,570,570,570,570,
-571,572,572,572,572,572,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+/* block 141 */
+567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,
+567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,
+568,568,568,568,115,115,115,115,115,115,115,115,115,115,115,115,
+569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,
+569,570,569,569,569,569,569,569,569,569,570,115,115,115,115,115,
+571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,
+571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,
+571,571,571,571,571,571,572,572,572,572,572,115,115,115,115,115,
 
-/* block 143 */
-573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+/* block 142 */
 573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
-573,573,573,573,573,573,573,573,574,574,574,574,574,574,574,574,
-574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,
-574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,115,574,
 575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,
 575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,
-575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,
-
-/* block 144 */
-576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,
-576,576,576,576,576,576,576,576,576,576,576,576,576,576,114,114,
-577,577,577,577,577,577,577,577,577,577,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+575,575,575,575,115,115,115,115,575,575,575,575,575,575,575,575,
+576,577,577,577,577,577,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 145 */
+/* block 143 */
 578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,
 578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,
-578,578,578,578,578,578,578,578,114,114,114,114,114,114,114,114,
-579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,
+578,578,578,578,578,578,578,578,579,579,579,579,579,579,579,579,
 579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,
 579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,
-579,579,579,579,114,114,114,114,114,114,114,114,114,114,114,580,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,
+580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,
+580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,
 
-/* block 146 */
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
+/* block 144 */
 581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
+581,581,581,581,581,581,581,581,581,581,581,581,581,581,115,115,
+582,582,582,582,582,582,582,582,582,582,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 145 */
+583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,
+583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,
+583,583,583,583,583,583,583,583,115,115,115,115,115,115,115,115,
+584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,
+584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,
+584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,
+584,584,584,584,115,115,115,115,115,115,115,115,115,115,115,585,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 146 */
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
 
 /* block 147 */
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
-581,581,581,581,581,581,581,114,114,114,114,114,114,114,114,114,
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
-581,581,581,581,581,581,114,114,114,114,114,114,114,114,114,114,
-581,581,581,581,581,581,581,581,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
+586,586,586,586,586,586,586,115,115,115,115,115,115,115,115,115,
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
+586,586,586,586,586,586,115,115,115,115,115,115,115,115,115,115,
+586,586,586,586,586,586,586,586,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 148 */
-582,582,582,582,582,582,114,114,582,114,582,582,582,582,582,582,
-582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,
-582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,
-582,582,582,582,582,582,114,582,582,114,114,114,582,114,114,582,
-583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,
-583,583,583,583,583,583,114,584,585,585,585,585,585,585,585,585,
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
-586,586,586,586,586,586,586,587,587,588,588,588,588,588,588,588,
+587,587,587,587,587,587,115,115,587,115,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,115,587,587,115,115,115,587,115,115,587,
+588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,
+588,588,588,588,588,588,115,589,590,590,590,590,590,590,590,590,
+591,591,591,591,591,591,591,591,591,591,591,591,591,591,591,591,
+591,591,591,591,591,591,591,592,592,593,593,593,593,593,593,593,
 
 /* block 149 */
-589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
-589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,114,
-114,114,114,114,114,114,114,590,590,590,590,590,590,590,590,590,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,
+594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,115,
+115,115,115,115,115,115,115,595,595,595,595,595,595,595,595,595,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,
+596,596,596,115,596,596,115,115,115,115,115,597,597,597,597,597,
 
 /* block 150 */
-591,591,591,591,591,591,591,591,591,591,591,591,591,591,591,591,
-591,591,591,591,591,591,592,592,592,592,592,592,114,114,114,593,
-594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,
-594,594,594,594,594,594,594,594,594,594,114,114,114,114,114,595,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,
+598,598,598,598,598,598,599,599,599,599,599,599,115,115,115,600,
+601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,
+601,601,601,601,601,601,601,601,601,601,115,115,115,115,115,602,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 151 */
-596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,
-596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,114,114,114,114,114,114,597,597,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,
+603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,
+604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,
+604,604,604,604,604,604,604,604,115,115,115,115,605,605,604,604,
+605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,
+115,115,605,605,605,605,605,605,605,605,605,605,605,605,605,605,
+605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,
+605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,
 
 /* block 152 */
-598,599,599,599,114,599,599,114,114,114,114,114,599,599,599,599,
-598,598,598,598,114,598,598,598,114,598,598,598,598,598,598,598,
-598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,
-598,598,598,598,114,114,114,114,599,599,599,114,114,114,114,599,
-600,600,600,600,600,600,600,600,114,114,114,114,114,114,114,114,
-601,601,601,601,601,601,601,601,601,114,114,114,114,114,114,114,
-602,602,602,602,602,602,602,602,602,602,602,602,602,602,602,602,
-602,602,602,602,602,602,602,602,602,602,602,602,602,603,603,604,
+606,607,607,607,115,607,607,115,115,115,115,115,607,607,607,607,
+606,606,606,606,115,606,606,606,115,606,606,606,606,606,606,606,
+606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,
+606,606,606,606,115,115,115,115,607,607,607,115,115,115,115,607,
+608,608,608,608,608,608,608,608,115,115,115,115,115,115,115,115,
+609,609,609,609,609,609,609,609,609,115,115,115,115,115,115,115,
+610,610,610,610,610,610,610,610,610,610,610,610,610,610,610,610,
+610,610,610,610,610,610,610,610,610,610,610,610,610,611,611,612,
 
 /* block 153 */
-605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,
-605,605,605,605,605,605,605,605,605,605,605,605,605,606,606,606,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-607,607,607,607,607,607,607,607,608,607,607,607,607,607,607,607,
-607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,
-607,607,607,607,607,609,609,114,114,114,114,610,610,610,610,610,
-611,611,611,611,611,611,611,114,114,114,114,114,114,114,114,114,
+613,613,613,613,613,613,613,613,613,613,613,613,613,613,613,613,
+613,613,613,613,613,613,613,613,613,613,613,613,613,614,614,614,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+615,615,615,615,615,615,615,615,616,615,615,615,615,615,615,615,
+615,615,615,615,615,615,615,615,615,615,615,615,615,615,615,615,
+615,615,615,615,615,617,617,115,115,115,115,618,618,618,618,618,
+619,619,619,619,619,619,619,115,115,115,115,115,115,115,115,115,
 
 /* block 154 */
-612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,
-612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,
-612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,
-612,612,612,612,612,612,114,114,114,613,613,613,613,613,613,613,
-614,614,614,614,614,614,614,614,614,614,614,614,614,614,614,614,
-614,614,614,614,614,614,114,114,615,615,615,615,615,615,615,615,
-616,616,616,616,616,616,616,616,616,616,616,616,616,616,616,616,
-616,616,616,114,114,114,114,114,617,617,617,617,617,617,617,617,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,115,115,115,621,621,621,621,621,621,621,
+622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,
+622,622,622,622,622,622,115,115,623,623,623,623,623,623,623,623,
+624,624,624,624,624,624,624,624,624,624,624,624,624,624,624,624,
+624,624,624,115,115,115,115,115,625,625,625,625,625,625,625,625,
 
 /* block 155 */
-618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,
-618,618,114,114,114,114,114,114,114,619,619,619,619,114,114,114,
-114,114,114,114,114,114,114,114,114,620,620,620,620,620,620,620,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,
+626,626,115,115,115,115,115,115,115,627,627,627,627,115,115,115,
+115,115,115,115,115,115,115,115,115,628,628,628,628,628,628,628,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 156 */
-621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,
-621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,
-621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,
-621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,
-621,621,621,621,621,621,621,621,621,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,
+629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,
+629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,
+629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,
+629,629,629,629,629,629,629,629,629,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 157 */
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,
-622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,114,
+630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,
+630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,
+630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,
+630,630,630,115,115,115,115,115,115,115,115,115,115,115,115,115,
+631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,
+631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,
+631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,
+631,631,631,115,115,115,115,115,115,115,632,632,632,632,632,632,
 
 /* block 158 */
-623,624,623,625,625,625,625,625,625,625,625,625,625,625,625,625,
-625,625,625,625,625,625,625,625,625,625,625,625,625,625,625,625,
-625,625,625,625,625,625,625,625,625,625,625,625,625,625,625,625,
-625,625,625,625,625,625,625,625,624,624,624,624,624,624,624,624,
-624,624,624,624,624,624,624,626,626,626,626,626,626,626,114,114,
-114,114,627,627,627,627,627,627,627,627,627,627,627,627,627,627,
-627,627,627,627,627,627,628,628,628,628,628,628,628,628,628,628,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,624,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,
+633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,115,
 
 /* block 159 */
-629,629,630,631,631,631,631,631,631,631,631,631,631,631,631,631,
-631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,
-631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,
-630,630,630,629,629,629,629,630,630,629,629,632,632,633,632,632,
-632,632,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-634,634,634,634,634,634,634,634,634,634,634,634,634,634,634,634,
-634,634,634,634,634,634,634,634,634,114,114,114,114,114,114,114,
-635,635,635,635,635,635,635,635,635,635,114,114,114,114,114,114,
+634,635,634,636,636,636,636,636,636,636,636,636,636,636,636,636,
+636,636,636,636,636,636,636,636,636,636,636,636,636,636,636,636,
+636,636,636,636,636,636,636,636,636,636,636,636,636,636,636,636,
+636,636,636,636,636,636,636,636,635,635,635,635,635,635,635,635,
+635,635,635,635,635,635,635,637,637,637,637,637,637,637,115,115,
+115,115,638,638,638,638,638,638,638,638,638,638,638,638,638,638,
+638,638,638,638,638,638,639,639,639,639,639,639,639,639,639,639,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,635,
 
 /* block 160 */
-636,636,636,637,637,637,637,637,637,637,637,637,637,637,637,637,
-637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,
-637,637,637,637,637,637,637,636,636,636,636,636,638,636,636,636,
-636,636,636,636,636,114,639,639,639,639,639,639,639,639,639,639,
-640,640,640,640,114,114,114,114,114,114,114,114,114,114,114,114,
-641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,
-641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,
-641,641,641,642,643,643,641,114,114,114,114,114,114,114,114,114,
+640,640,641,642,642,642,642,642,642,642,642,642,642,642,642,642,
+642,642,642,642,642,642,642,642,642,642,642,642,642,642,642,642,
+642,642,642,642,642,642,642,642,642,642,642,642,642,642,642,642,
+641,641,641,640,640,640,640,641,641,640,640,643,643,644,643,643,
+643,643,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+645,645,645,645,645,645,645,645,645,645,645,645,645,645,645,645,
+645,645,645,645,645,645,645,645,645,115,115,115,115,115,115,115,
+646,646,646,646,646,646,646,646,646,646,115,115,115,115,115,115,
 
 /* block 161 */
-644,644,645,646,646,646,646,646,646,646,646,646,646,646,646,646,
-646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,
-646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,
-646,646,646,645,645,645,644,644,644,644,644,644,644,644,644,645,
-645,646,646,646,646,647,647,647,647,114,114,114,114,647,114,114,
-648,648,648,648,648,648,648,648,648,648,646,114,114,114,114,114,
-114,649,649,649,649,649,649,649,649,649,649,649,649,649,649,649,
-649,649,649,649,649,114,114,114,114,114,114,114,114,114,114,114,
+647,647,647,648,648,648,648,648,648,648,648,648,648,648,648,648,
+648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,
+648,648,648,648,648,648,648,647,647,647,647,647,649,647,647,647,
+647,647,647,647,647,115,650,650,650,650,650,650,650,650,650,650,
+651,651,651,651,115,115,115,115,115,115,115,115,115,115,115,115,
+652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,
+652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,
+652,652,652,653,654,654,652,115,115,115,115,115,115,115,115,115,
 
 /* block 162 */
-650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,
-650,650,114,650,650,650,650,650,650,650,650,650,650,650,650,650,
-650,650,650,650,650,650,650,650,650,650,650,650,651,651,651,652,
-652,652,651,651,652,651,652,652,653,653,653,653,653,653,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+655,655,656,657,657,657,657,657,657,657,657,657,657,657,657,657,
+657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,
+657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,
+657,657,657,656,656,656,655,655,655,655,655,655,655,655,655,656,
+656,657,657,657,657,658,658,658,658,658,655,655,655,658,115,115,
+659,659,659,659,659,659,659,659,659,659,657,658,657,658,658,658,
+115,660,660,660,660,660,660,660,660,660,660,660,660,660,660,660,
+660,660,660,660,660,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 163 */
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,
-654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,
-654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,655,
-656,656,656,655,655,655,655,655,655,655,655,114,114,114,114,114,
-657,657,657,657,657,657,657,657,657,657,114,114,114,114,114,114,
+661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,
+661,661,115,661,661,661,661,661,661,661,661,661,661,661,661,661,
+661,661,661,661,661,661,661,661,661,661,661,661,662,662,662,663,
+663,663,662,662,663,662,663,663,664,664,664,664,664,664,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 164 */
-114,658,659,659,114,660,660,660,660,660,660,660,660,114,114,660,
-660,114,114,660,660,660,660,660,660,660,660,660,660,660,660,660,
-660,660,660,660,660,660,660,660,660,114,660,660,660,660,660,660,
-660,114,660,660,114,660,660,660,660,660,114,114,658,660,661,659,
-658,659,659,659,659,114,114,659,659,114,114,659,659,659,114,114,
-114,114,114,114,114,114,114,661,114,114,114,114,114,660,660,660,
-660,660,659,659,114,114,658,658,658,658,658,658,658,114,114,114,
-658,658,658,658,658,114,114,114,114,114,114,114,114,114,114,114,
+665,665,665,665,665,665,665,115,665,115,665,665,665,665,115,665,
+665,665,665,665,665,665,665,665,665,665,665,665,665,665,115,665,
+665,665,665,665,665,665,665,665,665,666,115,115,115,115,115,115,
+667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,
+667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,
+667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,668,
+669,669,669,668,668,668,668,668,668,668,668,115,115,115,115,115,
+670,670,670,670,670,670,670,670,670,670,115,115,115,115,115,115,
 
 /* block 165 */
-662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,
-662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,
-662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,
-663,664,664,665,665,665,665,665,665,664,665,664,664,663,664,665,
-665,664,665,665,662,662,666,662,114,114,114,114,114,114,114,114,
-667,667,667,667,667,667,667,667,667,667,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+671,671,672,672,115,673,673,673,673,673,673,673,673,115,115,673,
+673,115,115,673,673,673,673,673,673,673,673,673,673,673,673,673,
+673,673,673,673,673,673,673,673,673,115,673,673,673,673,673,673,
+673,115,673,673,115,673,673,673,673,673,115,115,671,673,674,672,
+671,672,672,672,672,115,115,672,672,115,115,672,672,672,115,115,
+673,115,115,115,115,115,115,674,115,115,115,115,115,673,673,673,
+673,673,672,672,115,115,671,671,671,671,671,671,671,115,115,115,
+671,671,671,671,671,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 166 */
-668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,
-668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,
-668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,669,
-670,670,671,671,671,671,114,114,670,670,670,670,671,671,670,671,
-671,672,672,672,672,672,672,672,672,672,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,
+675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,
+675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,
+676,677,677,678,678,678,678,678,678,677,678,677,677,676,677,678,
+678,677,678,678,675,675,679,675,115,115,115,115,115,115,115,115,
+680,680,680,680,680,680,680,680,680,680,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 167 */
-673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,
-673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,
-673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,
-674,674,674,675,675,675,675,675,675,675,675,674,674,675,674,675,
-675,676,676,676,673,114,114,114,114,114,114,114,114,114,114,114,
-677,677,677,677,677,677,677,677,677,677,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,
+681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,
+681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,682,
+683,683,684,684,684,684,115,115,683,683,683,683,684,684,683,684,
+684,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,
+685,685,685,685,685,685,685,685,681,681,681,681,684,684,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 168 */
-678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,
-678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,
-678,678,678,678,678,678,678,678,678,678,678,679,680,679,680,680,
-679,679,679,679,679,679,680,679,114,114,114,114,114,114,114,114,
-681,681,681,681,681,681,681,681,681,681,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,
+686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,
+686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,
+687,687,687,688,688,688,688,688,688,688,688,687,687,688,687,688,
+688,689,689,689,686,115,115,115,115,115,115,115,115,115,115,115,
+690,690,690,690,690,690,690,690,690,690,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 169 */
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,
-682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,
-683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,
-683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,
-684,684,684,684,684,684,684,684,684,684,685,685,685,685,685,685,
-685,685,685,114,114,114,114,114,114,114,114,114,114,114,114,686,
+691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
+691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
+691,691,691,691,691,691,691,691,691,691,691,692,693,692,693,693,
+692,692,692,692,692,692,693,692,115,115,115,115,115,115,115,115,
+694,694,694,694,694,694,694,694,694,694,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 170 */
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,
-687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,
-687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,
-687,687,687,687,687,687,687,687,687,114,114,114,114,114,114,114,
+695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,
+695,695,695,695,695,695,695,695,695,695,115,115,115,696,696,696,
+697,697,696,696,696,696,697,696,696,696,696,696,115,115,115,115,
+698,698,698,698,698,698,698,698,698,698,699,699,700,700,700,701,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 171 */
-688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,
-688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,
-688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,
-688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,
-688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,
-688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,
-688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,
-688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,
+702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,
+703,703,703,703,703,703,703,703,703,703,703,703,703,703,703,703,
+703,703,703,703,703,703,703,703,703,703,703,703,703,703,703,703,
+704,704,704,704,704,704,704,704,704,704,705,705,705,705,705,705,
+705,705,705,115,115,115,115,115,115,115,115,115,115,115,115,706,
 
 /* block 172 */
-688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,
-688,688,688,688,688,688,688,688,688,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,
+707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,
+707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,
+707,707,707,707,707,707,707,707,707,115,115,115,115,115,115,115,
 
 /* block 173 */
-689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,
-689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,
-689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,
-689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,
-689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,
-689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,
-689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,114,
-690,690,690,690,690,114,114,114,114,114,114,114,114,114,114,114,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
 
 /* block 174 */
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,708,708,708,708,708,708,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 175 */
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
+709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
+709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
+709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
+709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
+709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
+709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,115,
+710,710,710,710,710,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 176 */
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 177 */
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,497,
-497,497,497,497,497,497,497,497,497,114,114,114,114,114,114,114,
-692,692,692,692,692,692,692,692,692,692,692,692,692,692,692,692,
-692,692,692,692,692,692,692,692,692,692,692,692,692,692,692,114,
-693,693,693,693,693,693,693,693,693,693,114,114,114,114,694,694,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
+711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
+711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
+711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
+711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
+711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
+711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
+711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
 
 /* block 178 */
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,
-695,695,695,695,695,695,695,695,695,695,695,695,695,695,114,114,
-696,696,696,696,696,697,114,114,114,114,114,114,114,114,114,114,
+711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
+711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
+711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 179 */
-698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,
-698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,
-698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,
-699,699,699,699,699,699,699,700,700,700,700,700,701,701,701,701,
-702,702,702,702,700,701,114,114,114,114,114,114,114,114,114,114,
-703,703,703,703,703,703,703,703,703,703,114,704,704,704,704,704,
-704,704,114,698,698,698,698,698,698,698,698,698,698,698,698,698,
-698,698,698,698,698,698,698,698,114,114,114,114,114,698,698,698,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
 
 /* block 180 */
-698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+712,712,712,712,712,712,712,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 181 */
-705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,
-705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,
-705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,
-705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,
-705,705,705,705,705,114,114,114,114,114,114,114,114,114,114,114,
-705,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,
-706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,
-706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,114,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
 
 /* block 182 */
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,707,
-707,707,707,708,708,708,708,708,708,708,708,708,708,708,708,708,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,115,115,115,115,115,115,115,
+713,713,713,713,713,713,713,713,713,713,713,713,713,713,713,713,
+713,713,713,713,713,713,713,713,713,713,713,713,713,713,713,115,
+714,714,714,714,714,714,714,714,714,714,115,115,115,115,715,715,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 183 */
-478,476,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,
+716,716,716,716,716,716,716,716,716,716,716,716,716,716,115,115,
+717,717,717,717,717,718,115,115,115,115,115,115,115,115,115,115,
 
 /* block 184 */
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
-709,709,709,709,709,709,709,709,709,709,709,114,114,114,114,114,
-709,709,709,709,709,709,709,709,709,709,709,709,709,114,114,114,
+719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,
+719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,
+719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,
+720,720,720,720,720,720,720,721,721,721,721,721,722,722,722,722,
+723,723,723,723,721,722,115,115,115,115,115,115,115,115,115,115,
+724,724,724,724,724,724,724,724,724,724,115,725,725,725,725,725,
+725,725,115,719,719,719,719,719,719,719,719,719,719,719,719,719,
+719,719,719,719,719,719,719,719,115,115,115,115,115,719,719,719,
 
 /* block 185 */
-709,709,709,709,709,709,709,709,709,114,114,114,114,114,114,114,
-709,709,709,709,709,709,709,709,709,709,114,114,710,711,711,712,
- 22, 22, 22, 22,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
 /* block 186 */
+726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,
+726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,
+726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,
+726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,
+726,726,726,726,726,115,115,115,115,115,115,115,115,115,115,115,
+726,727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,
+727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,
+727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,115,
+
+/* block 187 */
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,728,
+728,728,728,729,729,729,729,729,729,729,729,729,729,729,729,729,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 188 */
+479,477,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 189 */
+730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,
+730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,
+730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,
+730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,
+730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,
+730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,
+730,730,730,730,730,730,730,730,730,730,730,115,115,115,115,115,
+730,730,730,730,730,730,730,730,730,730,730,730,730,115,115,115,
+
+/* block 190 */
+730,730,730,730,730,730,730,730,730,115,115,115,115,115,115,115,
+730,730,730,730,730,730,730,730,730,730,115,115,731,732,732,733,
+ 22, 22, 22, 22,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 191 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@@ -3221,239 +3295,259 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19,114,114,114,114,114,114,114,114,114,114,
+ 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,
 
-/* block 187 */
+/* block 192 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19,114,114, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19,115,115, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19,713,405,109,109,109, 19, 19, 19,405,713,713,
-713,713,713, 22, 22, 22, 22, 22, 22, 22, 22,109,109,109,109,109,
+ 19, 19, 19, 19, 19,734,406,110,110,110, 19, 19, 19,406,734,734,
+734,734,734, 22, 22, 22, 22, 22, 22, 22, 22,110,110,110,110,110,
 
-/* block 188 */
-109,109,109, 19, 19,109,109,109,109,109,109,109, 19, 19, 19, 19,
+/* block 193 */
+110,110,110, 19, 19,110,110,110,110,110,110,110, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,110,110,110,110, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,109,109,109,109, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 189 */
-559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,
-559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,
-559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,
-559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,
-559,559,714,714,714,559,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+/* block 194 */
+564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,
+564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,
+564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,
+564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,
+564,564,735,735,735,564,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 190 */
+/* block 195 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19,114,114,114,114,114,114,114,114,114,
+ 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,
  23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
- 23, 23,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+ 23, 23,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 191 */
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,438,438,438,438,438,438,
+/* block 196 */
+438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
+438,438,438,438,438,438,438,438,438,438,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,438,438,438,438,438,438,438,438,438,438,438,438,
+438,438,438,438,438,438,438,438,438,438,438,438,438,438,439,439,
+439,439,439,439,439,115,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,438,438,438,438,438,438,438,438,
 438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,438,438,
-438,438,438,438,438,114,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
 
-/* block 192 */
-437,437,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,437,114,437,437,
-114,114,437,114,114,437,437,114,114,437,437,437,437,114,437,437,
-437,437,437,437,437,437,438,438,438,438,114,438,114,438,438,438,
-438,438,438,438,114,438,438,438,438,438,438,438,438,438,438,438,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,438,438,438,438,438,438,
+/* block 197 */
+438,438,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,438,115,438,438,
+115,115,438,115,115,438,438,115,115,438,438,438,438,115,438,438,
+438,438,438,438,438,438,439,439,439,439,115,439,115,439,439,439,
+439,439,439,439,115,439,439,439,439,439,439,439,439,439,439,439,
 438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
+438,438,438,438,438,438,438,438,438,438,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
 
-/* block 193 */
-438,438,438,438,437,437,114,437,437,437,437,114,114,437,437,437,
-437,437,437,437,437,114,437,437,437,437,437,437,437,114,438,438,
+/* block 198 */
+439,439,439,439,438,438,115,438,438,438,438,115,115,438,438,438,
+438,438,438,438,438,115,438,438,438,438,438,438,438,115,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,438,438,115,438,438,438,438,115,
+438,438,438,438,438,115,438,115,115,115,438,438,438,438,438,438,
+438,115,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,438,438,438,438,
 438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,437,437,114,437,437,437,437,114,
-437,437,437,437,437,114,437,114,114,114,437,437,437,437,437,437,
-437,114,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
 
-/* block 194 */
-437,437,437,437,437,437,438,438,438,438,438,438,438,438,438,438,
+/* block 199 */
+438,438,438,438,438,438,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
 438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,438,438,438,438,438,438,
+438,438,438,438,438,438,438,438,438,438,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,438,438,438,438,438,438,438,438,438,438,438,438,
+438,438,438,438,438,438,438,438,438,438,438,438,438,438,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+
+/* block 200 */
+439,439,439,439,439,439,439,439,438,438,438,438,438,438,438,438,
 438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,438,438,
+438,438,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,438,438,438,438,
 438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-
-/* block 195 */
-438,438,438,438,438,438,438,438,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,438,438,438,438,438,438,438,438,438,438,
+438,438,438,438,438,438,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
 438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
 
-/* block 196 */
-437,437,437,437,437,437,437,437,437,437,438,438,438,438,438,438,
+/* block 201 */
+438,438,438,438,438,438,438,438,438,438,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,439,439,115,115,438,438,438,438,438,438,438,438,
 438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,114,114,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,  8,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,  8,438,438,438,438,
-438,438,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,  8,438,438,438,438,
+438,  8,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,439,439,439,  8,439,439,439,439,
+439,439,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
+438,438,438,438,438,438,438,438,438,438,438,  8,439,439,439,439,
 
-/* block 197 */
+/* block 202 */
+439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,439,  8,439,439,439,439,439,439,438,438,438,438,
 438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,  8,438,438,438,438,438,438,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,  8,438,438,438,438,438,438,438,438,438,438,
+438,438,438,438,438,  8,439,439,439,439,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,  8,
+439,439,439,439,439,439,438,438,438,438,438,438,438,438,438,438,
 438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,  8,
-438,438,438,438,438,438,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,  8,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
+439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
 
-/* block 198 */
-438,438,438,438,438,438,438,438,438,  8,438,438,438,438,438,438,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,  8,438,438,438,438,438,438,
+/* block 203 */
+439,439,439,439,439,439,439,439,439,  8,439,439,439,439,439,439,
 438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,  8,438,438,438,438,438,438,437,438,114,114, 10, 10,
+438,438,438,438,438,438,438,438,438,  8,439,439,439,439,439,439,
+439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+439,439,439,  8,439,439,439,439,439,439,438,439,115,115, 10, 10,
  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
 
-/* block 199 */
-715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
-715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
-715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
-715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
-715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
-715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
-715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
-715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
+/* block 204 */
+736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
+736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
+736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
+736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
+736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
+736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
+736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
+736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
 
-/* block 200 */
-715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
-715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
-715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
-715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
-715,715,715,715,715,114,114,716,716,716,716,716,716,716,716,716,
-717,717,717,717,717,717,717,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+/* block 205 */
+737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,
+737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,
+737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,
+737,737,737,737,737,737,737,736,736,736,736,737,737,737,737,737,
+737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,
+737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,
+737,737,737,737,737,737,737,737,737,737,737,737,737,736,736,736,
+736,736,736,736,736,737,736,736,736,736,736,736,736,736,736,736,
 
-/* block 201 */
-199,199,199,199,114,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
-114,199,199,114,199,114,114,199,114,199,199,199,199,199,199,199,
-199,199,199,114,199,199,199,199,114,199,114,199,114,114,114,114,
-114,114,199,114,114,114,114,199,114,199,114,199,114,199,199,199,
-114,199,199,114,199,114,114,199,114,199,114,199,114,199,114,199,
-114,199,199,114,199,114,114,199,199,199,199,114,199,199,199,199,
-199,199,199,114,199,199,199,199,114,199,199,199,199,114,199,114,
+/* block 206 */
+736,736,736,736,737,736,736,738,738,738,738,738,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,737,737,737,737,737,
+115,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 202 */
-199,199,199,199,199,199,199,199,199,199,114,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,114,114,114,114,
-114,199,199,199,114,199,199,199,199,199,114,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-194,194,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+/* block 207 */
+739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
+739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
+739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
+739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
+739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
+739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
+739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
+739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
 
-/* block 203 */
+/* block 208 */
+739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
+739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
+739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
+739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
+739,739,739,739,739,115,115,740,740,740,740,740,740,740,740,740,
+741,741,741,741,741,741,741,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 209 */
+200,200,200,200,115,200,200,200,200,200,200,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+115,200,200,115,200,115,115,200,115,200,200,200,200,200,200,200,
+200,200,200,115,200,200,200,200,115,200,115,200,115,115,115,115,
+115,115,200,115,115,115,115,200,115,200,115,200,115,200,200,200,
+115,200,200,115,200,115,115,200,115,200,115,200,115,200,115,200,
+115,200,200,115,200,115,115,200,200,200,200,115,200,200,200,200,
+200,200,200,115,200,200,200,200,115,200,200,200,200,115,200,115,
+
+/* block 210 */
+200,200,200,200,200,200,200,200,200,200,115,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,115,115,115,115,
+115,200,200,200,115,200,200,200,200,200,115,200,200,200,200,200,
+200,200,200,200,200,200,200,200,200,200,200,200,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+195,195,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 211 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
 
-/* block 204 */
+/* block 212 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19,114,114,114,114,114,114,114,114,114,114,114,114,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,
-114, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-114, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-114, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,
+115, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+115, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+115, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19,114,114,114,114,114,114,114,114,114,114,
+ 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,
 
-/* block 205 */
- 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,114,114,114,
+/* block 213 */
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,115,115,115,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
 
-/* block 206 */
+/* block 214 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,718,718,718,718,718,718,718,718,718,718,
-718,718,718,718,718,718,718,718,718,718,718,718,718,718,718,718,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,742,742,742,742,742,742,742,742,742,742,
+742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,
 
-/* block 207 */
-719, 19, 19,114,114,114,114,114,114,114,114,114,114,114,114,114,
+/* block 215 */
+743, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,115,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,114,
- 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,114,114,114,
- 19, 19,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,
+ 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 208 */
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+/* block 216 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,
-
-/* block 209 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,
-114,114,114,114, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,114,114,114,114,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 14, 14, 14, 14, 14,
 
-/* block 210 */
+/* block 217 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@@ -3461,121 +3555,141 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115, 19, 19, 19, 19, 19,
 
-/* block 211 */
+/* block 218 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19,115, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,114,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114, 19, 19, 19, 19, 19,
-
-/* block 212 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19,114, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+
+/* block 219 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,
+ 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 213 */
+/* block 220 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19,114,114, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 214 */
+/* block 221 */
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,
- 19, 19, 19, 19,114,114,114,114,114,114,114,114,114,114,114,114,
+ 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 215 */
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+/* block 222 */
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19,114,114,114,114,114,114,114,114,114,114,114,114,
 
-/* block 216 */
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+/* block 223 */
+ 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,
  19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 217 */
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,114,114,114,114,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,114,114,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+/* block 224 */
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 218 */
- 19, 19, 19, 19, 19, 19, 19, 19,114,114,114,114,114,114,114,114,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+/* block 225 */
+ 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 219 */
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+/* block 226 */
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
 
-/* block 220 */
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,114,114,114,114,114,114,114,114,114,114,114,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
+/* block 227 */
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,115,115,115,115,115,115,115,115,115,115,115,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 
-/* block 221 */
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
-114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
+/* block 228 */
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,115,115,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
 
-/* block 222 */
-436, 22,436,436,436,436,436,436,436,436,436,436,436,436,436,436,
-436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,
+/* block 229 */
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 230 */
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+485,485,485,485,485,485,485,485,485,485,485,485,485,485,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 231 */
+437, 22,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
+437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
  22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
@@ -3583,45 +3697,45 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 58112 bytes, block = 128 */
  22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
 
-/* block 223 */
-436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,
-436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,
-436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,
-436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,
-436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,
-436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,
-436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,
-436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,
-
-/* block 224 */
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
+/* block 232 */
+437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
+437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
+437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
+437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
+437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
+437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
+437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
+437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
 
-/* block 225 */
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
-436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,
+/* block 233 */
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+
+/* block 234 */
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
 
-/* block 226 */
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,114,114,
+/* block 235 */
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+557,557,557,557,557,557,557,557,557,557,557,557,557,557,115,115,
 
 };
 
index e7db0c015e7e3b670cef6f68ca5e7c2cd7ae4367..0b7553e5e06270290d662503114ac8f54e1b9408 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -253,7 +253,14 @@ enum {
   ucp_Pau_Cin_Hau,
   ucp_Siddham,
   ucp_Tirhuta,
-  ucp_Warang_Citi
+  ucp_Warang_Citi,
+  /* New for Unicode 8.0.0: */
+  ucp_Ahom,
+  ucp_Anatolian_Hieroglyphs,
+  ucp_Hatran,
+  ucp_Multani,
+  ucp_Old_Hungarian,
+  ucp_SignWriting
 };
 
 #endif
index a97847ab98ce60225df1d1ff284b7dbc730e2fcf..2dfd8df34d0842d0d9fd720d8831d5b6b2e41728 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -131,11 +131,13 @@ PCRE2_ERROR_UTF8_ERR20  Isolated 0x80 byte (not within UTF-8 character)
 PCRE2_ERROR_UTF8_ERR21  Byte with the illegal value 0xfe or 0xff
 */
 
-for (p = string; length-- > 0; p++)
+for (p = string; length > 0; p++)
   {
   register uint32_t ab, d;
 
   c = *p;
+  length--;
+
   if (c < 128) continue;                /* ASCII character */
 
   if (c < 0xc0)                         /* Isolated 10xx xxxx byte */
@@ -324,9 +326,10 @@ PCRE2_ERROR_UTF16_ERR2  Invalid low surrogate
 PCRE2_ERROR_UTF16_ERR3  Isolated low surrogate
 */
 
-for (p = string; length-- > 0; p++)
+for (p = string; length > 0; p++)
   {
   c = *p;
+  length--;
 
   if ((c & 0xf800) != 0xd800)
     {
@@ -368,7 +371,7 @@ PCRE2_ERROR_UTF32_ERR1  Surrogate character
 PCRE2_ERROR_UTF32_ERR2  Character > 0x10ffff
 */
 
-for (p = string; length-- > 0; p++)
+for (p = string; length > 0; length--, p++)
   {
   c = *p;
   if ((c & 0xfffff800u) != 0xd800u)
index 2ea89c4b83ed73c615584c1ba105f8237c28bf87..407d3f5b879699d25dcfa73fcf500d04c4139a50 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -247,7 +247,7 @@ while ((t = *data++) != XCL_END)
 
       case PT_PXPUNCT:
       if ((PRIV(ucp_gentype)[prop->chartype] == ucp_P ||
-            (c < 256 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop)
+            (c < 128 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop)
         return !negated;
       break;
 
index d5a5d6db9a263add2cf05d1b0aa2244dec515db7..aadb22a575ef6bcdd6263c94f36cda0a72e1fc95 100644 (file)
@@ -13,7 +13,7 @@ distribution because other apparatus is needed to compile pcre2grep for z/OS.
 The header can be found in the special z/OS distribution, which is available
 from www.zaconsultants.net or from www.cbttape.org.
 
-           Copyright (c) 1997-2014 University of Cambridge
+           Copyright (c) 1997-2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -1691,9 +1691,13 @@ while (ptr < endptr)
 
     if (filenames == FN_NOMATCH_ONLY) return 1;
 
+    /* If all we want is a yes/no answer, we can return immediately. */
+
+    if (quiet) return 0;
+
     /* Just count if just counting is wanted. */
 
-    if (count_only) count++;
+    else if (count_only) count++;
 
     /* When handling a binary file and binary-files==binary, the "binary"
     variable will be set true (it's false in all other cases). In this
@@ -1705,8 +1709,8 @@ while (ptr < endptr)
       return 0;
       }
 
-    /* If all we want is a file name, there is no need to scan any more lines
-    in the file. */
+    /* Likewise, if all we want is a file name, there is no need to scan any
+    more lines in the file. */
 
     else if (filenames == FN_MATCH_ONLY)
       {
@@ -1714,10 +1718,6 @@ while (ptr < endptr)
       return 0;
       }
 
-    /* Likewise, if all we want is a yes/no answer. */
-
-    else if (quiet) return 0;
-
     /* The --only-matching option prints just the substring that matched,
     and/or one or more captured portions of it, as long as these strings are
     not empty. The --file-offsets and --line-offsets options output offsets for
@@ -2069,7 +2069,7 @@ if (filenames == FN_NOMATCH_ONLY)
 
 /* Print the match count if wanted */
 
-if (count_only)
+if (count_only && !quiet)
   {
   if (count > 0 || !omit_zero_count)
     {
@@ -2421,7 +2421,7 @@ return options;
 static char *
 ordin(int n)
 {
-static char buffer[8];
+static char buffer[14];
 char *p = buffer;
 sprintf(p, "%d", n);
 while (*p != 0) p++;
index da212fc4d152cca2d54390f3b3d8cf1a7804accb..1d6e5b7976699a4ef12f3a7ae1b81eb90a3ce205 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -106,7 +106,7 @@ static const int eint1[] = {
 
 static const int eint2[] = {
   30, REG_ECTYPE,  /* unknown POSIX class name */
-  32, REG_INVARG,  /* this version of PCRE does not have UTF or UCP support */
+  32, REG_INVARG,  /* this version of PCRE2 does not have Unicode support */
   37, REG_EESCAPE, /* PCRE2 does not support \L, \l, \N{name}, \U, or \u */
   56, REG_INVARG,  /* internal error: unknown newline setting */
 };
@@ -144,29 +144,23 @@ static const char *const pstring[] = {
 PCRE2POSIX_EXP_DEFN size_t PCRE2_CALL_CONVENTION
 regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
 {
-const char *message, *addmessage;
-size_t length, addlength;
+int used;
+const char *message;
 
-message = (errcode >= (int)(sizeof(pstring)/sizeof(char *)))?
+message = (errcode <= 0 || errcode >= (int)(sizeof(pstring)/sizeof(char *)))?
   "unknown error code" : pstring[errcode];
-length = strlen(message) + 1;
 
-addmessage = " at offset ";
-addlength = (preg != NULL && (int)preg->re_erroffset != -1)?
-  strlen(addmessage) + 6 : 0;
-
-if (errbuf_size > 0)
+if (preg != NULL && (int)preg->re_erroffset != -1)
   {
-  if (addlength > 0 && errbuf_size >= length + addlength)
-    sprintf(errbuf, "%s%s%-6d", message, addmessage, (int)preg->re_erroffset);
-  else
-    {
-    strncpy(errbuf, message, errbuf_size - 1);
-    errbuf[errbuf_size-1] = 0;
-    }
+  used = snprintf(errbuf, errbuf_size, "%s at offset %-6d", message,
+    (int)preg->re_erroffset);
+  }
+else
+  {
+  used = snprintf(errbuf, errbuf_size, "%s", message);
   }
 
-return length + addlength;
+return used + 1;
 }
 
 
@@ -223,8 +217,13 @@ preg->re_erroffset = erroffset;
 if (preg->re_pcre2_code == NULL)
   {
   unsigned int i;
-  if (errorcode < 0) return REG_BADPAT;   /* UTF error */
+
+  /* A negative value is a UTF error; otherwise all error codes are greater
+  than COMPILE_ERROR_BASE, but check, just in case. */
+
+  if (errorcode < COMPILE_ERROR_BASE) return REG_BADPAT;
   errorcode -= COMPILE_ERROR_BASE;
+
   if (errorcode < (int)(sizeof(eint1)/sizeof(const int)))
     return eint1[errorcode];
   for (i = 0; i < sizeof(eint2)/(2*sizeof(const int)); i += 2)
@@ -237,6 +236,13 @@ if (preg->re_pcre2_code == NULL)
 preg->re_nsub = (size_t)re_nsub;
 if ((options & PCRE2_NO_AUTO_CAPTURE) != 0) re_nsub = -1;
 preg->re_match_data = pcre2_match_data_create(re_nsub + 1, NULL);
+
+if (preg->re_match_data == NULL)
+  {
+  pcre2_code_free(preg->re_pcre2_code);
+  return REG_ESPACE;
+  }
+
 return 0;
 }
 
@@ -279,6 +285,7 @@ start location rather than being passed as a PCRE2 "starting offset". */
 
 if ((eflags & REG_STARTEND) != 0)
   {
+  if (pmatch == NULL) return REG_INVARG;
   so = pmatch[0].rm_so;
   eo = pmatch[0].rm_eo;
   }
index 6f19b51b29faf28a1e350720ce13997b9935d46b..44a2fd8ad4429eb754c6867c0bc6d4233fb03f0a 100644 (file)
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2014 University of Cambridge
+         New API code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
index 34cc3a5ed7f0706e676ca7831f8f32397540931f..0a5879e47209362a239b144d949ef3c3af05a968 100644 (file)
@@ -11,7 +11,7 @@ hacked-up (non-) design had also run out of steam.
 
                        Written by Philip Hazel
      Original code Copyright (c) 1997-2012 University of Cambridge
-         Rewritten code Copyright (c) 2015 University of Cambridge
+         Rewritten code Copyright (c) 2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -66,6 +66,14 @@ it references only the enabled library functions. */
 #include <locale.h>
 #include <errno.h>
 
+#if defined NATIVE_ZOS
+#include "pcrzoscs.h"
+/* That header is not included in the main PCRE2 distribution because other
+apparatus is needed to compile pcre2test for z/OS. The header can be found in
+the special z/OS distribution, which is available from www.zaconsultants.net or
+from www.cbttape.org. */
+#endif
+
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -174,13 +182,13 @@ void vms_setsymbol( char *, char *, int );
 #define LOCALESIZE 32           /* Size of locale name */
 #define LOOPREPEAT 500000       /* Default loop count for timing */
 #define PATSTACKSIZE 20         /* Pattern stack for save/restore testing */
-#define REPLACE_MODSIZE 96      /* Field for reading 8-bit replacement */
+#define REPLACE_MODSIZE 100     /* Field for reading 8-bit replacement */
 #define VERSION_SIZE 64         /* Size of buffer for the version strings */
 
 /* Make sure the buffer into which replacement strings are copied is big enough
 to hold them as 32-bit code units. */
 
-#define REPLACE_BUFFSIZE (4*REPLACE_MODSIZE)
+#define REPLACE_BUFFSIZE 1024   /* This is a byte value */
 
 /* Execution modes */
 
@@ -231,6 +239,22 @@ of PRIV avoids name clashes. */
 #include "pcre2_tables.c"
 #include "pcre2_ucd.c"
 
+/* 32-bit integer values in the input are read by strtoul() or strtol(). The
+check needed for overflow depends on whether long ints are in fact longer than
+ints. They are defined not to be shorter. */
+
+#if ULONG_MAX > UINT32_MAX
+#define U32OVERFLOW(x) (x > UINT32_MAX)
+#else
+#define U32OVERFLOW(x) (x == UINT32_MAX)
+#endif
+
+#if LONG_MAX > INT32_MAX
+#define S32OVERFLOW(x) (x > INT32_MAX || x < INT32_MIN)
+#else
+#define S32OVERFLOW(x) (x == INT32_MAX || x == INT32_MIN)
+#endif
+
 /* When PCRE2_CODE_UNIT_WIDTH is zero, pcre2_internal.h does not include
 pcre2_intmodedep.h, which is where mode-dependent macros and structures are
 defined. We can now include it for each supported code unit width. Because
@@ -328,17 +352,18 @@ typedef struct cmdstruct {
   int  value;
 } cmdstruct;
 
-enum { CMD_FORBID_UTF, CMD_LOAD, CMD_PATTERN, CMD_PERLTEST, CMD_POP, CMD_SAVE,
-  CMD_SUBJECT, CMD_UNKNOWN };
+enum { CMD_FORBID_UTF, CMD_LOAD, CMD_NEWLINE_DEFAULT, CMD_PATTERN,
+  CMD_PERLTEST, CMD_POP, CMD_SAVE, CMD_SUBJECT, CMD_UNKNOWN };
 
 static cmdstruct cmdlist[] = {
-  { "forbid_utf",  CMD_FORBID_UTF },
-  { "load",        CMD_LOAD },
-  { "pattern",     CMD_PATTERN },
-  { "perltest",    CMD_PERLTEST },
-  { "pop",         CMD_POP },
-  { "save",        CMD_SAVE },
-  { "subject",     CMD_SUBJECT }};
+  { "forbid_utf",      CMD_FORBID_UTF },
+  { "load",            CMD_LOAD },
+  { "newline_default", CMD_NEWLINE_DEFAULT },
+  { "pattern",         CMD_PATTERN },
+  { "perltest",        CMD_PERLTEST },
+  { "pop",             CMD_POP },
+  { "save",            CMD_SAVE },
+  { "subject",         CMD_SUBJECT }};
 
 #define cmdlistcount sizeof(cmdlist)/sizeof(cmdstruct)
 
@@ -370,38 +395,54 @@ enum { MOD_CTC,    /* Applies to a compile context */
        MOD_NL,     /* Is a newline value */
        MOD_NN,     /* Is a number or a name; more than one may occur */
        MOD_OPT,    /* Is an option bit */
+       MOD_SIZ,    /* Is a PCRE2_SIZE value */
        MOD_STR };  /* Is a string */
 
 /* Control bits. Some apply to compiling, some to matching, but some can be set
-either on a pattern or a data line, so they must all be distinct. */
-
-#define CTL_AFTERTEXT          0x00000001u
-#define CTL_ALLAFTERTEXT       0x00000002u
-#define CTL_ALLCAPTURES        0x00000004u
-#define CTL_ALLUSEDTEXT        0x00000008u
-#define CTL_ALTGLOBAL          0x00000010u
-#define CTL_BINCODE            0x00000020u
-#define CTL_CALLOUT_CAPTURE    0x00000040u
-#define CTL_CALLOUT_INFO       0x00000080u
-#define CTL_CALLOUT_NONE       0x00000100u
-#define CTL_DFA                0x00000200u
-#define CTL_FINDLIMITS         0x00000400u
-#define CTL_FULLBINCODE        0x00000800u
-#define CTL_GETALL             0x00001000u
-#define CTL_GLOBAL             0x00002000u
-#define CTL_HEXPAT             0x00004000u
-#define CTL_INFO               0x00008000u
-#define CTL_JITFAST            0x00010000u
-#define CTL_JITVERIFY          0x00020000u
-#define CTL_MARK               0x00040000u
-#define CTL_MEMORY             0x00080000u
-#define CTL_POSIX              0x00100000u
-#define CTL_PUSH               0x00200000u
-#define CTL_STARTCHAR          0x00400000u
-#define CTL_ZERO_TERMINATE     0x00800000u
-
-#define CTL_BSR_SET          0x80000000u  /* This is informational */
-#define CTL_NL_SET           0x40000000u  /* This is informational */
+either on a pattern or a data line, so they must all be distinct. There are now
+so many of them that they are split into two fields. */
+
+#define CTL_AFTERTEXT                    0x00000001u
+#define CTL_ALLAFTERTEXT                 0x00000002u
+#define CTL_ALLCAPTURES                  0x00000004u
+#define CTL_ALLUSEDTEXT                  0x00000008u
+#define CTL_ALTGLOBAL                    0x00000010u
+#define CTL_BINCODE                      0x00000020u
+#define CTL_CALLOUT_CAPTURE              0x00000040u
+#define CTL_CALLOUT_INFO                 0x00000080u
+#define CTL_CALLOUT_NONE                 0x00000100u
+#define CTL_DFA                          0x00000200u
+#define CTL_EXPAND                       0x00000400u
+#define CTL_FINDLIMITS                   0x00000800u
+#define CTL_FULLBINCODE                  0x00001000u
+#define CTL_GETALL                       0x00002000u
+#define CTL_GLOBAL                       0x00004000u
+#define CTL_HEXPAT                       0x00008000u
+#define CTL_INFO                         0x00010000u
+#define CTL_JITFAST                      0x00020000u
+#define CTL_JITVERIFY                    0x00040000u
+#define CTL_MARK                         0x00080000u
+#define CTL_MEMORY                       0x00100000u
+#define CTL_NULLCONTEXT                  0x00200000u
+#define CTL_POSIX                        0x00400000u
+#define CTL_PUSH                         0x00800000u
+#define CTL_STARTCHAR                    0x01000000u
+#define CTL_ZERO_TERMINATE               0x02000000u
+/* Spare                                 0x04000000u  */
+/* Spare                                 0x08000000u  */
+/* Spare                                 0x10000000u  */
+/* Spare                                 0x20000000u  */
+#define CTL_NL_SET                       0x40000000u  /* Informational */
+#define CTL_BSR_SET                      0x80000000u  /* Informational */
+
+/* Second control word */
+
+#define CTL2_SUBSTITUTE_EXTENDED         0x00000001u
+#define CTL2_SUBSTITUTE_OVERFLOW_LENGTH  0x00000002u
+#define CTL2_SUBSTITUTE_UNKNOWN_UNSET    0x00000004u
+#define CTL2_SUBSTITUTE_UNSET_EMPTY      0x00000008u
+
+/* Combinations */
 
 #define CTL_DEBUG            (CTL_FULLBINCODE|CTL_INFO)  /* For setting */
 #define CTL_ANYINFO          (CTL_DEBUG|CTL_BINCODE|CTL_CALLOUT_INFO)
@@ -420,6 +461,11 @@ data line. */
                     CTL_MEMORY|\
                     CTL_STARTCHAR)
 
+#define CTL2_ALLPD (CTL2_SUBSTITUTE_EXTENDED|\
+                    CTL2_SUBSTITUTE_OVERFLOW_LENGTH|\
+                    CTL2_SUBSTITUTE_UNKNOWN_UNSET|\
+                    CTL2_SUBSTITUTE_UNSET_EMPTY)
+
 /* Structures for holding modifier information for patterns and subject strings
 (data). Fields containing modifiers that can be set either for a pattern or a
 subject must be at the start and in the same order in both cases so that the
@@ -428,10 +474,12 @@ same offset in the big table below works for both. */
 typedef struct patctl {    /* Structure for pattern modifiers. */
   uint32_t  options;       /* Must be in same position as datctl */
   uint32_t  control;       /* Must be in same position as datctl */
+  uint32_t  control2;      /* Must be in same position as datctl */
    uint8_t  replacement[REPLACE_MODSIZE];  /* So must this */
   uint32_t  jit;
   uint32_t  stackguard_test;
   uint32_t  tables_id;
+  uint32_t  regerror_buffsize;
    uint8_t  locale[LOCALESIZE];
 } patctl;
 
@@ -441,6 +489,7 @@ typedef struct patctl {    /* Structure for pattern modifiers. */
 typedef struct datctl {    /* Structure for data line modifiers. */
   uint32_t  options;       /* Must be in same position as patctl */
   uint32_t  control;       /* Must be in same position as patctl */
+  uint32_t  control2;      /* Must be in same position as patctl */
    uint8_t  replacement[REPLACE_MODSIZE];  /* So must this */
   uint32_t  cfail[2];
    int32_t  callout_data;
@@ -481,82 +530,94 @@ typedef struct modstruct {
 } modstruct;
 
 static modstruct modlist[] = {
-  { "aftertext",           MOD_PNDP, MOD_CTL, CTL_AFTERTEXT,             PO(control) },
-  { "allaftertext",        MOD_PNDP, MOD_CTL, CTL_ALLAFTERTEXT,          PO(control) },
-  { "allcaptures",         MOD_PND,  MOD_CTL, CTL_ALLCAPTURES,           PO(control) },
-  { "allow_empty_class",   MOD_PAT,  MOD_OPT, PCRE2_ALLOW_EMPTY_CLASS,   PO(options) },
-  { "allusedtext",         MOD_PNDP, MOD_CTL, CTL_ALLUSEDTEXT,           PO(control) },
-  { "alt_bsux",            MOD_PAT,  MOD_OPT, PCRE2_ALT_BSUX,            PO(options) },
-  { "alt_circumflex",      MOD_PAT,  MOD_OPT, PCRE2_ALT_CIRCUMFLEX,      PO(options) },
-  { "altglobal",           MOD_PND,  MOD_CTL, CTL_ALTGLOBAL,             PO(control) },
-  { "anchored",            MOD_PD,   MOD_OPT, PCRE2_ANCHORED,            PD(options) },
-  { "auto_callout",        MOD_PAT,  MOD_OPT, PCRE2_AUTO_CALLOUT,        PO(options) },
-  { "bincode",             MOD_PAT,  MOD_CTL, CTL_BINCODE,               PO(control) },
-  { "bsr",                 MOD_CTC,  MOD_BSR, 0,                         CO(bsr_convention) },
-  { "callout_capture",     MOD_DAT,  MOD_CTL, CTL_CALLOUT_CAPTURE,       DO(control) },
-  { "callout_data",        MOD_DAT,  MOD_INS, 0,                         DO(callout_data) },
-  { "callout_fail",        MOD_DAT,  MOD_IN2, 0,                         DO(cfail) },
-  { "callout_info",        MOD_PAT,  MOD_CTL, CTL_CALLOUT_INFO,          PO(control) },
-  { "callout_none",        MOD_DAT,  MOD_CTL, CTL_CALLOUT_NONE,          DO(control) },
-  { "caseless",            MOD_PATP, MOD_OPT, PCRE2_CASELESS,            PO(options) },
-  { "copy",                MOD_DAT,  MOD_NN,  DO(copy_numbers),          DO(copy_names) },
-  { "debug",               MOD_PAT,  MOD_CTL, CTL_DEBUG,                 PO(control) },
-  { "dfa",                 MOD_DAT,  MOD_CTL, CTL_DFA,                   DO(control) },
-  { "dfa_restart",         MOD_DAT,  MOD_OPT, PCRE2_DFA_RESTART,         DO(options) },
-  { "dfa_shortest",        MOD_DAT,  MOD_OPT, PCRE2_DFA_SHORTEST,        DO(options) },
-  { "dollar_endonly",      MOD_PAT,  MOD_OPT, PCRE2_DOLLAR_ENDONLY,      PO(options) },
-  { "dotall",              MOD_PATP, MOD_OPT, PCRE2_DOTALL,              PO(options) },
-  { "dupnames",            MOD_PATP, MOD_OPT, PCRE2_DUPNAMES,            PO(options) },
-  { "extended",            MOD_PATP, MOD_OPT, PCRE2_EXTENDED,            PO(options) },
-  { "find_limits",         MOD_DAT,  MOD_CTL, CTL_FINDLIMITS,            DO(control) },
-  { "firstline",           MOD_PAT,  MOD_OPT, PCRE2_FIRSTLINE,           PO(options) },
-  { "fullbincode",         MOD_PAT,  MOD_CTL, CTL_FULLBINCODE,           PO(control) },
-  { "get",                 MOD_DAT,  MOD_NN,  DO(get_numbers),           DO(get_names) },
-  { "getall",              MOD_DAT,  MOD_CTL, CTL_GETALL,                DO(control) },
-  { "global",              MOD_PNDP, MOD_CTL, CTL_GLOBAL,                PO(control) },
-  { "hex",                 MOD_PAT,  MOD_CTL, CTL_HEXPAT,                PO(control) },
-  { "info",                MOD_PAT,  MOD_CTL, CTL_INFO,                  PO(control) },
-  { "jit",                 MOD_PAT,  MOD_IND, 7,                         PO(jit) },
-  { "jitfast",             MOD_PAT,  MOD_CTL, CTL_JITFAST,               PO(control) },
-  { "jitstack",            MOD_DAT,  MOD_INT, 0,                         DO(jitstack) },
-  { "jitverify",           MOD_PAT,  MOD_CTL, CTL_JITVERIFY,             PO(control) },
-  { "locale",              MOD_PAT,  MOD_STR, LOCALESIZE,                PO(locale) },
-  { "mark",                MOD_PNDP, MOD_CTL, CTL_MARK,                  PO(control) },
-  { "match_limit",         MOD_CTM,  MOD_INT, 0,                         MO(match_limit) },
-  { "match_unset_backref", MOD_PAT,  MOD_OPT, PCRE2_MATCH_UNSET_BACKREF, PO(options) },
-  { "memory",              MOD_PD,   MOD_CTL, CTL_MEMORY,                PD(control) },
-  { "multiline",           MOD_PATP, MOD_OPT, PCRE2_MULTILINE,           PO(options) },
-  { "never_backslash_c",   MOD_PAT,  MOD_OPT, PCRE2_NEVER_BACKSLASH_C,   PO(options) },
-  { "never_ucp",           MOD_PAT,  MOD_OPT, PCRE2_NEVER_UCP,           PO(options) },
-  { "never_utf",           MOD_PAT,  MOD_OPT, PCRE2_NEVER_UTF,           PO(options) },
-  { "newline",             MOD_CTC,  MOD_NL,  0,                         CO(newline_convention) },
-  { "no_auto_capture",     MOD_PAT,  MOD_OPT, PCRE2_NO_AUTO_CAPTURE,     PO(options) },
-  { "no_auto_possess",     MOD_PATP, MOD_OPT, PCRE2_NO_AUTO_POSSESS,     PO(options) },
-  { "no_dotstar_anchor",   MOD_PAT,  MOD_OPT, PCRE2_NO_DOTSTAR_ANCHOR,   PO(options) },
-  { "no_start_optimize",   MOD_PATP, MOD_OPT, PCRE2_NO_START_OPTIMIZE,   PO(options) },
-  { "no_utf_check",        MOD_PD,   MOD_OPT, PCRE2_NO_UTF_CHECK,        PD(options) },
-  { "notbol",              MOD_DAT,  MOD_OPT, PCRE2_NOTBOL,              DO(options) },
-  { "notempty",            MOD_DAT,  MOD_OPT, PCRE2_NOTEMPTY,            DO(options) },
-  { "notempty_atstart",    MOD_DAT,  MOD_OPT, PCRE2_NOTEMPTY_ATSTART,    DO(options) },
-  { "noteol",              MOD_DAT,  MOD_OPT, PCRE2_NOTEOL,              DO(options) },
-  { "offset",              MOD_DAT,  MOD_INT, 0,                         DO(offset) },
-  { "ovector",             MOD_DAT,  MOD_INT, 0,                         DO(oveccount) },
-  { "parens_nest_limit",   MOD_CTC,  MOD_INT, 0,                         CO(parens_nest_limit) },
-  { "partial_hard",        MOD_DAT,  MOD_OPT, PCRE2_PARTIAL_HARD,        DO(options) },
-  { "partial_soft",        MOD_DAT,  MOD_OPT, PCRE2_PARTIAL_SOFT,        DO(options) },
-  { "ph",                  MOD_DAT,  MOD_OPT, PCRE2_PARTIAL_HARD,        DO(options) },
-  { "posix",               MOD_PAT,  MOD_CTL, CTL_POSIX,                 PO(control) },
-  { "ps",                  MOD_DAT,  MOD_OPT, PCRE2_PARTIAL_SOFT,        DO(options) },
-  { "push",                MOD_PAT,  MOD_CTL, CTL_PUSH,                  PO(control) },
-  { "recursion_limit",     MOD_CTM,  MOD_INT, 0,                         MO(recursion_limit) },
-  { "replace",             MOD_PND,  MOD_STR, REPLACE_MODSIZE,           PO(replacement) },
-  { "stackguard",          MOD_PAT,  MOD_INT, 0,                         PO(stackguard_test) },
-  { "startchar",           MOD_PND,  MOD_CTL, CTL_STARTCHAR,             PO(control) },
-  { "tables",              MOD_PAT,  MOD_INT, 0,                         PO(tables_id) },
-  { "ucp",                 MOD_PATP, MOD_OPT, PCRE2_UCP,                 PO(options) },
-  { "ungreedy",            MOD_PAT,  MOD_OPT, PCRE2_UNGREEDY,            PO(options) },
-  { "utf",                 MOD_PATP, MOD_OPT, PCRE2_UTF,                 PO(options) },
-  { "zero_terminate",      MOD_DAT,  MOD_CTL, CTL_ZERO_TERMINATE,        DO(control) }
+  { "aftertext",                  MOD_PNDP, MOD_CTL, CTL_AFTERTEXT,              PO(control) },
+  { "allaftertext",               MOD_PNDP, MOD_CTL, CTL_ALLAFTERTEXT,           PO(control) },
+  { "allcaptures",                MOD_PND,  MOD_CTL, CTL_ALLCAPTURES,            PO(control) },
+  { "allow_empty_class",          MOD_PAT,  MOD_OPT, PCRE2_ALLOW_EMPTY_CLASS,    PO(options) },
+  { "allusedtext",                MOD_PNDP, MOD_CTL, CTL_ALLUSEDTEXT,            PO(control) },
+  { "alt_bsux",                   MOD_PAT,  MOD_OPT, PCRE2_ALT_BSUX,             PO(options) },
+  { "alt_circumflex",             MOD_PAT,  MOD_OPT, PCRE2_ALT_CIRCUMFLEX,       PO(options) },
+  { "alt_verbnames",              MOD_PAT,  MOD_OPT, PCRE2_ALT_VERBNAMES,        PO(options) },
+  { "altglobal",                  MOD_PND,  MOD_CTL, CTL_ALTGLOBAL,              PO(control) },
+  { "anchored",                   MOD_PD,   MOD_OPT, PCRE2_ANCHORED,             PD(options) },
+  { "auto_callout",               MOD_PAT,  MOD_OPT, PCRE2_AUTO_CALLOUT,         PO(options) },
+  { "bincode",                    MOD_PAT,  MOD_CTL, CTL_BINCODE,                PO(control) },
+  { "bsr",                        MOD_CTC,  MOD_BSR, 0,                          CO(bsr_convention) },
+  { "callout_capture",            MOD_DAT,  MOD_CTL, CTL_CALLOUT_CAPTURE,        DO(control) },
+  { "callout_data",               MOD_DAT,  MOD_INS, 0,                          DO(callout_data) },
+  { "callout_fail",               MOD_DAT,  MOD_IN2, 0,                          DO(cfail) },
+  { "callout_info",               MOD_PAT,  MOD_CTL, CTL_CALLOUT_INFO,           PO(control) },
+  { "callout_none",               MOD_DAT,  MOD_CTL, CTL_CALLOUT_NONE,           DO(control) },
+  { "caseless",                   MOD_PATP, MOD_OPT, PCRE2_CASELESS,             PO(options) },
+  { "copy",                       MOD_DAT,  MOD_NN,  DO(copy_numbers),           DO(copy_names) },
+  { "debug",                      MOD_PAT,  MOD_CTL, CTL_DEBUG,                  PO(control) },
+  { "dfa",                        MOD_DAT,  MOD_CTL, CTL_DFA,                    DO(control) },
+  { "dfa_restart",                MOD_DAT,  MOD_OPT, PCRE2_DFA_RESTART,          DO(options) },
+  { "dfa_shortest",               MOD_DAT,  MOD_OPT, PCRE2_DFA_SHORTEST,         DO(options) },
+  { "dollar_endonly",             MOD_PAT,  MOD_OPT, PCRE2_DOLLAR_ENDONLY,       PO(options) },
+  { "dotall",                     MOD_PATP, MOD_OPT, PCRE2_DOTALL,               PO(options) },
+  { "dupnames",                   MOD_PATP, MOD_OPT, PCRE2_DUPNAMES,             PO(options) },
+  { "expand",                     MOD_PAT,  MOD_CTL, CTL_EXPAND,                 PO(control) },
+  { "extended",                   MOD_PATP, MOD_OPT, PCRE2_EXTENDED,             PO(options) },
+  { "find_limits",                MOD_DAT,  MOD_CTL, CTL_FINDLIMITS,             DO(control) },
+  { "firstline",                  MOD_PAT,  MOD_OPT, PCRE2_FIRSTLINE,            PO(options) },
+  { "fullbincode",                MOD_PAT,  MOD_CTL, CTL_FULLBINCODE,            PO(control) },
+  { "get",                        MOD_DAT,  MOD_NN,  DO(get_numbers),            DO(get_names) },
+  { "getall",                     MOD_DAT,  MOD_CTL, CTL_GETALL,                 DO(control) },
+  { "global",                     MOD_PNDP, MOD_CTL, CTL_GLOBAL,                 PO(control) },
+  { "hex",                        MOD_PAT,  MOD_CTL, CTL_HEXPAT,                 PO(control) },
+  { "info",                       MOD_PAT,  MOD_CTL, CTL_INFO,                   PO(control) },
+  { "jit",                        MOD_PAT,  MOD_IND, 7,                          PO(jit) },
+  { "jitfast",                    MOD_PAT,  MOD_CTL, CTL_JITFAST,                PO(control) },
+  { "jitstack",                   MOD_DAT,  MOD_INT, 0,                          DO(jitstack) },
+  { "jitverify",                  MOD_PAT,  MOD_CTL, CTL_JITVERIFY,              PO(control) },
+  { "locale",                     MOD_PAT,  MOD_STR, LOCALESIZE,                 PO(locale) },
+  { "mark",                       MOD_PNDP, MOD_CTL, CTL_MARK,                   PO(control) },
+  { "match_limit",                MOD_CTM,  MOD_INT, 0,                          MO(match_limit) },
+  { "match_unset_backref",        MOD_PAT,  MOD_OPT, PCRE2_MATCH_UNSET_BACKREF,  PO(options) },
+  { "max_pattern_length",         MOD_CTC,  MOD_SIZ, 0,                          CO(max_pattern_length) },
+  { "memory",                     MOD_PD,   MOD_CTL, CTL_MEMORY,                 PD(control) },
+  { "multiline",                  MOD_PATP, MOD_OPT, PCRE2_MULTILINE,            PO(options) },
+  { "never_backslash_c",          MOD_PAT,  MOD_OPT, PCRE2_NEVER_BACKSLASH_C,    PO(options) },
+  { "never_ucp",                  MOD_PAT,  MOD_OPT, PCRE2_NEVER_UCP,            PO(options) },
+  { "never_utf",                  MOD_PAT,  MOD_OPT, PCRE2_NEVER_UTF,            PO(options) },
+  { "newline",                    MOD_CTC,  MOD_NL,  0,                          CO(newline_convention) },
+  { "no_auto_capture",            MOD_PAT,  MOD_OPT, PCRE2_NO_AUTO_CAPTURE,      PO(options) },
+  { "no_auto_possess",            MOD_PATP, MOD_OPT, PCRE2_NO_AUTO_POSSESS,      PO(options) },
+  { "no_dotstar_anchor",          MOD_PAT,  MOD_OPT, PCRE2_NO_DOTSTAR_ANCHOR,    PO(options) },
+  { "no_start_optimize",          MOD_PATP, MOD_OPT, PCRE2_NO_START_OPTIMIZE,    PO(options) },
+  { "no_utf_check",               MOD_PD,   MOD_OPT, PCRE2_NO_UTF_CHECK,         PD(options) },
+  { "notbol",                     MOD_DAT,  MOD_OPT, PCRE2_NOTBOL,               DO(options) },
+  { "notempty",                   MOD_DAT,  MOD_OPT, PCRE2_NOTEMPTY,             DO(options) },
+  { "notempty_atstart",           MOD_DAT,  MOD_OPT, PCRE2_NOTEMPTY_ATSTART,     DO(options) },
+  { "noteol",                     MOD_DAT,  MOD_OPT, PCRE2_NOTEOL,               DO(options) },
+  { "null_context",               MOD_PD,   MOD_CTL, CTL_NULLCONTEXT,            PO(control) },
+  { "offset",                     MOD_DAT,  MOD_INT, 0,                          DO(offset) },
+  { "offset_limit",               MOD_CTM,  MOD_SIZ, 0,                          MO(offset_limit)},
+  { "ovector",                    MOD_DAT,  MOD_INT, 0,                          DO(oveccount) },
+  { "parens_nest_limit",          MOD_CTC,  MOD_INT, 0,                          CO(parens_nest_limit) },
+  { "partial_hard",               MOD_DAT,  MOD_OPT, PCRE2_PARTIAL_HARD,         DO(options) },
+  { "partial_soft",               MOD_DAT,  MOD_OPT, PCRE2_PARTIAL_SOFT,         DO(options) },
+  { "ph",                         MOD_DAT,  MOD_OPT, PCRE2_PARTIAL_HARD,         DO(options) },
+  { "posix",                      MOD_PAT,  MOD_CTL, CTL_POSIX,                  PO(control) },
+  { "ps",                         MOD_DAT,  MOD_OPT, PCRE2_PARTIAL_SOFT,         DO(options) },
+  { "push",                       MOD_PAT,  MOD_CTL, CTL_PUSH,                   PO(control) },
+  { "recursion_limit",            MOD_CTM,  MOD_INT, 0,                          MO(recursion_limit) },
+  { "regerror_buffsize",          MOD_PAT,  MOD_INT, 0,                          PO(regerror_buffsize) },
+  { "replace",                    MOD_PND,  MOD_STR, REPLACE_MODSIZE,            PO(replacement) },
+  { "stackguard",                 MOD_PAT,  MOD_INT, 0,                          PO(stackguard_test) },
+  { "startchar",                  MOD_PND,  MOD_CTL, CTL_STARTCHAR,              PO(control) },
+  { "startoffset",                MOD_DAT,  MOD_INT, 0,                          DO(offset) },
+  { "substitute_extended",        MOD_PND,  MOD_CTL, CTL2_SUBSTITUTE_EXTENDED,   PO(control2) },
+  { "substitute_overflow_length", MOD_PND,  MOD_CTL, CTL2_SUBSTITUTE_OVERFLOW_LENGTH, PO(control2) },
+  { "substitute_unknown_unset",   MOD_PND,  MOD_CTL, CTL2_SUBSTITUTE_UNKNOWN_UNSET, PO(control2) },
+  { "substitute_unset_empty",     MOD_PND,  MOD_CTL, CTL2_SUBSTITUTE_UNSET_EMPTY, PO(control2) },
+  { "tables",                     MOD_PAT,  MOD_INT, 0,                          PO(tables_id) },
+  { "ucp",                        MOD_PATP, MOD_OPT, PCRE2_UCP,                  PO(options) },
+  { "ungreedy",                   MOD_PAT,  MOD_OPT, PCRE2_UNGREEDY,             PO(options) },
+  { "use_offset_limit",           MOD_PAT,  MOD_OPT, PCRE2_USE_OFFSET_LIMIT,     PO(options) },
+  { "utf",                        MOD_PATP, MOD_OPT, PCRE2_UTF,                  PO(options) },
+  { "zero_terminate",             MOD_DAT,  MOD_CTL, CTL_ZERO_TERMINATE,         DO(control) }
 };
 
 #define MODLISTCOUNT sizeof(modlist)/sizeof(modstruct)
@@ -568,16 +629,15 @@ static modstruct modlist[] = {
   PCRE2_UCP|PCRE2_UTF|PCRE2_UNGREEDY)
 
 #define POSIX_SUPPORTED_COMPILE_CONTROLS ( \
-  CTL_AFTERTEXT|CTL_ALLAFTERTEXT|CTL_POSIX)
+  CTL_AFTERTEXT|CTL_ALLAFTERTEXT|CTL_EXPAND|CTL_POSIX)
+
+#define POSIX_SUPPORTED_COMPILE_CONTROLS2 (0)
 
 #define POSIX_SUPPORTED_MATCH_OPTIONS ( \
   PCRE2_NOTBOL|PCRE2_NOTEMPTY|PCRE2_NOTEOL)
 
-#define POSIX_SUPPORTED_MATCH_CONTROLS (CTL_AFTERTEXT|CTL_ALLAFTERTEXT)
-
-/* Controls that are mutually exclusive. */
-
-#define EXCLUSIVE_DAT_CONTROLS (CTL_ALLUSEDTEXT|CTL_STARTCHAR)
+#define POSIX_SUPPORTED_MATCH_CONTROLS  (CTL_AFTERTEXT|CTL_ALLAFTERTEXT)
+#define POSIX_SUPPORTED_MATCH_CONTROLS2 (0)
 
 /* Control bits that are not ignored with 'push'. */
 
@@ -585,14 +645,31 @@ static modstruct modlist[] = {
   CTL_BINCODE|CTL_CALLOUT_INFO|CTL_FULLBINCODE|CTL_HEXPAT|CTL_INFO| \
   CTL_JITVERIFY|CTL_MEMORY|CTL_PUSH|CTL_BSR_SET|CTL_NL_SET)
 
+#define PUSH_SUPPORTED_COMPILE_CONTROLS2 (0)
+
 /* Controls that apply only at compile time with 'push'. */
 
-#define PUSH_COMPILE_ONLY_CONTROLS  CTL_JITVERIFY
+#define PUSH_COMPILE_ONLY_CONTROLS   CTL_JITVERIFY
+#define PUSH_COMPILE_ONLY_CONTROLS2  (0)
 
 /* Controls that are forbidden with #pop. */
 
 #define NOTPOP_CONTROLS (CTL_HEXPAT|CTL_POSIX|CTL_PUSH)
 
+/* Pattern controls that are mutually exclusive. At present these are all in
+the first control word. */
+
+static uint32_t exclusive_pat_controls[] = {
+  CTL_POSIX  | CTL_HEXPAT,
+  CTL_POSIX  | CTL_PUSH,
+  CTL_EXPAND | CTL_HEXPAT };
+
+/* Data controls that are mutually exclusive. At present these are all in the
+first control word. */
+static uint32_t exclusive_dat_controls[] = {
+  CTL_ALLUSEDTEXT | CTL_STARTCHAR,
+  CTL_FINDLIMITS  | CTL_NULLCONTEXT };
+
 /* Table of single-character abbreviated modifiers. The index field is
 initialized to -1, but the first time the modifier is encountered, it is filled
 in with the index of the full entry in modlist, to save repeated searching when
@@ -648,6 +725,12 @@ table itself easier to read. */
 #define EBCDIC_NL 0
 #endif
 
+#ifdef NEVER_BACKSLASH_C
+#define BACKSLASH_C 0
+#else
+#define BACKSLASH_C 1
+#endif
+
 typedef struct coptstruct {
   const char *name;
   uint32_t    type;
@@ -662,16 +745,17 @@ enum { CONF_BSR,
 };
 
 static coptstruct coptlist[] = {
-  { "bsr",       CONF_BSR, PCRE2_CONFIG_BSR },
-  { "ebcdic",    CONF_FIX, SUPPORT_EBCDIC },
-  { "ebcdic-nl", CONF_FIZ, EBCDIC_NL },
-  { "jit",       CONF_INT, PCRE2_CONFIG_JIT },
-  { "linksize",  CONF_INT, PCRE2_CONFIG_LINKSIZE },
-  { "newline",   CONF_NL,  PCRE2_CONFIG_NEWLINE },
-  { "pcre2-16",  CONF_FIX, SUPPORT_16 },
-  { "pcre2-32",  CONF_FIX, SUPPORT_32 },
-  { "pcre2-8",   CONF_FIX, SUPPORT_8 },
-  { "unicode",   CONF_INT, PCRE2_CONFIG_UNICODE }
+  { "backslash-C", CONF_FIX, BACKSLASH_C },
+  { "bsr",         CONF_BSR, PCRE2_CONFIG_BSR },
+  { "ebcdic",      CONF_FIX, SUPPORT_EBCDIC },
+  { "ebcdic-nl",   CONF_FIZ, EBCDIC_NL },
+  { "jit",         CONF_INT, PCRE2_CONFIG_JIT },
+  { "linksize",    CONF_INT, PCRE2_CONFIG_LINKSIZE },
+  { "newline",     CONF_NL,  PCRE2_CONFIG_NEWLINE },
+  { "pcre2-16",    CONF_FIX, SUPPORT_16 },
+  { "pcre2-32",    CONF_FIX, SUPPORT_32 },
+  { "pcre2-8",     CONF_FIX, SUPPORT_8 },
+  { "unicode",     CONF_INT, PCRE2_CONFIG_UNICODE }
 };
 
 #define COPTLISTCOUNT sizeof(coptlist)/sizeof(coptstruct)
@@ -697,6 +781,7 @@ static BOOL restrict_for_perl_test = FALSE;
 static BOOL show_memory = FALSE;
 
 static int code_unit_size;                    /* Bytes */
+static int jitrc;                             /* Return from JIT compile */
 static int test_mode = DEFAULT_TEST_MODE;
 static int timeit = 0;
 static int timeitm = 0;
@@ -711,6 +796,8 @@ static uint32_t maxlookbehind;
 static uint32_t max_oveccount;
 static uint32_t callout_count;
 
+static uint16_t local_newline_default = 0;
+
 static VERSION_TYPE jittarget[VERSION_SIZE];
 static VERSION_TYPE version[VERSION_SIZE];
 static VERSION_TYPE uversion[VERSION_SIZE];
@@ -737,7 +824,7 @@ buffer is where all input lines are read. Its size is the same as pbuffer8.
 Pattern lines are always copied to pbuffer8 for use in callouts, even if they
 are actually compiled from pbuffer16 or pbuffer32. */
 
-static int       pbuffer8_size  = 50000;        /* Initial size, bytes */
+static size_t    pbuffer8_size  = 50000;        /* Initial size, bytes */
 static uint8_t  *pbuffer8 = NULL;
 static uint8_t  *buffer = NULL;
 
@@ -858,19 +945,19 @@ are supported. */
 
 #define PCRE2_COMPILE(a,b,c,d,e,f,g) \
   if (test_mode == PCRE8_MODE) \
-    G(a,8) = pcre2_compile_8(G(b,8),c,d,e,f,G(g,8)); \
+    G(a,8) = pcre2_compile_8(G(b,8),c,d,e,f,g); \
   else if (test_mode == PCRE16_MODE) \
-    G(a,16) = pcre2_compile_16(G(b,16),c,d,e,f,G(g,16)); \
+    G(a,16) = pcre2_compile_16(G(b,16),c,d,e,f,g); \
   else \
-    G(a,32) = pcre2_compile_32(G(b,32),c,d,e,f,G(g,32))
+    G(a,32) = pcre2_compile_32(G(b,32),c,d,e,f,g)
 
 #define PCRE2_DFA_MATCH(a,b,c,d,e,f,g,h,i,j) \
   if (test_mode == PCRE8_MODE) \
-    a = pcre2_dfa_match_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),G(h,8),i,j); \
+    a = pcre2_dfa_match_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),h,i,j); \
   else if (test_mode == PCRE16_MODE) \
-    a = pcre2_dfa_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),G(h,16),i,j); \
+    a = pcre2_dfa_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),h,i,j); \
   else \
-    a = pcre2_dfa_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),G(h,32),i,j)
+    a = pcre2_dfa_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),h,i,j)
 
 #define PCRE2_GET_ERROR_MESSAGE(r,a,b) \
   if (test_mode == PCRE8_MODE) \
@@ -896,10 +983,10 @@ are supported. */
   else \
     a = pcre2_get_startchar_32(G(b,32))
 
-#define PCRE2_JIT_COMPILE(a,b) \
-  if (test_mode == PCRE8_MODE) pcre2_jit_compile_8(G(a,8),b); \
-  else if (test_mode == PCRE16_MODE) pcre2_jit_compile_16(G(a,16),b); \
-  else pcre2_jit_compile_32(G(a,32),b)
+#define PCRE2_JIT_COMPILE(r,a,b) \
+  if (test_mode == PCRE8_MODE) r = pcre2_jit_compile_8(G(a,8),b); \
+  else if (test_mode == PCRE16_MODE) r = pcre2_jit_compile_16(G(a,16),b); \
+  else r = pcre2_jit_compile_32(G(a,32),b)
 
 #define PCRE2_JIT_FREE_UNUSED_MEMORY(a) \
   if (test_mode == PCRE8_MODE) pcre2_jit_free_unused_memory_8(G(a,8)); \
@@ -908,11 +995,11 @@ are supported. */
 
 #define PCRE2_JIT_MATCH(a,b,c,d,e,f,g,h) \
   if (test_mode == PCRE8_MODE) \
-    a = pcre2_jit_match_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),G(h,8)); \
+    a = pcre2_jit_match_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),h); \
   else if (test_mode == PCRE16_MODE) \
-    a = pcre2_jit_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),G(h,16)); \
+    a = pcre2_jit_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),h); \
   else \
-    a = pcre2_jit_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),G(h,32))
+    a = pcre2_jit_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),h)
 
 #define PCRE2_JIT_STACK_CREATE(a,b,c,d) \
   if (test_mode == PCRE8_MODE) \
@@ -945,11 +1032,11 @@ are supported. */
 
 #define PCRE2_MATCH(a,b,c,d,e,f,g,h) \
   if (test_mode == PCRE8_MODE) \
-    a = pcre2_match_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),G(h,8)); \
+    a = pcre2_match_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),h); \
   else if (test_mode == PCRE16_MODE) \
-    a = pcre2_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),G(h,16)); \
+    a = pcre2_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),h); \
   else \
-    a = pcre2_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),G(h,32))
+    a = pcre2_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),h)
 
 #define PCRE2_MATCH_DATA_CREATE(a,b,c) \
   if (test_mode == PCRE8_MODE) \
@@ -1055,6 +1142,22 @@ are supported. */
   else \
     pcre2_set_match_limit_32(G(a,32),b)
 
+#define PCRE2_SET_MAX_PATTERN_LENGTH(a,b) \
+  if (test_mode == PCRE8_MODE) \
+    pcre2_set_max_pattern_length_8(G(a,8),b); \
+  else if (test_mode == PCRE16_MODE) \
+    pcre2_set_max_pattern_length_16(G(a,16),b); \
+  else \
+    pcre2_set_max_pattern_length_32(G(a,32),b)
+
+#define PCRE2_SET_OFFSET_LIMIT(a,b) \
+  if (test_mode == PCRE8_MODE) \
+    pcre2_set_offset_limit_8(G(a,8),b); \
+  else if (test_mode == PCRE16_MODE) \
+    pcre2_set_offset_limit_16(G(a,16),b); \
+  else \
+    pcre2_set_offset_limit_32(G(a,32),b)
+
 #define PCRE2_SET_PARENS_NEST_LIMIT(a,b) \
   if (test_mode == PCRE8_MODE) \
     pcre2_set_parens_nest_limit_8(G(a,8),b); \
@@ -1293,17 +1396,17 @@ the three different cases. */
 
 #define PCRE2_COMPILE(a,b,c,d,e,f,g) \
   if (test_mode == G(G(PCRE,BITONE),_MODE)) \
-    G(a,BITONE) = G(pcre2_compile_,BITONE)(G(b,BITONE),c,d,e,f,G(g,BITONE)); \
+    G(a,BITONE) = G(pcre2_compile_,BITONE)(G(b,BITONE),c,d,e,f,g); \
   else \
-    G(a,BITTWO) = G(pcre2_compile_,BITTWO)(G(b,BITTWO),c,d,e,f,G(g,BITTWO))
+    G(a,BITTWO) = G(pcre2_compile_,BITTWO)(G(b,BITTWO),c,d,e,f,g)
 
 #define PCRE2_DFA_MATCH(a,b,c,d,e,f,g,h,i,j) \
   if (test_mode == G(G(PCRE,BITONE),_MODE)) \
     a = G(pcre2_dfa_match_,BITONE)(G(b,BITONE),(G(PCRE2_SPTR,BITONE))c,d,e,f, \
-      G(g,BITONE),G(h,BITONE),i,j); \
+      G(g,BITONE),h,i,j); \
   else \
     a = G(pcre2_dfa_match_,BITTWO)(G(b,BITTWO),(G(PCRE2_SPTR,BITTWO))c,d,e,f, \
-      G(g,BITTWO),G(h,BITTWO),i,j)
+      G(g,BITTWO),h,i,j)
 
 #define PCRE2_GET_ERROR_MESSAGE(r,a,b) \
   if (test_mode == G(G(PCRE,BITONE),_MODE)) \
@@ -1323,11 +1426,11 @@ the three different cases. */
   else \
     a = G(pcre2_get_startchar_,BITTWO)(G(b,BITTWO))
 
-#define PCRE2_JIT_COMPILE(a,b) \
+#define PCRE2_JIT_COMPILE(r,a,b) \
   if (test_mode == G(G(PCRE,BITONE),_MODE)) \
-    G(pcre2_jit_compile_,BITONE)(G(a,BITONE),b); \
+    r = G(pcre2_jit_compile_,BITONE)(G(a,BITONE),b); \
   else \
-    G(pcre2_jit_compile_,BITTWO)(G(a,BITTWO),b)
+    r = G(pcre2_jit_compile_,BITTWO)(G(a,BITTWO),b)
 
 #define PCRE2_JIT_FREE_UNUSED_MEMORY(a) \
   if (test_mode == G(G(PCRE,BITONE),_MODE)) \
@@ -1338,10 +1441,10 @@ the three different cases. */
 #define PCRE2_JIT_MATCH(a,b,c,d,e,f,g,h) \
   if (test_mode == G(G(PCRE,BITONE),_MODE)) \
     a = G(pcre2_jit_match_,BITONE)(G(b,BITONE),(G(PCRE2_SPTR,BITONE))c,d,e,f, \
-      G(g,BITONE),G(h,BITONE)); \
+      G(g,BITONE),h); \
   else \
     a = G(pcre2_jit_match_,BITTWO)(G(b,BITTWO),(G(PCRE2_SPTR,BITTWO))c,d,e,f, \
-      G(g,BITTWO),G(h,BITTWO))
+      G(g,BITTWO),h)
 
 #define PCRE2_JIT_STACK_CREATE(a,b,c,d) \
   if (test_mode == G(G(PCRE,BITONE),_MODE)) \
@@ -1370,10 +1473,10 @@ the three different cases. */
 #define PCRE2_MATCH(a,b,c,d,e,f,g,h) \
   if (test_mode == G(G(PCRE,BITONE),_MODE)) \
     a = G(pcre2_match_,BITONE)(G(b,BITONE),(G(PCRE2_SPTR,BITONE))c,d,e,f, \
-      G(g,BITONE),G(h,BITONE)); \
+      G(g,BITONE),h); \
   else \
     a = G(pcre2_match_,BITTWO)(G(b,BITTWO),(G(PCRE2_SPTR,BITTWO))c,d,e,f, \
-      G(g,BITTWO),G(h,BITTWO))
+      G(g,BITTWO),h)
 
 #define PCRE2_MATCH_DATA_CREATE(a,b,c) \
   if (test_mode == G(G(PCRE,BITONE),_MODE)) \
@@ -1455,6 +1558,18 @@ the three different cases. */
   else \
     G(pcre2_set_match_limit_,BITTWO)(G(a,BITTWO),b)
 
+#define PCRE2_SET_MAX_PATTERN_LENGTH(a,b) \
+  if (test_mode == G(G(PCRE,BITONE),_MODE)) \
+    G(pcre2_set_max_pattern_length_,BITONE)(G(a,BITONE),b); \
+  else \
+    G(pcre2_set_max_pattern_length_,BITTWO)(G(a,BITTWO),b)
+
+#define PCRE2_SET_OFFSET_LIMIT(a,b) \
+  if (test_mode == G(G(PCRE,BITONE),_MODE)) \
+    G(pcre2_set_offset_limit_,BITONE)(G(a,BITONE),b); \
+  else \
+    G(pcre2_set_offset_limit_,BITTWO)(G(a,BITTWO),b)
+
 #define PCRE2_SET_PARENS_NEST_LIMIT(a,b) \
   if (test_mode == G(G(PCRE,BITONE),_MODE)) \
     G(pcre2_set_parens_nest_limit_,BITONE)(G(a,BITONE),b); \
@@ -1615,17 +1730,17 @@ the three different cases. */
    a = pcre2_callout_enumerate_8(compiled_code8, \
      (int (*)(struct pcre2_callout_enumerate_block_8 *, void *))b,c)
 #define PCRE2_COMPILE(a,b,c,d,e,f,g) \
-  G(a,8) = pcre2_compile_8(G(b,8),c,d,e,f,G(g,8))
+  G(a,8) = pcre2_compile_8(G(b,8),c,d,e,f,g)
 #define PCRE2_DFA_MATCH(a,b,c,d,e,f,g,h,i,j) \
-  a = pcre2_dfa_match_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),G(h,8),i,j)
+  a = pcre2_dfa_match_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),h,i,j)
 #define PCRE2_GET_ERROR_MESSAGE(r,a,b) \
   r = pcre2_get_error_message_8(a,G(b,8),G(G(b,8),_size))
 #define PCRE2_GET_OVECTOR_COUNT(a,b) a = pcre2_get_ovector_count_8(G(b,8))
 #define PCRE2_GET_STARTCHAR(a,b) a = pcre2_get_startchar_8(G(b,8))
-#define PCRE2_JIT_COMPILE(a,b) pcre2_jit_compile_8(G(a,8),b)
+#define PCRE2_JIT_COMPILE(r,a,b) r = pcre2_jit_compile_8(G(a,8),b)
 #define PCRE2_JIT_FREE_UNUSED_MEMORY(a) pcre2_jit_free_unused_memory_8(G(a,8))
 #define PCRE2_JIT_MATCH(a,b,c,d,e,f,g,h) \
-  a = pcre2_jit_match_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),G(h,8))
+  a = pcre2_jit_match_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),h)
 #define PCRE2_JIT_STACK_CREATE(a,b,c,d) \
   a = (PCRE2_JIT_STACK *)pcre2_jit_stack_create_8(b,c,d);
 #define PCRE2_JIT_STACK_ASSIGN(a,b,c) \
@@ -1633,7 +1748,7 @@ the three different cases. */
 #define PCRE2_JIT_STACK_FREE(a) pcre2_jit_stack_free_8((pcre2_jit_stack_8 *)a);
 #define PCRE2_MAKETABLES(a) a = pcre2_maketables_8(NULL)
 #define PCRE2_MATCH(a,b,c,d,e,f,g,h) \
-  a = pcre2_match_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),G(h,8))
+  a = pcre2_match_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),h)
 #define PCRE2_MATCH_DATA_CREATE(a,b,c) G(a,8) = pcre2_match_data_create_8(b,c)
 #define PCRE2_MATCH_DATA_CREATE_FROM_PATTERN(a,b,c) \
   G(a,8) = pcre2_match_data_create_from_pattern_8(G(b,8),c)
@@ -1653,6 +1768,8 @@ the three different cases. */
 #define PCRE2_SET_COMPILE_RECURSION_GUARD(a,b,c) \
   pcre2_set_compile_recursion_guard_8(G(a,8),b,c)
 #define PCRE2_SET_MATCH_LIMIT(a,b) pcre2_set_match_limit_8(G(a,8),b)
+#define PCRE2_SET_MAX_PATTERN_LENGTH(a,b) pcre2_set_max_pattern_length_8(G(a,8),b)
+#define PCRE2_SET_OFFSET_LIMIT(a,b) pcre2_set_offset_limit_8(G(a,8),b)
 #define PCRE2_SET_PARENS_NEST_LIMIT(a,b) pcre2_set_parens_nest_limit_8(G(a,8),b)
 #define PCRE2_SET_RECURSION_LIMIT(a,b) pcre2_set_recursion_limit_8(G(a,8),b)
 #define PCRE2_SUBSTITUTE(a,b,c,d,e,f,g,h,i,j,k,l) \
@@ -1706,17 +1823,17 @@ the three different cases. */
    a = pcre2_callout_enumerate_16(compiled_code16, \
      (int (*)(struct pcre2_callout_enumerate_block_16 *, void *))b,c)
 #define PCRE2_COMPILE(a,b,c,d,e,f,g) \
-  G(a,16) = pcre2_compile_16(G(b,16),c,d,e,f,G(g,16))
+  G(a,16) = pcre2_compile_16(G(b,16),c,d,e,f,g)
 #define PCRE2_DFA_MATCH(a,b,c,d,e,f,g,h,i,j) \
-  a = pcre2_dfa_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),G(h,16),i,j)
+  a = pcre2_dfa_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),h,i,j)
 #define PCRE2_GET_ERROR_MESSAGE(r,a,b) \
   r = pcre2_get_error_message_16(a,G(b,16),G(G(b,16),_size))
 #define PCRE2_GET_OVECTOR_COUNT(a,b) a = pcre2_get_ovector_count_16(G(b,16))
 #define PCRE2_GET_STARTCHAR(a,b) a = pcre2_get_startchar_16(G(b,16))
-#define PCRE2_JIT_COMPILE(a,b) pcre2_jit_compile_16(G(a,16),b)
+#define PCRE2_JIT_COMPILE(r,a,b) r = pcre2_jit_compile_16(G(a,16),b)
 #define PCRE2_JIT_FREE_UNUSED_MEMORY(a) pcre2_jit_free_unused_memory_16(G(a,16))
 #define PCRE2_JIT_MATCH(a,b,c,d,e,f,g,h) \
-  a = pcre2_jit_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),G(h,16))
+  a = pcre2_jit_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),h)
 #define PCRE2_JIT_STACK_CREATE(a,b,c,d) \
   a = (PCRE2_JIT_STACK *)pcre2_jit_stack_create_16(b,c,d);
 #define PCRE2_JIT_STACK_ASSIGN(a,b,c) \
@@ -1724,7 +1841,7 @@ the three different cases. */
 #define PCRE2_JIT_STACK_FREE(a) pcre2_jit_stack_free_16((pcre2_jit_stack_16 *)a);
 #define PCRE2_MAKETABLES(a) a = pcre2_maketables_16(NULL)
 #define PCRE2_MATCH(a,b,c,d,e,f,g,h) \
-  a = pcre2_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),G(h,16))
+  a = pcre2_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),h)
 #define PCRE2_MATCH_DATA_CREATE(a,b,c) G(a,16) = pcre2_match_data_create_16(b,c)
 #define PCRE2_MATCH_DATA_CREATE_FROM_PATTERN(a,b,c) \
   G(a,16) = pcre2_match_data_create_from_pattern_16(G(b,16),c)
@@ -1744,6 +1861,8 @@ the three different cases. */
 #define PCRE2_SET_COMPILE_RECURSION_GUARD(a,b,c) \
   pcre2_set_compile_recursion_guard_16(G(a,16),b,c)
 #define PCRE2_SET_MATCH_LIMIT(a,b) pcre2_set_match_limit_16(G(a,16),b)
+#define PCRE2_SET_MAX_PATTERN_LENGTH(a,b) pcre2_set_max_pattern_length_16(G(a,16),b)
+#define PCRE2_SET_OFFSET_LIMIT(a,b) pcre2_set_offset_limit_16(G(a,16),b)
 #define PCRE2_SET_PARENS_NEST_LIMIT(a,b) pcre2_set_parens_nest_limit_16(G(a,16),b)
 #define PCRE2_SET_RECURSION_LIMIT(a,b) pcre2_set_recursion_limit_16(G(a,16),b)
 #define PCRE2_SUBSTITUTE(a,b,c,d,e,f,g,h,i,j,k,l) \
@@ -1797,17 +1916,17 @@ the three different cases. */
    a = pcre2_callout_enumerate_32(compiled_code32, \
      (int (*)(struct pcre2_callout_enumerate_block_32 *, void *))b,c)
 #define PCRE2_COMPILE(a,b,c,d,e,f,g) \
-  G(a,32) = pcre2_compile_32(G(b,32),c,d,e,f,G(g,32))
+  G(a,32) = pcre2_compile_32(G(b,32),c,d,e,f,g)
 #define PCRE2_DFA_MATCH(a,b,c,d,e,f,g,h,i,j) \
-  a = pcre2_dfa_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),G(h,32),i,j)
+  a = pcre2_dfa_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),h,i,j)
 #define PCRE2_GET_ERROR_MESSAGE(r,a,b) \
   r = pcre2_get_error_message_32(a,G(b,32),G(G(b,32),_size))
 #define PCRE2_GET_OVECTOR_COUNT(a,b) a = pcre2_get_ovector_count_32(G(b,32))
 #define PCRE2_GET_STARTCHAR(a,b) a = pcre2_get_startchar_32(G(b,32))
-#define PCRE2_JIT_COMPILE(a,b) pcre2_jit_compile_32(G(a,32),b)
+#define PCRE2_JIT_COMPILE(r,a,b) r = pcre2_jit_compile_32(G(a,32),b)
 #define PCRE2_JIT_FREE_UNUSED_MEMORY(a) pcre2_jit_free_unused_memory_32(G(a,32))
 #define PCRE2_JIT_MATCH(a,b,c,d,e,f,g,h) \
-  a = pcre2_jit_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),G(h,32))
+  a = pcre2_jit_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),h)
 #define PCRE2_JIT_STACK_CREATE(a,b,c,d) \
   a = (PCRE2_JIT_STACK *)pcre2_jit_stack_create_32(b,c,d);
 #define PCRE2_JIT_STACK_ASSIGN(a,b,c) \
@@ -1815,7 +1934,7 @@ the three different cases. */
 #define PCRE2_JIT_STACK_FREE(a) pcre2_jit_stack_free_32((pcre2_jit_stack_32 *)a);
 #define PCRE2_MAKETABLES(a) a = pcre2_maketables_32(NULL)
 #define PCRE2_MATCH(a,b,c,d,e,f,g,h) \
-  a = pcre2_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),G(h,32))
+  a = pcre2_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),h)
 #define PCRE2_MATCH_DATA_CREATE(a,b,c) G(a,32) = pcre2_match_data_create_32(b,c)
 #define PCRE2_MATCH_DATA_CREATE_FROM_PATTERN(a,b,c) \
   G(a,32) = pcre2_match_data_create_from_pattern_32(G(b,32),c)
@@ -1835,6 +1954,8 @@ the three different cases. */
 #define PCRE2_SET_COMPILE_RECURSION_GUARD(a,b,c) \
   pcre2_set_compile_recursion_guard_32(G(a,32),b,c)
 #define PCRE2_SET_MATCH_LIMIT(a,b) pcre2_set_match_limit_32(G(a,32),b)
+#define PCRE2_SET_MAX_PATTERN_LENGTH(a,b) pcre2_set_max_pattern_length_32(G(a,32),b)
+#define PCRE2_SET_OFFSET_LIMIT(a,b) pcre2_set_offset_limit_32(G(a,32),b)
 #define PCRE2_SET_PARENS_NEST_LIMIT(a,b) pcre2_set_parens_nest_limit_32(G(a,32),b)
 #define PCRE2_SET_RECURSION_LIMIT(a,b) pcre2_set_recursion_limit_32(G(a,32),b)
 #define PCRE2_SUBSTITUTE(a,b,c,d,e,f,g,h,i,j,k,l) \
@@ -2424,13 +2545,14 @@ return (int)(pp - p);
 *************************************************/
 
 /* Must handle UTF-8 strings in utf8 mode. Yields number of characters printed.
-If handed a NULL file, just counts chars without printing. */
+For printing *MARK strings, a negative length is given. If handed a NULL file,
+just counts chars without printing. */
 
 static int pchars8(PCRE2_SPTR8 p, int length, BOOL utf, FILE *f)
 {
 uint32_t c = 0;
 int yield = 0;
-if (length < 0) length = strlen((char *)p);
+if (length < 0) length = p[-1];
 while (length-- > 0)
   {
   if (utf)
@@ -2458,12 +2580,13 @@ return yield;
 *************************************************/
 
 /* Must handle UTF-16 strings in utf mode. Yields number of characters printed.
-If handed a NULL file, just counts chars without printing. */
+For printing *MARK strings, a negative length is given. If handed a NULL file,
+just counts chars without printing. */
 
 static int pchars16(PCRE2_SPTR16 p, int length, BOOL utf, FILE *f)
 {
 int yield = 0;
-if (length < 0) length = strlen16(p);
+if (length < 0) length = p[-1];
 while (length-- > 0)
   {
   uint32_t c = *p++ & 0xffff;
@@ -2491,13 +2614,14 @@ return yield;
 *************************************************/
 
 /* Must handle UTF-32 strings in utf mode. Yields number of characters printed.
-If handed a NULL file, just counts chars without printing. */
+For printing *MARK strings, a negative length is given.If handed a NULL file,
+just counts chars without printing. */
 
 static int pchars32(PCRE2_SPTR32 p, int length, BOOL utf, FILE *f)
 {
 int yield = 0;
 (void)(utf);  /* Avoid compiler warning */
-if (length < 0) length = strlen32(p);
+if (length < 0) length = p[-1];
 while (length-- > 0)
   {
   uint32_t c = *p++;
@@ -2598,7 +2722,7 @@ if (pbuffer16_size < 2*len + 2)
 pp = pbuffer16;
 if (!utf)
   {
-  while (len-- > 0) *pp++ = *p++;
+  for (; len > 0; len--) *pp++ = *p++;
   }
 else while (len > 0)
   {
@@ -2675,7 +2799,7 @@ if (pbuffer32_size < 4*len + 4)
 pp = pbuffer32;
 if (!utf)
   {
-  while (len-- > 0) *pp++ = *p++;
+  for (; len > 0; len--) *pp++ = *p++;
   }
 else while (len > 0)
   {
@@ -2715,9 +2839,8 @@ Returns:   a possibly changed offset
 static PCRE2_SIZE
 backchars(uint8_t *subject, PCRE2_SIZE offset, uint32_t count, BOOL utf)
 {
-long int yield;
-
-if (!utf || test_mode == PCRE32_MODE) yield = offset - count;
+if (!utf || test_mode == PCRE32_MODE)
+  return (count >= offset)? 0 : (offset - count);
 
 else if (test_mode == PCRE8_MODE)
   {
@@ -2727,7 +2850,7 @@ else if (test_mode == PCRE8_MODE)
     pp--;
     while ((*pp & 0xc0) == 0x80) pp--;
     }
-  yield = pp - (PCRE2_SPTR8)subject;
+  return pp - (PCRE2_SPTR8)subject;
   }
 
 else  /* 16-bit mode */
@@ -2738,13 +2861,51 @@ else  /* 16-bit mode */
     pp--;
     if ((*pp & 0xfc00) == 0xdc00) pp--;
     }
-  yield = pp - (PCRE2_SPTR16)subject;
+  return pp - (PCRE2_SPTR16)subject;
+  }
+}
+
+
+
+/*************************************************
+*           Expand input buffers                 *
+*************************************************/
+
+/* This function doubles the size of the input buffer and the buffer for
+keeping an 8-bit copy of patterns (pbuffer8), and copies the current buffers to
+the new ones.
+
+Arguments: none
+Returns:   nothing (aborts if malloc() fails)
+*/
+
+static void
+expand_input_buffers(void)
+{
+int new_pbuffer8_size = 2*pbuffer8_size;
+uint8_t *new_buffer = (uint8_t *)malloc(new_pbuffer8_size);
+uint8_t *new_pbuffer8 = (uint8_t *)malloc(new_pbuffer8_size);
+
+if (new_buffer == NULL || new_pbuffer8 == NULL)
+  {
+  fprintf(stderr, "pcre2test: malloc(%d) failed\n", new_pbuffer8_size);
+  exit(1);
   }
 
-return (yield >= 0)? yield : 0;
+memcpy(new_buffer, buffer, pbuffer8_size);
+memcpy(new_pbuffer8, pbuffer8, pbuffer8_size);
+
+pbuffer8_size = new_pbuffer8_size;
+
+free(buffer);
+free(pbuffer8);
+
+buffer = new_buffer;
+pbuffer8 = new_pbuffer8;
 }
 
 
+
 /*************************************************
 *        Read or extend an input line            *
 *************************************************/
@@ -2817,29 +2978,11 @@ for (;;)
 
   else
     {
-    int new_pbuffer8_size = 2*pbuffer8_size;
-    uint8_t *new_buffer = (uint8_t *)malloc(new_pbuffer8_size);
-    uint8_t *new_pbuffer8 = (uint8_t *)malloc(new_pbuffer8_size);
-
-    if (new_buffer == NULL || new_pbuffer8 == NULL)
-      {
-      fprintf(stderr, "pcre2test: malloc(%d) failed\n", new_pbuffer8_size);
-      exit(1);
-      }
-
-    memcpy(new_buffer, buffer, pbuffer8_size);
-    memcpy(new_pbuffer8, pbuffer8, pbuffer8_size);
-
-    pbuffer8_size = new_pbuffer8_size;
-
-    start = new_buffer + (start - buffer);
-    here = new_buffer + (here - buffer);
-
-    free(buffer);
-    free(pbuffer8);
-
-    buffer = new_buffer;
-    pbuffer8 = new_pbuffer8;
+    size_t start_offset = start - buffer;
+    size_t here_offset = here - buffer;
+    expand_input_buffers();
+    start = buffer + start_offset;
+    here = buffer + here_offset;
     }
   }
 
@@ -2874,33 +3017,6 @@ return 0;
 
 
 
-/*************************************************
-*          Read number from string               *
-*************************************************/
-
-/* We don't use strtoul() because SunOS4 doesn't have it. Rather than mess
-around with conditional compilation, just do the job by hand. It is only used
-for unpicking arguments, so just keep it simple.
-
-Arguments:
-  str           string to be converted
-  endptr        where to put the end pointer
-
-Returns:        the unsigned long
-*/
-
-static int
-get_value(const char *str, const char **endptr)
-{
-int result = 0;
-while(*str != 0 && isspace(*str)) str++;
-while (isdigit(*str)) result = result * 10 + (int)(*str++ - '0');
-*endptr = str;
-return(result);
-}
-
-
-
 /*************************************************
 *          Scan the main modifier list           *
 *************************************************/
@@ -2928,7 +3044,7 @@ while (top > bot)
   if (c == 0)
     {
     if (len == mlen) return mid;
-    c = len - mlen;
+    c = (int)len - (int)mlen;
     }
   if (c > 0) bot = mid + 1; else top = mid;
   }
@@ -3050,6 +3166,8 @@ static BOOL
 decode_modifiers(uint8_t *p, int ctx, patctl *pctl, datctl *dctl)
 {
 uint8_t *ep, *pp;
+long li;
+unsigned long uli;
 BOOL first = TRUE;
 
 for (;;)
@@ -3066,9 +3184,14 @@ for (;;)
   while (isspace(*p) || *p == ',') p++;
   if (*p == 0) break;
 
-  /* Find the end of the item. */
+  /* Find the end of the item; lose trailing whitespace at end of line. */
 
-  for (ep = p; *ep != 0 && *ep != ',' && !isspace(*ep); ep++);
+  for (ep = p; *ep != 0 && *ep != ','; ep++);
+  if (*ep == 0)
+    {
+    while (ep > p && isspace(ep[-1])) ep--;
+    *ep = 0;
+    }
 
   /* Remember if the first character is '-'. */
 
@@ -3210,13 +3333,34 @@ for (;;)
 
     case MOD_IN2:    /* One or two unsigned integers */
     if (!isdigit(*pp)) goto INVALID_VALUE;
-    ((uint32_t *)field)[0] = (uint32_t)strtoul((const char *)pp, &endptr, 10);
+    uli = strtoul((const char *)pp, &endptr, 10);
+    if (U32OVERFLOW(uli)) goto INVALID_VALUE;
+    ((uint32_t *)field)[0] = (uint32_t)uli;
     if (*endptr == ':')
-      ((uint32_t *)field)[1] = (uint32_t)strtoul((const char *)endptr+1, &endptr, 10);
+      {
+      uli = strtoul((const char *)endptr+1, &endptr, 10);
+      if (U32OVERFLOW(uli)) goto INVALID_VALUE;
+      ((uint32_t *)field)[1] = (uint32_t)uli;
+      }
     else ((uint32_t *)field)[1] = 0;
     pp = (uint8_t *)endptr;
     break;
 
+    /* PCRE2_SIZE_MAX is usually SIZE_MAX, which may be greater, equal to, or
+    less than ULONG_MAX. So first test for overflowing the long int, and then
+    test for overflowing PCRE2_SIZE_MAX if it is smaller than ULONG_MAX. */
+
+    case MOD_SIZ:    /* PCRE2_SIZE value */
+    if (!isdigit(*pp)) goto INVALID_VALUE;
+    uli = strtoul((const char *)pp, &endptr, 10);
+    if (uli == ULONG_MAX) goto INVALID_VALUE;
+#if ULONG_MAX > PCRE2_SIZE_MAX
+    if (uli > PCRE2_SIZE_MAX) goto INVALID_VALUE;
+#endif
+    *((PCRE2_SIZE *)field) = (PCRE2_SIZE)uli;
+    pp = (uint8_t *)endptr;
+    break;
+
     case MOD_IND:    /* Unsigned integer with default */
     if (len == 0)
       {
@@ -3227,13 +3371,17 @@ for (;;)
 
     case MOD_INT:    /* Unsigned integer */
     if (!isdigit(*pp)) goto INVALID_VALUE;
-    *((uint32_t *)field) = (uint32_t)strtoul((const char *)pp, &endptr, 10);
+    uli = strtoul((const char *)pp, &endptr, 10);
+    if (U32OVERFLOW(uli)) goto INVALID_VALUE;
+    *((uint32_t *)field) = (uint32_t)uli;
     pp = (uint8_t *)endptr;
     break;
 
     case MOD_INS:   /* Signed integer */
     if (!isdigit(*pp) && *pp != '-') goto INVALID_VALUE;
-    *((int32_t *)field) = (int32_t)strtol((const char *)pp, &endptr, 10);
+    li = strtol((const char *)pp, &endptr, 10);
+    if (S32OVERFLOW(li)) goto INVALID_VALUE;
+    *((int32_t *)field) = (int32_t)li;
     pp = (uint8_t *)endptr;
     break;
 
@@ -3261,7 +3409,10 @@ for (;;)
     if (isdigit(*pp) || *pp == '-')
       {
       int ct = MAXCPYGET - 1;
-      int32_t value = (int32_t)strtol((const char *)pp, &endptr, 10);
+      int32_t value;
+      li = strtol((const char *)pp, &endptr, 10);
+      if (S32OVERFLOW(li)) goto INVALID_VALUE;
+      value = (int32_t)li;
       field = (char *)field - m->offset + m->value;      /* Adjust field ptr */
       if (value >= 0)                                    /* Add new number */
         {
@@ -3405,15 +3556,16 @@ words.
 
 Arguments:
   controls    control bits
+  controls2   more control bits
   before      text to print before
 
 Returns:      nothing
 */
 
 static void
-show_controls(uint32_t controls, const char *before)
+show_controls(uint32_t controls, uint32_t controls2, const char *before)
 {
-fprintf(outfile, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+fprintf(outfile, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
   before,
   ((controls & CTL_AFTERTEXT) != 0)? " aftertext" : "",
   ((controls & CTL_ALLAFTERTEXT) != 0)? " allaftertext" : "",
@@ -3421,10 +3573,12 @@ fprintf(outfile, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
   ((controls & CTL_ALLUSEDTEXT) != 0)? " allusedtext" : "",
   ((controls & CTL_ALTGLOBAL) != 0)? " altglobal" : "",
   ((controls & CTL_BINCODE) != 0)? " bincode" : "",
+  ((controls & CTL_BSR_SET) != 0)? " bsr" : "",
   ((controls & CTL_CALLOUT_CAPTURE) != 0)? " callout_capture" : "",
   ((controls & CTL_CALLOUT_INFO) != 0)? " callout_info" : "",
   ((controls & CTL_CALLOUT_NONE) != 0)? " callout_none" : "",
   ((controls & CTL_DFA) != 0)? " dfa" : "",
+  ((controls & CTL_EXPAND) != 0)? " expand" : "",
   ((controls & CTL_FINDLIMITS) != 0)? " find_limits" : "",
   ((controls & CTL_FULLBINCODE) != 0)? " fullbincode" : "",
   ((controls & CTL_GETALL) != 0)? " getall" : "",
@@ -3435,9 +3589,15 @@ fprintf(outfile, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
   ((controls & CTL_JITVERIFY) != 0)? " jitverify" : "",
   ((controls & CTL_MARK) != 0)? " mark" : "",
   ((controls & CTL_MEMORY) != 0)? " memory" : "",
+  ((controls & CTL_NL_SET) != 0)? " newline" : "",
+  ((controls & CTL_NULLCONTEXT) != 0)? " null_context" : "",
   ((controls & CTL_POSIX) != 0)? " posix" : "",
   ((controls & CTL_PUSH) != 0)? " push" : "",
   ((controls & CTL_STARTCHAR) != 0)? " startchar" : "",
+  ((controls2 & CTL2_SUBSTITUTE_EXTENDED) != 0)? " substitute_extended" : "",
+  ((controls2 & CTL2_SUBSTITUTE_OVERFLOW_LENGTH) != 0)? " substitute_overflow_length" : "",
+  ((controls2 & CTL2_SUBSTITUTE_UNKNOWN_UNSET) != 0)? " substitute_unknown_unset" : "",
+  ((controls2 & CTL2_SUBSTITUTE_UNSET_EMPTY) != 0)? " substitute_unset_empty" : "",
   ((controls & CTL_ZERO_TERMINATE) != 0)? " zero_terminate" : "");
 }
 
@@ -3461,10 +3621,11 @@ static void
 show_compile_options(uint32_t options, const char *before, const char *after)
 {
 if (options == 0) fprintf(outfile, "%s <none>%s", before, after);
-else fprintf(outfile, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+else fprintf(outfile, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
   before,
   ((options & PCRE2_ALT_BSUX) != 0)? " alt_bsux" : "",
   ((options & PCRE2_ALT_CIRCUMFLEX) != 0)? " alt_circumflex" : "",
+  ((options & PCRE2_ALT_VERBNAMES) != 0)? " alt_verbnames" : "",
   ((options & PCRE2_ALLOW_EMPTY_CLASS) != 0)? " allow_empty_class" : "",
   ((options & PCRE2_ANCHORED) != 0)? " anchored" : "",
   ((options & PCRE2_AUTO_CALLOUT) != 0)? " auto_callout" : "",
@@ -3486,6 +3647,7 @@ else fprintf(outfile, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
   ((options & PCRE2_NO_START_OPTIMIZE) != 0)? " no_start_optimize" : "",
   ((options & PCRE2_UCP) != 0)? " ucp" : "",
   ((options & PCRE2_UNGREEDY) != 0)? " ungreedy" : "",
+  ((options & PCRE2_USE_OFFSET_LIMIT) != 0)? " use_offset_limit" : "",
   ((options & PCRE2_UTF) != 0)? " utf" : "",
   after);
 }
@@ -3633,8 +3795,9 @@ if ((pat_patctl.control & CTL_INFO) != 0)
   const uint8_t *start_bits;
   BOOL match_limit_set, recursion_limit_set;
   uint32_t backrefmax, bsr_convention, capture_count, first_ctype, first_cunit,
-    hascrorlf, jchanged, last_ctype, last_cunit, match_empty, match_limit,
-    minlength, nameentrysize, namecount, newline_convention, recursion_limit;
+    hasbackslashc, hascrorlf, jchanged, last_ctype, last_cunit, match_empty,
+    match_limit, minlength, nameentrysize, namecount, newline_convention,
+    recursion_limit;
 
   /* These info requests may return PCRE2_ERROR_UNSET. */
 
@@ -3674,6 +3837,7 @@ if ((pat_patctl.control & CTL_INFO) != 0)
       pattern_info(PCRE2_INFO_FIRSTBITMAP, &start_bits, FALSE) +
       pattern_info(PCRE2_INFO_FIRSTCODEUNIT, &first_cunit, FALSE) +
       pattern_info(PCRE2_INFO_FIRSTCODETYPE, &first_ctype, FALSE) +
+      pattern_info(PCRE2_INFO_HASBACKSLASHC, &hasbackslashc, FALSE) +
       pattern_info(PCRE2_INFO_HASCRORLF, &hascrorlf, FALSE) +
       pattern_info(PCRE2_INFO_JCHANGED, &jchanged, FALSE) +
       pattern_info(PCRE2_INFO_LASTCODEUNIT, &last_cunit, FALSE) +
@@ -3704,7 +3868,7 @@ if ((pat_patctl.control & CTL_INFO) != 0)
   if (namecount > 0)
     {
     fprintf(outfile, "Named capturing subpatterns:\n");
-    while (namecount-- > 0)
+    for (; namecount > 0; namecount--)
       {
       int imm2_size = test_mode == PCRE8_MODE ? 2 : 1;
       uint32_t length = (uint32_t)STRLEN(nametable + imm2_size);
@@ -3728,8 +3892,9 @@ if ((pat_patctl.control & CTL_INFO) != 0)
       }
     }
 
-  if (hascrorlf)   fprintf(outfile, "Contains explicit CR or LF match\n");
-  if (match_empty) fprintf(outfile, "May match empty string\n");
+  if (hascrorlf)     fprintf(outfile, "Contains explicit CR or LF match\n");
+  if (hasbackslashc) fprintf(outfile, "Contains \\C\n");
+  if (match_empty)   fprintf(outfile, "May match empty string\n");
 
   pattern_info(PCRE2_INFO_ARGOPTIONS, &compile_options, FALSE);
   pattern_info(PCRE2_INFO_ALLOPTIONS, &overall_options, FALSE);
@@ -3767,8 +3932,7 @@ if ((pat_patctl.control & CTL_INFO) != 0)
     fprintf(outfile, "\\R matches %s\n", (bsr_convention == PCRE2_BSR_UNICODE)?
       "any Unicode newline" : "CR, LF, or CRLF");
 
-  if ((pat_patctl.control & CTL_NL_SET) != 0 ||
-      (FLD(compiled_code, flags) & PCRE2_NL_SET) != 0)
+  if ((FLD(compiled_code, flags) & PCRE2_NL_SET) != 0)
     {
     switch (newline_convention)
       {
@@ -3866,11 +4030,22 @@ if ((pat_patctl.control & CTL_INFO) != 0)
     if (FLD(compiled_code, executable_jit) != NULL)
       fprintf(outfile, "JIT compilation was successful\n");
     else
+      {
 #ifdef SUPPORT_JIT
-      fprintf(outfile, "JIT compilation was not successful\n");
+      int len;
+      fprintf(outfile, "JIT compilation was not successful");
+      if (jitrc != 0)
+        {
+        fprintf(outfile, " (");
+        PCRE2_GET_ERROR_MESSAGE(len, jitrc, pbuffer);
+        PCHARSV(CASTVAR(void *, pbuffer), 0, len, FALSE, outfile);
+        fprintf(outfile, ")");
+        }
+      fprintf(outfile, "\n");
 #else
       fprintf(outfile, "JIT support is not available in this version of PCRE2\n");
 #endif
+      }
     }
   }
 
@@ -3985,6 +4160,7 @@ FILE *f;
 PCRE2_SIZE serial_size;
 size_t i;
 int rc, cmd, cmdlen;
+uint16_t first_listed_newline;
 const char *cmdname;
 uint8_t *argptr, *serial;
 
@@ -4039,6 +4215,31 @@ switch(cmd)
   (void)decode_modifiers(argptr, CTX_DEFDAT, NULL, &def_datctl);
   break;
 
+  /* Check the default newline, and if not one of those listed, set up the
+  first one to be forced. An empty list unsets. */
+
+  case CMD_NEWLINE_DEFAULT:
+  local_newline_default = 0;   /* Unset */
+  first_listed_newline = 0;
+  for (;;)
+    {
+    while (isspace(*argptr)) argptr++;
+    if (*argptr == 0) break;
+    for (i = 1; i < sizeof(newlines)/sizeof(char *); i++)
+      {
+      size_t nlen = strlen(newlines[i]);
+      if (strncmpic(argptr, (const uint8_t *)newlines[i], nlen) == 0 &&
+          isspace(argptr[nlen]))
+        {
+        if (i == NEWLINE_DEFAULT) return PR_OK;  /* Default is valid */
+        if (first_listed_newline == 0) first_listed_newline = i;
+        }
+      }
+    while (*argptr != 0 && !isspace(*argptr)) argptr++;
+    }
+  local_newline_default = first_listed_newline;
+  break;
+
   /* Pop a compiled pattern off the stack. Modifiers that do not affect the
   compiled pattern (e.g. to give information) are permitted. The default
   pattern modifiers are ignored. */
@@ -4055,7 +4256,7 @@ switch(cmd)
   SET(compiled_code, patstack[--patstacknext]);
   if (pat_patctl.jit != 0)
     {
-    PCRE2_JIT_COMPILE(compiled_code, pat_patctl.jit);
+    PCRE2_JIT_COMPILE(jitrc, compiled_code, pat_patctl.jit);
     }
   if ((pat_patctl.control & CTL_MEMORY) != 0) show_memory_info();
   if ((pat_patctl.control & CTL_ANYINFO) != 0)
@@ -4178,10 +4379,12 @@ static int
 process_pattern(void)
 {
 BOOL utf;
+uint32_t k;
 uint8_t *p = buffer;
 const uint8_t *use_tables;
 unsigned int delimiter = *p++;
 int errorcode;
+void *use_pat_context;
 PCRE2_SIZE patlen;
 PCRE2_SIZE erroroffset;
 
@@ -4226,6 +4429,20 @@ patlen = p - buffer - 2;
 if (!decode_modifiers(p, CTX_PAT, &pat_patctl, NULL)) return PR_SKIP;
 utf = (pat_patctl.options & PCRE2_UTF) != 0;
 
+/* Check for mutually exclusive modifiers. At present, these are all in the
+first control word. */
+
+for (k = 0; k < sizeof(exclusive_pat_controls)/sizeof(uint32_t); k++)
+  {
+  uint32_t c = pat_patctl.control & exclusive_pat_controls[k];
+  if (c != 0 && c != (c & (~c+1)))
+    {
+    show_controls(c, 0, "** Not allowed together:");
+    fprintf(outfile, "\n");
+    return PR_SKIP;
+    }
+  }
+
 /* Assume full JIT compile for jitverify and/or jitfast if nothing else was
 specified. */
 
@@ -4233,28 +4450,16 @@ if (pat_patctl.jit == 0 &&
     (pat_patctl.control & (CTL_JITVERIFY|CTL_JITFAST)) != 0)
   pat_patctl.jit = 7;
 
-/* POSIX and 'push' do not play together. */
-
-if ((pat_patctl.control & (CTL_POSIX|CTL_PUSH)) == (CTL_POSIX|CTL_PUSH))
-  {
-  fprintf(outfile, "** The POSIX interface is incompatible with 'push'\n");
-  return PR_ABEND;
-  }
-
 /* Now copy the pattern to pbuffer8 for use in 8-bit testing and for reflecting
-in callouts. Convert to binary if required. */
+in callouts. Convert from hex if required; this must necessarily be fewer
+characters so will always fit in pbuffer8. Alternatively, process for
+repetition if requested. */
 
 if ((pat_patctl.control & CTL_HEXPAT) != 0)
   {
   uint8_t *pp, *pt;
   uint32_t c, d;
 
-  if ((pat_patctl.control & CTL_POSIX) != 0)
-    {
-    fprintf(outfile, "** Hex patterns are not supported for the POSIX API\n");
-    return PR_SKIP;
-    }
-
   pt = pbuffer8;
   for (pp = buffer + 1; *pp != 0; pp++)
     {
@@ -4277,6 +4482,80 @@ if ((pat_patctl.control & CTL_HEXPAT) != 0)
   *pt = 0;
   patlen = pt - pbuffer8;
   }
+
+else if ((pat_patctl.control & CTL_EXPAND) != 0)
+  {
+  uint8_t *pp, *pt;
+
+  pt = pbuffer8;
+  for (pp = buffer + 1; *pp != 0; pp++)
+    {
+    uint8_t *pc = pp;
+    uint32_t count = 1;
+    size_t length = 1;
+
+    /* Check for replication syntax; if not found, the defaults just set will
+    prevail and one character will be copied. */
+
+    if (pp[0] == '\\' && pp[1] == '[')
+      {
+      uint8_t *pe;
+      for (pe = pp + 2; *pe != 0; pe++)
+        {
+        if (pe[0] == ']' && pe[1] == '{')
+          {
+          uint32_t clen = pe - pc - 2;
+          uint32_t i = 0;
+          pe += 2;
+          while (isdigit(*pe)) i = i * 10 + *pe++ - '0';
+          if (*pe == '}')
+            {
+            if (i == 0)
+              {
+              fprintf(outfile, "** Zero repeat not allowed\n");
+              return PR_SKIP;
+              }
+            pc += 2;
+            count = i;
+            length = clen;
+            pp = pe;
+            break;
+            }
+          }
+        }
+      }
+
+    /* Add to output. If the buffer is too small expand it. The function for
+    expanding buffers always keeps buffer and pbuffer8 in step as far as their
+    size goes. */
+
+    while (pt + count * length > pbuffer8 + pbuffer8_size)
+      {
+      size_t pc_offset = pc - buffer;
+      size_t pp_offset = pp - buffer;
+      size_t pt_offset = pt - pbuffer8;
+      expand_input_buffers();
+      pc = buffer + pc_offset;
+      pp = buffer + pp_offset;
+      pt = pbuffer8 + pt_offset;
+      }
+
+    while (count-- > 0)
+      {
+      memcpy(pt, pc, length);
+      pt += length;
+      }
+    }
+
+  *pt = 0;
+  patlen = pt - pbuffer8;
+
+  if ((pat_patctl.control & CTL_INFO) != 0)
+    fprintf(outfile, "Expanded: %s\n", pbuffer8);
+  }
+
+/* Neither hex nor expanded, just copy the input verbatim. */
+
 else
   {
   strncpy((char *)pbuffer8, (char *)(buffer+1), patlen + 1);
@@ -4358,12 +4637,16 @@ if ((pat_patctl.control & CTL_POSIX) != 0)
       pat_patctl.options & ~POSIX_SUPPORTED_COMPILE_OPTIONS, msg, "");
     msg = "";
     }
-  if ((pat_patctl.control & ~POSIX_SUPPORTED_COMPILE_CONTROLS) != 0)
+  if ((pat_patctl.control & ~POSIX_SUPPORTED_COMPILE_CONTROLS) != 0 ||
+      (pat_patctl.control2 & ~POSIX_SUPPORTED_COMPILE_CONTROLS2) != 0)
     {
-    show_controls(pat_patctl.control & ~POSIX_SUPPORTED_COMPILE_CONTROLS, msg);
+    show_controls(pat_patctl.control & ~POSIX_SUPPORTED_COMPILE_CONTROLS,
+      pat_patctl.control2 & ~POSIX_SUPPORTED_COMPILE_CONTROLS2, msg);
     msg = "";
     }
 
+  if (local_newline_default != 0) prmsg(&msg, "#newline_default");
+
   if (msg[0] == 0) fprintf(outfile, "\n");
 
   /* Translate PCRE2 options to POSIX options and then compile. On success, set
@@ -4380,8 +4663,24 @@ if ((pat_patctl.control & CTL_POSIX) != 0)
   rc = regcomp(&preg, (char *)pbuffer8, cflags);
   if (rc != 0)   /* Failure */
     {
-    (void)regerror(rc, &preg, (char *)pbuffer8, pbuffer8_size);
+    size_t bsize, usize;
+
+    preg.re_pcre2_code = NULL;     /* In case something was left in there */
+    preg.re_match_data = NULL;
+
+    bsize = (pat_patctl.regerror_buffsize != 0)?
+      pat_patctl.regerror_buffsize : pbuffer8_size;
+    if (bsize + 8 < pbuffer8_size)
+      memcpy(pbuffer8 + bsize, "DEADBEEF", 8);
+    usize = regerror(rc, &preg, (char *)pbuffer8, bsize);
+
     fprintf(outfile, "Failed: POSIX code %d: %s\n", rc, pbuffer8);
+    if (usize > bsize)
+      {
+      fprintf(outfile, "** regerror() message truncated\n");
+      if (memcmp(pbuffer8 + bsize, "DEADBEEF", 8) != 0)
+        fprintf(outfile, "** regerror() buffer overflow\n");
+      }
     return PR_SKIP;
     }
   return PR_OK;
@@ -4398,15 +4697,19 @@ if ((pat_patctl.control & CTL_PUSH) != 0)
     fprintf(outfile, "** Replacement text is not supported with 'push'.\n");
     return PR_OK;
     }
-  if ((pat_patctl.control & ~PUSH_SUPPORTED_COMPILE_CONTROLS) != 0)
+  if ((pat_patctl.control & ~PUSH_SUPPORTED_COMPILE_CONTROLS) != 0 ||
+      (pat_patctl.control2 & ~PUSH_SUPPORTED_COMPILE_CONTROLS2) != 0)
     {
     show_controls(pat_patctl.control & ~PUSH_SUPPORTED_COMPILE_CONTROLS,
+                  pat_patctl.control2 & ~PUSH_SUPPORTED_COMPILE_CONTROLS2,
       "** Ignored when compiled pattern is stacked with 'push':");
     fprintf(outfile, "\n");
     }
-  if ((pat_patctl.control & PUSH_COMPILE_ONLY_CONTROLS) != 0)
+  if ((pat_patctl.control & PUSH_COMPILE_ONLY_CONTROLS) != 0 ||
+      (pat_patctl.control2 & PUSH_COMPILE_ONLY_CONTROLS2) != 0)
     {
     show_controls(pat_patctl.control & PUSH_COMPILE_ONLY_CONTROLS,
+                  pat_patctl.control2 & PUSH_COMPILE_ONLY_CONTROLS2,
       "** Applies only to compile when pattern is stacked with 'push':");
     fprintf(outfile, "\n");
     }
@@ -4453,6 +4756,21 @@ if we had a hex pattern. */
 
 if ((pat_patctl.control & CTL_HEXPAT) == 0) patlen = PCRE2_ZERO_TERMINATED;
 
+/* If #newline_default has been used and the library was not compiled with an
+appropriate default newline setting, local_newline_default will be non-zero. We
+use this if there is no explicit newline modifier. */
+
+if ((pat_patctl.control & CTL_NL_SET) == 0 && local_newline_default != 0)
+  {
+  SETFLD(pat_context, newline_convention, local_newline_default);
+  }
+
+/* The nullcontext modifier is used to test calling pcre2_compile() with a NULL
+context. */
+
+use_pat_context = ((pat_patctl.control & CTL_NULLCONTEXT) != 0)?
+  NULL : PTR(pat_context);
+
 /* Compile many times when timing. */
 
 if (timeit > 0)
@@ -4463,7 +4781,7 @@ if (timeit > 0)
     {
     clock_t start_time = clock();
     PCRE2_COMPILE(compiled_code, pbuffer, patlen,
-      pat_patctl.options|forbid_utf, &errorcode, &erroroffset, pat_context);
+      pat_patctl.options|forbid_utf, &errorcode, &erroroffset, use_pat_context);
     time_taken += clock() - start_time;
     if (TEST(compiled_code, !=, NULL))
       { SUB1(pcre2_code_free, compiled_code); }
@@ -4477,7 +4795,7 @@ if (timeit > 0)
 /* A final compile that is used "for real". */
 
 PCRE2_COMPILE(compiled_code, pbuffer, patlen, pat_patctl.options|forbid_utf,
-  &errorcode, &erroroffset, pat_context);
+  &errorcode, &erroroffset, use_pat_context);
 
 /* Compilation failed; go back for another re, skipping to blank line
 if non-interactive. */
@@ -4527,9 +4845,10 @@ if (pat_patctl.jit != 0)
       clock_t start_time;
       SUB1(pcre2_code_free, compiled_code);
       PCRE2_COMPILE(compiled_code, pbuffer, patlen,
-        pat_patctl.options|forbid_utf, &errorcode, &erroroffset, pat_context);
+        pat_patctl.options|forbid_utf, &errorcode, &erroroffset,
+        use_pat_context);
       start_time = clock();
-      PCRE2_JIT_COMPILE(compiled_code, pat_patctl.jit);
+      PCRE2_JIT_COMPILE(jitrc,compiled_code, pat_patctl.jit);
       time_taken += clock() - start_time;
       }
     total_jit_compile_time += time_taken;
@@ -4539,10 +4858,18 @@ if (pat_patctl.jit != 0)
     }
   else
     {
-    PCRE2_JIT_COMPILE(compiled_code, pat_patctl.jit);
+    PCRE2_JIT_COMPILE(jitrc, compiled_code, pat_patctl.jit);
     }
   }
 
+/* If an explicit newline modifier was given, set the information flag in the
+pattern so that it is preserved over push/pop. */
+
+if ((pat_patctl.control & CTL_NL_SET) != 0)
+  {
+  SETFLD(compiled_code, flags, FLD(compiled_code, flags) | PCRE2_NL_SET);
+  }
+
 /* Output code size and other information if requested. */
 
 if ((pat_patctl.control & CTL_MEMORY) != 0) show_memory_info();
@@ -4599,10 +4926,10 @@ for (;;)
 
   if ((pat_patctl.control & CTL_JITFAST) != 0)
     PCRE2_JIT_MATCH(capcount, compiled_code, pp, ulen, dat_datctl.offset,
-      dat_datctl.options, match_data, dat_context);
+      dat_datctl.options, match_data, PTR(dat_context));
   else
     PCRE2_MATCH(capcount, compiled_code, pp, ulen, dat_datctl.offset,
-      dat_datctl.options, match_data, dat_context);
+      dat_datctl.options, match_data, PTR(dat_context));
 
   if (capcount == errnumber)
     {
@@ -5025,10 +5352,11 @@ process_data(void)
 {
 PCRE2_SIZE len, ulen;
 uint32_t gmatched;
-uint32_t c;
+uint32_t c, k;
 uint32_t g_notempty = 0;
 uint8_t *p, *pp, *start_rep;
 size_t needlen;
+void *use_dat_context;
 BOOL utf;
 
 #ifdef SUPPORT_PCRE2_8
@@ -5050,6 +5378,7 @@ matching. */
 DATCTXCPY(dat_context, default_dat_context);
 memcpy(&dat_datctl, &def_datctl, sizeof(datctl));
 dat_datctl.control |= (pat_patctl.control & CTL_ALLPD);
+dat_datctl.control2 |= (pat_patctl.control2 & CTL2_ALLPD);
 strcpy((char *)dat_datctl.replacement, (char *)pat_patctl.replacement);
 
 /* Initialize for scanning the data line. */
@@ -5098,7 +5427,7 @@ if (dbuffer != NULL)
 the number of code units that will be needed (though the buffer may have to be
 extended if replication is involved). */
 
-needlen = (size_t)(len * code_unit_size);
+needlen = (size_t)((len+1) * code_unit_size);
 if (dbuffer == NULL || needlen >= dbuffer_size)
   {
   while (needlen >= dbuffer_size) dbuffer_size *= 2;
@@ -5367,38 +5696,44 @@ ulen = len/code_unit_size;                /* Length in code units */
 if (p[-1] != 0 && !decode_modifiers(p, CTX_DAT, NULL, &dat_datctl))
   return PR_OK;
 
-/* Check for mutually exclusive modifiers. */
+/* Check for mutually exclusive modifiers. At present, these are all in the
+first control word. */
 
-c = dat_datctl.control & EXCLUSIVE_DAT_CONTROLS;
-if (c - (c & -c) != 0)
+for (k = 0; k < sizeof(exclusive_dat_controls)/sizeof(uint32_t); k++)
   {
-  show_controls(c, "** Not allowed together:");
-  fprintf(outfile, "\n");
+  c = dat_datctl.control & exclusive_dat_controls[k];
+  if (c != 0 && c != (c & (~c+1)))
+    {
+    show_controls(c, 0, "** Not allowed together:");
+    fprintf(outfile, "\n");
+    return PR_OK;
+    }
+  }
+
+if (pat_patctl.replacement[0] != 0 &&
+    (dat_datctl.control & CTL_NULLCONTEXT) != 0)
+  {
+  fprintf(outfile, "** Replacement text is not supported with null_context.\n");
   return PR_OK;
   }
 
-/* If we have explicit valgrind support, mark the data from after its end to
-the end of the buffer as unaddressable, so that a read over the end of the
-buffer will be seen by valgrind, even if it doesn't cause a crash. If we're not
-building with valgrind support, at least move the data to the end of the buffer
-so that it might at least cause a crash. If we are using the POSIX interface,
-or testing zero-termination, we must include the terminating zero. */
+/* We now have the subject in dbuffer, with len containing the byte length, and
+ulen containing the code unit length. Move the data to the end of the buffer so
+that a read over the end can be caught by valgrind or other means. If we have
+explicit valgrind support, mark the unused start of the buffer unaddressable.
+If we are using the POSIX interface, or testing zero-termination, we must
+include the terminating zero in the usable data. */
 
-pp = dbuffer;
 c = code_unit_size * (((pat_patctl.control & CTL_POSIX) +
                        (dat_datctl.control & CTL_ZERO_TERMINATE) != 0)? 1:0);
-
+pp = memmove(dbuffer + dbuffer_size - len - c, dbuffer, len + c);
 #ifdef SUPPORT_VALGRIND
-  VALGRIND_MAKE_MEM_NOACCESS(dbuffer + len + c, dbuffer_size - (len + c));
-#else
-  pp = memmove(pp + dbuffer_size - len - c, pp, len + c);
+  VALGRIND_MAKE_MEM_NOACCESS(dbuffer, dbuffer_size - (len + c));
 #endif
 
-/* We now have len containing the byte length, ulen containing the code unit
-length, and pp pointing to the subject string. POSIX matching is only possible
-in 8-bit mode, and it does not support timing or other fancy features. Some
-were checked at compile time, but we need to check the match-time settings
-here. */
+/* Now pp points to the subject string. POSIX matching is only possible in
+8-bit mode, and it does not support timing or other fancy features. Some were
+checked at compile time, but we need to check the match-time settings here. */
 
 #ifdef SUPPORT_PCRE2_8
 if ((pat_patctl.control & CTL_POSIX) != 0)
@@ -5422,9 +5757,11 @@ if ((pat_patctl.control & CTL_POSIX) != 0)
     show_match_options(dat_datctl.options & ~POSIX_SUPPORTED_MATCH_OPTIONS);
     msg = "";
     }
-  if ((dat_datctl.control & ~POSIX_SUPPORTED_MATCH_CONTROLS) != 0)
+  if ((dat_datctl.control & ~POSIX_SUPPORTED_MATCH_CONTROLS) != 0 ||
+      (dat_datctl.control2 & ~POSIX_SUPPORTED_MATCH_CONTROLS2) != 0)
     {
-    show_controls(dat_datctl.control & ~POSIX_SUPPORTED_MATCH_CONTROLS, msg);
+    show_controls(dat_datctl.control & ~POSIX_SUPPORTED_MATCH_CONTROLS,
+                  dat_datctl.control2 & ~POSIX_SUPPORTED_MATCH_CONTROLS2, msg);
     msg = "";
     }
 
@@ -5455,14 +5792,14 @@ if ((pat_patctl.control & CTL_POSIX) != 0)
       if (pmatch[i].rm_so >= 0)
         {
         fprintf(outfile, "%2d: ", (int)i);
-        PCHARSV(dbuffer, pmatch[i].rm_so,
+        PCHARSV(pp, pmatch[i].rm_so,
           pmatch[i].rm_eo - pmatch[i].rm_so, utf, outfile);
         fprintf(outfile, "\n");
         if ((i == 0 && (dat_datctl.control & CTL_AFTERTEXT) != 0) ||
             (dat_datctl.control & CTL_ALLAFTERTEXT) != 0)
           {
           fprintf(outfile, "%2d+ ", (int)i);
-          PCHARSV(dbuffer, pmatch[i].rm_eo, len - pmatch[i].rm_eo,
+          PCHARSV(pp, pmatch[i].rm_eo, len - pmatch[i].rm_eo,
             utf, outfile);
           fprintf(outfile, "\n");
           }
@@ -5498,6 +5835,12 @@ if ((dat_datctl.control & (CTL_ALLUSEDTEXT|CTL_DFA)) == CTL_ALLUSEDTEXT &&
 if ((dat_datctl.control & CTL_ZERO_TERMINATE) != 0)
   ulen = PCRE2_ZERO_TERMINATED;
 
+/* The nullcontext modifier is used to test calling pcre2_[jit_]match() with a
+NULL context. */
+
+use_dat_context = ((dat_datctl.control & CTL_NULLCONTEXT) != 0)?
+  NULL : PTR(dat_context);
+
 /* Enable display of malloc/free if wanted. */
 
 show_memory = (dat_datctl.control & CTL_MEMORY) != 0;
@@ -5571,7 +5914,7 @@ if (dat_datctl.replacement[0] != 0)
   uint8_t *pr;
   uint8_t rbuffer[REPLACE_BUFFSIZE];
   uint8_t nbuffer[REPLACE_BUFFSIZE];
-  uint32_t goption;
+  uint32_t xoptions;
   PCRE2_SIZE rlen, nsize, erroroffset;
   BOOL badutf = FALSE;
 
@@ -5588,8 +5931,17 @@ if (dat_datctl.replacement[0] != 0)
   if (timeitm)
     fprintf(outfile, "** Timing is not supported with replace: ignored\n");
 
-  goption = ((dat_datctl.control & CTL_GLOBAL) == 0)? 0 :
-    PCRE2_SUBSTITUTE_GLOBAL;
+  xoptions = (((dat_datctl.control & CTL_GLOBAL) == 0)? 0 :
+                PCRE2_SUBSTITUTE_GLOBAL) |
+             (((dat_datctl.control2 & CTL2_SUBSTITUTE_EXTENDED) == 0)? 0 :
+                PCRE2_SUBSTITUTE_EXTENDED) |
+             (((dat_datctl.control2 & CTL2_SUBSTITUTE_OVERFLOW_LENGTH) == 0)? 0 :
+                PCRE2_SUBSTITUTE_OVERFLOW_LENGTH) |
+             (((dat_datctl.control2 & CTL2_SUBSTITUTE_UNKNOWN_UNSET) == 0)? 0 :
+                PCRE2_SUBSTITUTE_UNKNOWN_UNSET) |
+             (((dat_datctl.control2 & CTL2_SUBSTITUTE_UNSET_EMPTY) == 0)? 0 :
+                PCRE2_SUBSTITUTE_UNSET_EMPTY);
+
   SETCASTPTR(r, rbuffer);  /* Sets r8, r16, or r32, as appropriate. */
   pr = dat_datctl.replacement;
 
@@ -5676,14 +6028,21 @@ if (dat_datctl.replacement[0] != 0)
   else
     rlen = (CASTVAR(uint8_t *, r) - rbuffer)/code_unit_size;
   PCRE2_SUBSTITUTE(rc, compiled_code, pp, ulen, dat_datctl.offset,
-    dat_datctl.options|goption, match_data, dat_context,
+    dat_datctl.options|xoptions, match_data, dat_context,
     rbuffer, rlen, nbuffer, &nsize);
 
   if (rc < 0)
     {
-    fprintf(outfile, "Failed: error %d: ", rc);
-    PCRE2_GET_ERROR_MESSAGE(nsize, rc, pbuffer);
-    PCHARSV(CASTVAR(void *, pbuffer), 0, nsize, FALSE, outfile);
+    PCRE2_SIZE msize;
+    fprintf(outfile, "Failed: error %d", rc);
+    if (rc != PCRE2_ERROR_NOMEMORY && nsize != PCRE2_UNSET)
+      fprintf(outfile, " at offset %ld in replacement", (long int)nsize);
+    fprintf(outfile, ": ");
+    PCRE2_GET_ERROR_MESSAGE(msize, rc, pbuffer);
+    PCHARSV(CASTVAR(void *, pbuffer), 0, msize, FALSE, outfile);
+    if (rc == PCRE2_ERROR_NOMEMORY &&
+        (xoptions & PCRE2_SUBSTITUTE_OVERFLOW_LENGTH) != 0)
+      fprintf(outfile, ": %ld code units are needed", (long int)nsize);
     }
   else
     {
@@ -5752,7 +6111,7 @@ else for (gmatched = 0;; gmatched++)
         {
         PCRE2_DFA_MATCH(capcount, compiled_code, pp, ulen,
           dat_datctl.offset, dat_datctl.options | g_notempty, match_data,
-          dat_context, dfa_workspace, DFA_WS_DIMENSION);
+          use_dat_context, dfa_workspace, DFA_WS_DIMENSION);
         }
       }
 
@@ -5763,7 +6122,7 @@ else for (gmatched = 0;; gmatched++)
         {
         PCRE2_JIT_MATCH(capcount, compiled_code, pp, ulen,
           dat_datctl.offset, dat_datctl.options | g_notempty, match_data,
-          dat_context);
+          use_dat_context);
         }
       }
 
@@ -5774,7 +6133,7 @@ else for (gmatched = 0;; gmatched++)
         {
         PCRE2_MATCH(capcount, compiled_code, pp, ulen,
           dat_datctl.offset, dat_datctl.options | g_notempty, match_data,
-          dat_context);
+          use_dat_context);
         }
       }
     total_match_time += (time_taken = clock() - start_time);
@@ -5822,7 +6181,7 @@ else for (gmatched = 0;; gmatched++)
         dfa_workspace[0] = -1;  /* To catch bad restart */
       PCRE2_DFA_MATCH(capcount, compiled_code, pp, ulen,
         dat_datctl.offset, dat_datctl.options | g_notempty, match_data,
-        dat_context, dfa_workspace, DFA_WS_DIMENSION);
+        use_dat_context, dfa_workspace, DFA_WS_DIMENSION);
       if (capcount == 0)
         {
         fprintf(outfile, "Matched, but offsets vector is too small to show all matches\n");
@@ -5833,10 +6192,10 @@ else for (gmatched = 0;; gmatched++)
       {
       if ((pat_patctl.control & CTL_JITFAST) != 0)
         PCRE2_JIT_MATCH(capcount, compiled_code, pp, ulen, dat_datctl.offset,
-          dat_datctl.options | g_notempty, match_data, dat_context);
+          dat_datctl.options | g_notempty, match_data, use_dat_context);
       else
         PCRE2_MATCH(capcount, compiled_code, pp, ulen, dat_datctl.offset,
-          dat_datctl.options | g_notempty, match_data, dat_context);
+          dat_datctl.options | g_notempty, match_data, use_dat_context);
       if (capcount == 0)
         {
         fprintf(outfile, "Matched, but too many substrings\n");
@@ -6046,7 +6405,8 @@ else for (gmatched = 0;; gmatched++)
          TESTFLD(match_data, mark, !=, NULL))
       {
       fprintf(outfile, ", mark=");
-      PCHARS(rubriclength, CASTFLD(void *, match_data, mark), 0, -1, utf, outfile);
+      PCHARS(rubriclength, CASTFLD(void *, match_data, mark), 0, -1, utf,
+        outfile);
       rubriclength += 7;
       }
     fprintf(outfile, ": ");
@@ -6344,6 +6704,7 @@ printf("  -b            set default pattern control 'fullbincode'\n");
 printf("  -C            show PCRE2 compile-time options and exit\n");
 printf("  -C arg        show a specific compile-time option and exit with its\n");
 printf("                  value if numeric (else 0). The arg can be:\n");
+printf("     backslash-C    use of \\C is enabled [0, 1]\n");
 printf("     bsr            \\R type [ANYCRLF, ANY]\n");
 printf("     ebcdic         compiled for EBCDIC character code [0,1]\n");
 printf("     ebcdic-nl      NL code if compiled for EBCDIC\n");
@@ -6454,6 +6815,9 @@ printf("Compiled with\n");
 
 #ifdef EBCDIC
 printf("  EBCDIC code support: LF is 0x%02x\n", CHAR_LF);
+#if defined NATIVE_ZOS
+printf("  EBCDIC code page %s or similar\n", pcrz_cpversion());
+#endif
 #endif
 
 #ifdef SUPPORT_PCRE2_8
@@ -6492,6 +6856,11 @@ print_newline_config(optval, FALSE);
 (void)PCRE2_CONFIG(PCRE2_CONFIG_BSR, &optval);
 printf("  \\R matches %s\n", optval? "CR, LF, or CRLF only" :
                                  "all Unicode newlines");
+#ifdef NEVER_BACKSLASH_C
+printf("  \\C is not supported\n");
+#else
+printf("  \\C is supported\n");
+#endif
 (void)PCRE2_CONFIG(PCRE2_CONFIG_LINKSIZE, &optval);
 printf("  Internal link size = %d\n", optval);
 (void)PCRE2_CONFIG(PCRE2_CONFIG_PARENSLIMIT, &optval);
@@ -6532,7 +6901,8 @@ control blocks must be the same so that common options and controls such as
 We cannot test this till runtime because "offsetof" does not work in the
 preprocessor. */
 
-if (PO(options) != DO(options) || PO(control) != DO(control))
+if (PO(options) != DO(options) || PO(control) != DO(control) ||
+    PO(control2) != DO(control2))
   {
   fprintf(stderr, "** Coding error: "
     "options and control offsets for pattern and data must be the same.\n");
@@ -6589,8 +6959,9 @@ def_datctl.cfail[0] = def_datctl.cfail[1] = CFAIL_UNSET;
 
 while (argc > 1 && argv[op][0] == '-' && argv[op][1] != 0)
   {
-  const char *endptr;
+  char *endptr;
   char *arg = argv[op];
+  unsigned long uli;
 
   /* Display and/or set return code for configuration options. */
 
@@ -6640,7 +7011,7 @@ while (argc > 1 && argv[op][0] == '-' && argv[op][1] != 0)
   /* Set system stack size */
 
   else if (strcmp(arg, "-S") == 0 && argc > 2 &&
-      ((stack_size = get_value(argv[op+1], &endptr)), *endptr == 0))
+      ((uli = strtoul(argv[op+1], &endptr, 10)), *endptr == 0))
     {
 #if defined(_WIN32) || defined(WIN32) || defined(__minix) || defined(NATIVE_ZOS) || defined(__VMS)
     fprintf(stderr, "pcre2test: -S is not supported on this OS\n");
@@ -6648,6 +7019,12 @@ while (argc > 1 && argv[op][0] == '-' && argv[op][1] != 0)
 #else
     int rc;
     struct rlimit rlim;
+    if (U32OVERFLOW(uli))
+      {
+      fprintf(stderr, "+++ Argument for -S is too big\n");
+      exit(1);
+      }
+    stack_size = (uint32_t)uli;
     getrlimit(RLIMIT_STACK, &rlim);
     rlim.rlim_cur = stack_size * 1024 * 1024;
     if (rlim.rlim_cur > rlim.rlim_max)
@@ -6690,12 +7067,16 @@ while (argc > 1 && argv[op][0] == '-' && argv[op][1] != 0)
   else if (strcmp(arg, "-t") == 0 || strcmp(arg, "-tm") == 0 ||
            strcmp(arg, "-T") == 0 || strcmp(arg, "-TM") == 0)
     {
-    int temp;
     int both = arg[2] == 0;
     showtotaltimes = arg[1] == 'T';
-    if (argc > 2 && (temp = get_value(argv[op+1], &endptr), *endptr == 0))
+    if (argc > 2 && (uli = strtoul(argv[op+1], &endptr, 10), *endptr == 0))
       {
-      timeitm = temp;
+      if (U32OVERFLOW(uli))
+        {
+        fprintf(stderr, "+++ Argument for %s is too big\n", arg);
+        exit(1);
+        }
+      timeitm = (int)uli;
       op++;
       argc--;
       }
@@ -6915,7 +7296,8 @@ while (notdone)
       skipping = FALSE;
       setlocale(LC_CTYPE, "C");
       }
-    else if (!skipping) rc = process_data();
+    else if (!skipping && !(p[0] == '\\' && p[1] == '=' && isspace(p[2])))
+      rc = process_data();
     }
 
   /* We do not have a pattern set up for testing. Lines starting with # are
index 8a4b9664f8e12e109b3c1cca0a7e5883e4892bbc..16e3547c938f046455116a469d6ab7a6fcfb80c1 100644 (file)
@@ -613,6 +613,12 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void);
 #define SLJIT_LOCALS_OFFSET_BASE ((23 + 1) * sizeof(sljit_sw))
 #endif
 
+#elif (defined SLJIT_CONFIG_TILEGX && SLJIT_CONFIG_TILEGX)
+
+#define SLJIT_NUMBER_OF_REGISTERS 10
+#define SLJIT_NUMBER_OF_SAVED_REGISTERS 5
+#define SLJIT_LOCALS_OFFSET_BASE 0
+
 #elif (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED)
 
 #define SLJIT_NUMBER_OF_REGISTERS 0
index f0969dac2e4dc8b419cfc4720f01e462d2aef6c0..2e2e9ac09cd660883f7c362b2260c7730a6060ca 100644 (file)
@@ -869,34 +869,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op2(struct sljit_compiler *compiler
        sljit_si src1, sljit_sw src1w,
        sljit_si src2, sljit_sw src2w);
 
-/* The following function is a helper function for sljit_emit_op_custom.
-   It returns with the real machine register index ( >=0 ) of any SLJIT_R,
-   SLJIT_S and SLJIT_SP registers.
-
-   Note: it returns with -1 for virtual registers (only on x86-32). */
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_register_index(sljit_si reg);
-
-/* The following function is a helper function for sljit_emit_op_custom.
-   It returns with the real machine register index of any SLJIT_FLOAT register.
-
-   Note: the index is always an even number on ARM (except ARM-64), MIPS, and SPARC. */
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg);
-
-/* Any instruction can be inserted into the instruction stream by
-   sljit_emit_op_custom. It has a similar purpose as inline assembly.
-   The size parameter must match to the instruction size of the target
-   architecture:
-
-         x86: 0 < size <= 15. The instruction argument can be byte aligned.
-      Thumb2: if size == 2, the instruction argument must be 2 byte aligned.
-              if size == 4, the instruction argument must be 4 byte aligned.
-   Otherwise: size must be 4 and instruction argument must be 4 byte aligned. */
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
-       void *instruction, sljit_si size);
-
 /* Returns with non-zero if fpu is available. */
 
 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_is_fpu_available(void);
@@ -1214,4 +1186,64 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_function_context(void** func_ptr, struct
 
 #endif /* !(defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL) */
 
+/* --------------------------------------------------------------------- */
+/*  CPU specific functions                                               */
+/* --------------------------------------------------------------------- */
+
+/* The following function is a helper function for sljit_emit_op_custom.
+   It returns with the real machine register index ( >=0 ) of any SLJIT_R,
+   SLJIT_S and SLJIT_SP registers.
+
+   Note: it returns with -1 for virtual registers (only on x86-32). */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_register_index(sljit_si reg);
+
+/* The following function is a helper function for sljit_emit_op_custom.
+   It returns with the real machine register index of any SLJIT_FLOAT register.
+
+   Note: the index is always an even number on ARM (except ARM-64), MIPS, and SPARC. */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg);
+
+/* Any instruction can be inserted into the instruction stream by
+   sljit_emit_op_custom. It has a similar purpose as inline assembly.
+   The size parameter must match to the instruction size of the target
+   architecture:
+
+         x86: 0 < size <= 15. The instruction argument can be byte aligned.
+      Thumb2: if size == 2, the instruction argument must be 2 byte aligned.
+              if size == 4, the instruction argument must be 4 byte aligned.
+   Otherwise: size must be 4 and instruction argument must be 4 byte aligned. */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
+       void *instruction, sljit_si size);
+
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
+
+/* Returns with non-zero if sse2 is available. */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_is_sse2_available(void);
+
+/* Returns with non-zero if cmov instruction is available. */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_is_cmov_available(void);
+
+/* Emit a conditional mov instruction on x86 CPUs. This instruction
+   moves src to destination, if the condition is satisfied. Unlike
+   other arithmetic instructions, destination must be a register.
+   Before such instructions are emitted, cmov support should be
+   checked by sljit_x86_is_cmov_available function.
+    type must be between SLJIT_EQUAL and SLJIT_S_ORDERED
+    dst_reg must be a valid register and it can be combined
+      with SLJIT_INT_OP to perform 32 bit arithmetic
+   Flags: I - (never set any flags)
+ */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_emit_cmov(struct sljit_compiler *compiler,
+       sljit_si type,
+       sljit_si dst_reg,
+       sljit_si src, sljit_sw srcw);
+
+#endif
+
 #endif /* _SLJIT_LIR_H_ */
index 1d6aa5a110fc63e1ae8aa971978d487cda133bac..4d40392fa82f005eed63ba3fb3fb5e73bb3484e3 100644 (file)
 #define SIMM_16BIT_MIN (-0x8000)
 #define SIMM_17BIT_MAX (0xffff)
 #define SIMM_17BIT_MIN (-0x10000)
-#define SIMM_32BIT_MIN (-0x80000000)
 #define SIMM_32BIT_MAX (0x7fffffff)
-#define SIMM_48BIT_MIN (0x800000000000L)
+#define SIMM_32BIT_MIN (-0x7fffffff - 1)
 #define SIMM_48BIT_MAX (0x7fffffff0000L)
+#define SIMM_48BIT_MIN (-0x800000000000L)
 #define IMM16(imm) ((imm) & 0xffff)
 
 #define UIMM_16BIT_MAX (0xffff)
 
-#define TMP_REG1 (SLJIT_NO_REGISTERS + 1)
-#define TMP_REG2 (SLJIT_NO_REGISTERS + 2)
-#define TMP_REG3 (SLJIT_NO_REGISTERS + 3)
-#define ADDR_TMP (SLJIT_NO_REGISTERS + 4)
+#define TMP_REG1 (SLJIT_NUMBER_OF_REGISTERS + 2)
+#define TMP_REG2 (SLJIT_NUMBER_OF_REGISTERS + 3)
+#define TMP_REG3 (SLJIT_NUMBER_OF_REGISTERS + 4)
+#define ADDR_TMP (SLJIT_NUMBER_OF_REGISTERS + 5)
 #define PIC_ADDR_REG TMP_REG2
 
-static SLJIT_CONST sljit_ub reg_map[SLJIT_NO_REGISTERS + 5] = {
+static SLJIT_CONST sljit_ub reg_map[SLJIT_NUMBER_OF_REGISTERS + 6] = {
        63, 0, 1, 2, 3, 4, 30, 31, 32, 33, 34, 54, 5, 16, 6, 7
 };
 
@@ -58,11 +58,6 @@ static SLJIT_CONST sljit_ub reg_map[SLJIT_NO_REGISTERS + 5] = {
 #define TMP_REG2_mapped 16
 #define TMP_REG3_mapped 6
 #define ADDR_TMP_mapped 7
-#define SLJIT_SAVED_REG1_mapped 30
-#define SLJIT_SAVED_REG2_mapped 31
-#define SLJIT_SAVED_REG3_mapped 32
-#define SLJIT_SAVED_EREG1_mapped 33
-#define SLJIT_SAVED_EREG2_mapped 34
 
 /* Flags are keept in volatile registers. */
 #define EQUAL_FLAG 8
@@ -399,6 +394,9 @@ static sljit_si push_inst(struct sljit_compiler *compiler, sljit_ins ins)
 #define SUB(dst, srca, srcb) \
        push_3_buffer(compiler, TILEGX_OPC_SUB, dst, srca, srcb, __LINE__)
 
+#define MUL(dst, srca, srcb) \
+       push_3_buffer(compiler, TILEGX_OPC_MULX, dst, srca, srcb, __LINE__)
+
 #define NOR(dst, srca, srcb) \
        push_3_buffer(compiler, TILEGX_OPC_NOR, dst, srca, srcb, __LINE__)
 
@@ -547,8 +545,8 @@ const struct Format* compute_format()
 
        const struct Format* match = NULL;
        const struct Format *b = NULL;
-       unsigned int i = 0;
-       for (i; i < sizeof formats / sizeof formats[0]; i++) {
+       unsigned int i;
+       for (i = 0; i < sizeof formats / sizeof formats[0]; i++) {
                b = &formats[i];
                if ((b->pipe_mask & compatible_pipes) == b->pipe_mask) {
                        match = b;
@@ -625,7 +623,6 @@ tilegx_bundle_bits get_bundle_bit(struct jit_instr *inst)
 
 static sljit_si update_buffer(struct sljit_compiler *compiler)
 {
-       int count;
        int i;
        int orig_index = inst_buf_index;
        struct jit_instr inst0 = inst_buf[0];
@@ -738,8 +735,10 @@ static sljit_si update_buffer(struct sljit_compiler *compiler)
 
 static sljit_si flush_buffer(struct sljit_compiler *compiler)
 {
-       while (inst_buf_index != 0)
-               update_buffer(compiler);
+       while (inst_buf_index != 0) {
+               FAIL_IF(update_buffer(compiler));
+       }
+       return SLJIT_SUCCESS;
 }
 
 static sljit_si push_4_buffer(struct sljit_compiler *compiler, tilegx_mnemonic opc, int op0, int op1, int op2, int op3, int line)
@@ -787,6 +786,7 @@ static sljit_si push_3_buffer(struct sljit_compiler *compiler, tilegx_mnemonic o
        case TILEGX_OPC_ADD:
        case TILEGX_OPC_AND:
        case TILEGX_OPC_SUB:
+       case TILEGX_OPC_MULX:
        case TILEGX_OPC_OR:
        case TILEGX_OPC_XOR:
        case TILEGX_OPC_NOR:
@@ -905,7 +905,6 @@ static SLJIT_INLINE sljit_ins * detect_jump_type(struct sljit_jump *jump, sljit_
        sljit_sw diff;
        sljit_uw target_addr;
        sljit_ins *inst;
-       sljit_ins saved_inst;
 
        if (jump->flags & SLJIT_REWRITABLE_JUMP)
                return code_ptr;
@@ -1009,7 +1008,7 @@ SLJIT_API_FUNC_ATTRIBUTE void * sljit_generate_code(struct sljit_compiler *compi
        struct sljit_const *const_;
 
        CHECK_ERROR_PTR();
-       check_sljit_generate_code(compiler);
+       CHECK_PTR(check_sljit_generate_code(compiler));
        reverse_buf(compiler);
 
        code = (sljit_ins *)SLJIT_MALLOC_EXEC(compiler->size * sizeof(sljit_ins));
@@ -1178,13 +1177,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_enter(struct sljit_compiler *compil
        sljit_si fscratches, sljit_si fsaveds, sljit_si local_size)
 {
        sljit_ins base;
-       sljit_ins bundle = 0;
-
+       sljit_si i, tmp;
        CHECK_ERROR();
-       check_sljit_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
+       CHECK(check_sljit_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
        set_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
 
-       local_size += (saveds + 1) * sizeof(sljit_sw);
+       local_size += GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);
        local_size = (local_size + 7) & ~7;
        compiler->local_size = local_size;
 
@@ -1200,56 +1199,52 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_enter(struct sljit_compiler *compil
                local_size = 0;
        }
 
+       /* Save the return address. */
        FAIL_IF(ADDLI(ADDR_TMP_mapped, base, local_size - 8));
        FAIL_IF(ST_ADD(ADDR_TMP_mapped, RA, -8));
 
-       if (saveds >= 1)
-               FAIL_IF(ST_ADD(ADDR_TMP_mapped, SLJIT_SAVED_REG1_mapped, -8));
-
-       if (saveds >= 2)
-               FAIL_IF(ST_ADD(ADDR_TMP_mapped, SLJIT_SAVED_REG2_mapped, -8));
-
-       if (saveds >= 3)
-               FAIL_IF(ST_ADD(ADDR_TMP_mapped, SLJIT_SAVED_REG3_mapped, -8));
-
-       if (saveds >= 4)
-               FAIL_IF(ST_ADD(ADDR_TMP_mapped, SLJIT_SAVED_EREG1_mapped, -8));
-
-       if (saveds >= 5)
-               FAIL_IF(ST_ADD(ADDR_TMP_mapped, SLJIT_SAVED_EREG2_mapped, -8));
-
-       if (args >= 1)
-               FAIL_IF(ADD(SLJIT_SAVED_REG1_mapped, 0, ZERO));
+       /* Save the S registers. */
+       tmp = saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - saveds) : SLJIT_FIRST_SAVED_REG;
+       for (i = SLJIT_S0; i >= tmp; i--) {
+               FAIL_IF(ST_ADD(ADDR_TMP_mapped, reg_map[i], -8));
+       }
 
-       if (args >= 2)
-               FAIL_IF(ADD(SLJIT_SAVED_REG2_mapped, 1, ZERO));
+       /* Save the R registers that need to be reserved. */
+       for (i = scratches; i >= SLJIT_FIRST_SAVED_REG; i--) {
+               FAIL_IF(ST_ADD(ADDR_TMP_mapped, reg_map[i], -8));
+       }
 
-       if (args >= 3)
-               FAIL_IF(ADD(SLJIT_SAVED_REG3_mapped, 2, ZERO));
+       /* Move the arguments to S registers. */
+       for (i = 0; i < args; i++) {
+               FAIL_IF(ADD(reg_map[SLJIT_S0 - i], i, ZERO));
+       }
 
        return SLJIT_SUCCESS;
 }
 
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_context(struct sljit_compiler *compiler,
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_set_context(struct sljit_compiler *compiler,
        sljit_si options, sljit_si args, sljit_si scratches, sljit_si saveds,
        sljit_si fscratches, sljit_si fsaveds, sljit_si local_size)
 {
-       CHECK_ERROR_VOID();
-       check_sljit_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
+       CHECK_ERROR();
+       CHECK(check_sljit_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
        set_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
 
-       local_size += (saveds + 1) * sizeof(sljit_sw);
+       local_size += GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);
        compiler->local_size = (local_size + 7) & ~7;
+
+       return SLJIT_SUCCESS;
 }
 
 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_return(struct sljit_compiler *compiler, sljit_si op, sljit_si src, sljit_sw srcw)
 {
        sljit_si local_size;
        sljit_ins base;
-       int addr_initialized = 0;
+       sljit_si i, tmp;
+       sljit_si saveds;
 
        CHECK_ERROR();
-       check_sljit_emit_return(compiler, op, src, srcw);
+       CHECK(check_sljit_emit_return(compiler, op, src, srcw));
 
        FAIL_IF(emit_mov_before_return(compiler, op, src, srcw));
 
@@ -1263,50 +1258,20 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_return(struct sljit_compiler *compi
                local_size = 0;
        }
 
+       /* Restore the return address. */
        FAIL_IF(ADDLI(ADDR_TMP_mapped, base, local_size - 8));
-       FAIL_IF(LD(RA, ADDR_TMP_mapped));
-
-       if (compiler->saveds >= 5) {
-               FAIL_IF(ADDLI(ADDR_TMP_mapped, base, local_size - 48));
-               addr_initialized = 1;
+       FAIL_IF(LD_ADD(RA, ADDR_TMP_mapped, -8));
 
-               FAIL_IF(LD_ADD(SLJIT_SAVED_EREG2_mapped, ADDR_TMP_mapped, 8));
+       /* Restore the S registers. */
+       saveds = compiler->saveds;
+       tmp = saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - saveds) : SLJIT_FIRST_SAVED_REG;
+       for (i = SLJIT_S0; i >= tmp; i--) {
+               FAIL_IF(LD_ADD(reg_map[i], ADDR_TMP_mapped, -8));
        }
 
-       if (compiler->saveds >= 4) {
-               if (addr_initialized == 0) {
-                       FAIL_IF(ADDLI(ADDR_TMP_mapped, base, local_size - 40));
-                       addr_initialized = 1;
-               }
-
-               FAIL_IF(LD_ADD(SLJIT_SAVED_EREG1_mapped, ADDR_TMP_mapped, 8));
-       }
-
-       if (compiler->saveds >= 3) {
-               if (addr_initialized == 0) {
-                       FAIL_IF(ADDLI(ADDR_TMP_mapped, base, local_size - 32));
-                       addr_initialized = 1;
-               }
-
-               FAIL_IF(LD_ADD(SLJIT_SAVED_REG3_mapped, ADDR_TMP_mapped, 8));
-       }
-
-       if (compiler->saveds >= 2) {
-               if (addr_initialized == 0) {
-                       FAIL_IF(ADDLI(ADDR_TMP_mapped, base, local_size - 24));
-                       addr_initialized = 1;
-               }
-
-               FAIL_IF(LD_ADD(SLJIT_SAVED_REG2_mapped, ADDR_TMP_mapped, 8));
-       }
-
-       if (compiler->saveds >= 1) {
-               if (addr_initialized == 0) {
-                       FAIL_IF(ADDLI(ADDR_TMP_mapped, base, local_size - 16));
-                       /* addr_initialized = 1; no need to initialize as it's the last one. */
-               }
-
-               FAIL_IF(LD_ADD(SLJIT_SAVED_REG1_mapped, ADDR_TMP_mapped, 8));
+       /* Restore the R registers that need to be reserved. */
+       for (i = compiler->scratches; i >= SLJIT_FIRST_SAVED_REG; i--) {
+               FAIL_IF(LD_ADD(reg_map[i], ADDR_TMP_mapped, -8));
        }
 
        if (compiler->local_size <= SIMM_16BIT_MAX)
@@ -1585,7 +1550,7 @@ static SLJIT_INLINE sljit_si emit_op_mem2(struct sljit_compiler *compiler, sljit
 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_si dst, sljit_sw dstw)
 {
        CHECK_ERROR();
-       check_sljit_emit_fast_enter(compiler, dst, dstw);
+       CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw));
        ADJUST_LOCAL_OFFSET(dst, dstw);
 
        /* For UNUSED dst. Uncommon, but possible. */
@@ -1602,7 +1567,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_fast_enter(struct sljit_compiler *c
 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_fast_return(struct sljit_compiler *compiler, sljit_si src, sljit_sw srcw)
 {
        CHECK_ERROR();
-       check_sljit_emit_fast_return(compiler, src, srcw);
+       CHECK(check_sljit_emit_fast_return(compiler, src, srcw));
        ADJUST_LOCAL_OFFSET(src, srcw);
 
        if (FAST_IS_REG(src))
@@ -1636,9 +1601,11 @@ static SLJIT_INLINE sljit_si emit_single_op(struct sljit_compiler *compiler, slj
                        if (op == SLJIT_MOV_SI)
                                return BFEXTS(reg_map[dst], reg_map[src2], 0, 31);
 
-               return BFEXTU(reg_map[dst], reg_map[src2], 0, 31);
-               } else if (dst != src2)
-                       SLJIT_ASSERT_STOP();
+                       return BFEXTU(reg_map[dst], reg_map[src2], 0, 31);
+               } else if (dst != src2) {
+                       SLJIT_ASSERT(src2 == 0);
+                       return ADD(reg_map[dst], reg_map[src2], ZERO);
+               }
 
                return SLJIT_SUCCESS;
 
@@ -1650,8 +1617,10 @@ static SLJIT_INLINE sljit_si emit_single_op(struct sljit_compiler *compiler, slj
                                return BFEXTS(reg_map[dst], reg_map[src2], 0, 7);
 
                        return BFEXTU(reg_map[dst], reg_map[src2], 0, 7);
-               } else if (dst != src2)
-                       SLJIT_ASSERT_STOP();
+               } else if (dst != src2) {
+                       SLJIT_ASSERT(src2 == 0);
+                       return ADD(reg_map[dst], reg_map[src2], ZERO);
+               }
 
                return SLJIT_SUCCESS;
 
@@ -1663,8 +1632,10 @@ static SLJIT_INLINE sljit_si emit_single_op(struct sljit_compiler *compiler, slj
                                return BFEXTS(reg_map[dst], reg_map[src2], 0, 15);
 
                        return BFEXTU(reg_map[dst], reg_map[src2], 0, 15);
-               } else if (dst != src2)
-                       SLJIT_ASSERT_STOP();
+               } else if (dst != src2) {
+                       SLJIT_ASSERT(src2 == 0);
+                       return ADD(reg_map[dst], reg_map[src2], ZERO);
+               }
 
                return SLJIT_SUCCESS;
 
@@ -1811,7 +1782,6 @@ static SLJIT_INLINE sljit_si emit_single_op(struct sljit_compiler *compiler, slj
                                else {
                                        /* Rare ocasion. */
                                        FAIL_IF(ADD(TMP_EREG2, reg_map[src1], ZERO));
-       
                                        overflow_ra = TMP_EREG2;
                                }
                        }
@@ -1903,6 +1873,17 @@ static SLJIT_INLINE sljit_si emit_single_op(struct sljit_compiler *compiler, slj
 
                return SLJIT_SUCCESS;
 
+       case SLJIT_MUL:
+               if (flags & SRC2_IMM) {
+                       FAIL_IF(load_immediate(compiler, TMP_REG2_mapped, src2));
+                       src2 = TMP_REG2;
+                       flags &= ~SRC2_IMM;
+               }
+
+               FAIL_IF(MUL(reg_map[dst], reg_map[src1], reg_map[src2]));
+
+               return SLJIT_SUCCESS;
+
 #define EMIT_LOGICAL(op_imm, op_norm) \
        if (flags & SRC2_IMM) { \
                FAIL_IF(load_immediate(compiler, ADDR_TMP_mapped, src2)); \
@@ -1950,8 +1931,8 @@ static SLJIT_INLINE sljit_si emit_single_op(struct sljit_compiler *compiler, slj
        } else { \
                if (op & SLJIT_SET_E) \
                        FAIL_IF(push_3_buffer( \
-                               compiler, op_imm, reg_map[dst], reg_map[src1], \
-                               src2 & 0x3F, __LINE__)); \
+                               compiler, op_norm, EQUAL_FLAG, reg_map[src1], \
+                               reg_map[src2], __LINE__)); \
                if (CHECK_FLAGS(SLJIT_SET_E)) \
                        FAIL_IF(push_3_buffer( \
                                compiler, op_norm, reg_map[dst], reg_map[src1], \
@@ -2105,66 +2086,61 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_flags(struct sljit_compiler *com
 {
        sljit_si sugg_dst_ar, dst_ar;
        sljit_si flags = GET_ALL_FLAGS(op);
+       sljit_si mem_type = (op & SLJIT_INT_OP) ? (INT_DATA | SIGNED_DATA) : WORD_DATA;
 
        CHECK_ERROR();
-       check_sljit_emit_op_flags(compiler, op, dst, dstw, src, srcw, type);
+       CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, src, srcw, type));
        ADJUST_LOCAL_OFFSET(dst, dstw);
 
        if (dst == SLJIT_UNUSED)
                return SLJIT_SUCCESS;
 
        op = GET_OPCODE(op);
+       if (op == SLJIT_MOV_SI || op == SLJIT_MOV_UI)
+               mem_type = INT_DATA | SIGNED_DATA;
        sugg_dst_ar = reg_map[(op < SLJIT_ADD && FAST_IS_REG(dst)) ? dst : TMP_REG2];
 
        compiler->cache_arg = 0;
        compiler->cache_argw = 0;
        if (op >= SLJIT_ADD && (src & SLJIT_MEM)) {
                ADJUST_LOCAL_OFFSET(src, srcw);
-               FAIL_IF(emit_op_mem2(compiler, WORD_DATA | LOAD_DATA, TMP_REG1_mapped, src, srcw, dst, dstw));
+               FAIL_IF(emit_op_mem2(compiler, mem_type | LOAD_DATA, TMP_REG1_mapped, src, srcw, dst, dstw));
                src = TMP_REG1;
                srcw = 0;
        }
 
-       switch (type) {
-       case SLJIT_C_EQUAL:
-       case SLJIT_C_NOT_EQUAL:
+       switch (type & 0xff) {
+       case SLJIT_EQUAL:
+       case SLJIT_NOT_EQUAL:
                FAIL_IF(CMPLTUI(sugg_dst_ar, EQUAL_FLAG, 1));
                dst_ar = sugg_dst_ar;
                break;
-       case SLJIT_C_LESS:
-       case SLJIT_C_GREATER_EQUAL:
-       case SLJIT_C_FLOAT_LESS:
-       case SLJIT_C_FLOAT_GREATER_EQUAL:
+       case SLJIT_LESS:
+       case SLJIT_GREATER_EQUAL:
                dst_ar = ULESS_FLAG;
                break;
-       case SLJIT_C_GREATER:
-       case SLJIT_C_LESS_EQUAL:
-       case SLJIT_C_FLOAT_GREATER:
-       case SLJIT_C_FLOAT_LESS_EQUAL:
+       case SLJIT_GREATER:
+       case SLJIT_LESS_EQUAL:
                dst_ar = UGREATER_FLAG;
                break;
-       case SLJIT_C_SIG_LESS:
-       case SLJIT_C_SIG_GREATER_EQUAL:
+       case SLJIT_SIG_LESS:
+       case SLJIT_SIG_GREATER_EQUAL:
                dst_ar = LESS_FLAG;
                break;
-       case SLJIT_C_SIG_GREATER:
-       case SLJIT_C_SIG_LESS_EQUAL:
+       case SLJIT_SIG_GREATER:
+       case SLJIT_SIG_LESS_EQUAL:
                dst_ar = GREATER_FLAG;
                break;
-       case SLJIT_C_OVERFLOW:
-       case SLJIT_C_NOT_OVERFLOW:
+       case SLJIT_OVERFLOW:
+       case SLJIT_NOT_OVERFLOW:
                dst_ar = OVERFLOW_FLAG;
                break;
-       case SLJIT_C_MUL_OVERFLOW:
-       case SLJIT_C_MUL_NOT_OVERFLOW:
+       case SLJIT_MUL_OVERFLOW:
+       case SLJIT_MUL_NOT_OVERFLOW:
                FAIL_IF(CMPLTUI(sugg_dst_ar, OVERFLOW_FLAG, 1));
                dst_ar = sugg_dst_ar;
                type ^= 0x1; /* Flip type bit for the XORI below. */
                break;
-       case SLJIT_C_FLOAT_EQUAL:
-       case SLJIT_C_FLOAT_NOT_EQUAL:
-               dst_ar = EQUAL_FLAG;
-               break;
 
        default:
                SLJIT_ASSERT_STOP();
@@ -2180,11 +2156,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_flags(struct sljit_compiler *com
        if (op >= SLJIT_ADD) {
                if (TMP_REG2_mapped != dst_ar)
                        FAIL_IF(ADD(TMP_REG2_mapped, dst_ar, ZERO));
-               return emit_op(compiler, op | flags, CUMULATIVE_OP | LOGICAL_OP | IMM_OP | ALT_KEEP_CACHE, dst, dstw, src, srcw, TMP_REG2, 0);
+               return emit_op(compiler, op | flags, mem_type | CUMULATIVE_OP | LOGICAL_OP | IMM_OP | ALT_KEEP_CACHE, dst, dstw, src, srcw, TMP_REG2, 0);
        }
 
        if (dst & SLJIT_MEM)
-               return emit_op_mem(compiler, WORD_DATA, dst_ar, dst, dstw);
+               return emit_op_mem(compiler, mem_type, dst_ar, dst, dstw);
 
        if (sugg_dst_ar != dst_ar)
                return ADD(sugg_dst_ar, dst_ar, ZERO);
@@ -2194,7 +2170,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_flags(struct sljit_compiler *com
 
 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op0(struct sljit_compiler *compiler, sljit_si op) {
        CHECK_ERROR();
-       check_sljit_emit_op0(compiler, op);
+       CHECK(check_sljit_emit_op0(compiler, op));
 
        op = GET_OPCODE(op);
        switch (op) {
@@ -2204,10 +2180,10 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op0(struct sljit_compiler *compiler
        case SLJIT_BREAKPOINT:
                return PI(BPT);
 
-       case SLJIT_UMUL:
-       case SLJIT_SMUL:
-       case SLJIT_UDIV:
-       case SLJIT_SDIV:
+       case SLJIT_LUMUL:
+       case SLJIT_LSMUL:
+       case SLJIT_UDIVI:
+       case SLJIT_SDIVI:
                SLJIT_ASSERT_STOP();
        }
 
@@ -2217,7 +2193,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op0(struct sljit_compiler *compiler
 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op1(struct sljit_compiler *compiler, sljit_si op, sljit_si dst, sljit_sw dstw, sljit_si src, sljit_sw srcw)
 {
        CHECK_ERROR();
-       check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw);
+       CHECK(check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw));
        ADJUST_LOCAL_OFFSET(dst, dstw);
        ADJUST_LOCAL_OFFSET(src, srcw);
 
@@ -2273,7 +2249,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op1(struct sljit_compiler *compiler
                return emit_op(compiler, SLJIT_SUB | GET_ALL_FLAGS(op), IMM_OP, dst, dstw, SLJIT_IMM, 0, src, srcw);
 
        case SLJIT_CLZ:
-               return emit_op(compiler, op, 0, dst, dstw, TMP_REG1, 0, src, srcw);
+               return emit_op(compiler, op, (op & SLJIT_INT_OP) ? INT_DATA : WORD_DATA, dst, dstw, TMP_REG1, 0, src, srcw);
        }
 
        return SLJIT_SUCCESS;
@@ -2282,7 +2258,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op1(struct sljit_compiler *compiler
 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op2(struct sljit_compiler *compiler, sljit_si op, sljit_si dst, sljit_sw dstw, sljit_si src1, sljit_sw src1w, sljit_si src2, sljit_sw src2w)
 {
        CHECK_ERROR();
-       check_sljit_emit_op2(compiler, op, dst, dstw, src1, src1w, src2, src2w);
+       CHECK(check_sljit_emit_op2(compiler, op, dst, dstw, src1, src1w, src2, src2w));
        ADJUST_LOCAL_OFFSET(dst, dstw);
        ADJUST_LOCAL_OFFSET(src1, src1w);
        ADJUST_LOCAL_OFFSET(src2, src2w);
@@ -2325,7 +2301,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_label * sljit_emit_label(struct sljit_comp
        flush_buffer(compiler);
 
        CHECK_ERROR_PTR();
-       check_sljit_emit_label(compiler);
+       CHECK_PTR(check_sljit_emit_label(compiler));
 
        if (compiler->last_label && compiler->last_label->size == compiler->size)
                return compiler->last_label;
@@ -2344,7 +2320,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_ijump(struct sljit_compiler *compil
        flush_buffer(compiler);
 
        CHECK_ERROR();
-       check_sljit_emit_ijump(compiler, type, src, srcw);
+       CHECK(check_sljit_emit_ijump(compiler, type, src, srcw));
        ADJUST_LOCAL_OFFSET(src, srcw);
 
        if (FAST_IS_REG(src)) {
@@ -2404,8 +2380,10 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_ijump(struct sljit_compiler *compil
 
                return SLJIT_SUCCESS;
 
-       } else if (src & SLJIT_MEM)
+       } else if (src & SLJIT_MEM) {
                FAIL_IF(emit_op(compiler, SLJIT_MOV, WORD_DATA, TMP_REG2, 0, TMP_REG1, 0, src, srcw));
+               flush_buffer(compiler);
+       }
 
        FAIL_IF(JR_SOLO(reg_map[src_r]));
 
@@ -2432,7 +2410,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump * sljit_emit_jump(struct sljit_compil
        flush_buffer(compiler);
 
        CHECK_ERROR_PTR();
-       check_sljit_emit_jump(compiler, type);
+       CHECK_PTR(check_sljit_emit_jump(compiler, type));
 
        jump = (struct sljit_jump *)ensure_abuf(compiler, sizeof(struct sljit_jump));
        PTR_FAIL_IF(!jump);
@@ -2440,48 +2418,42 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump * sljit_emit_jump(struct sljit_compil
        type &= 0xff;
 
        switch (type) {
-       case SLJIT_C_EQUAL:
-       case SLJIT_C_FLOAT_NOT_EQUAL:
+       case SLJIT_EQUAL:
                BR_NZ(EQUAL_FLAG);
                break;
-       case SLJIT_C_NOT_EQUAL:
-       case SLJIT_C_FLOAT_EQUAL:
+       case SLJIT_NOT_EQUAL:
                BR_Z(EQUAL_FLAG);
                break;
-       case SLJIT_C_LESS:
-       case SLJIT_C_FLOAT_LESS:
+       case SLJIT_LESS:
                BR_Z(ULESS_FLAG);
                break;
-       case SLJIT_C_GREATER_EQUAL:
-       case SLJIT_C_FLOAT_GREATER_EQUAL:
+       case SLJIT_GREATER_EQUAL:
                BR_NZ(ULESS_FLAG);
                break;
-       case SLJIT_C_GREATER:
-       case SLJIT_C_FLOAT_GREATER:
+       case SLJIT_GREATER:
                BR_Z(UGREATER_FLAG);
                break;
-       case SLJIT_C_LESS_EQUAL:
-       case SLJIT_C_FLOAT_LESS_EQUAL:
+       case SLJIT_LESS_EQUAL:
                BR_NZ(UGREATER_FLAG);
                break;
-       case SLJIT_C_SIG_LESS:
+       case SLJIT_SIG_LESS:
                BR_Z(LESS_FLAG);
                break;
-       case SLJIT_C_SIG_GREATER_EQUAL:
+       case SLJIT_SIG_GREATER_EQUAL:
                BR_NZ(LESS_FLAG);
                break;
-       case SLJIT_C_SIG_GREATER:
+       case SLJIT_SIG_GREATER:
                BR_Z(GREATER_FLAG);
                break;
-       case SLJIT_C_SIG_LESS_EQUAL:
+       case SLJIT_SIG_LESS_EQUAL:
                BR_NZ(GREATER_FLAG);
                break;
-       case SLJIT_C_OVERFLOW:
-       case SLJIT_C_MUL_OVERFLOW:
+       case SLJIT_OVERFLOW:
+       case SLJIT_MUL_OVERFLOW:
                BR_Z(OVERFLOW_FLAG);
                break;
-       case SLJIT_C_NOT_OVERFLOW:
-       case SLJIT_C_MUL_NOT_OVERFLOW:
+       case SLJIT_NOT_OVERFLOW:
+       case SLJIT_MUL_NOT_OVERFLOW:
                BR_NZ(OVERFLOW_FLAG);
                break;
        default:
@@ -2536,7 +2508,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const * sljit_emit_const(struct sljit_comp
        flush_buffer(compiler);
 
        CHECK_ERROR_PTR();
-       check_sljit_emit_const(compiler, dst, dstw, init_value);
+       CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value));
        ADJUST_LOCAL_OFFSET(dst, dstw);
 
        const_ = (struct sljit_const *)ensure_abuf(compiler, sizeof(struct sljit_const));
@@ -2572,3 +2544,18 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_consta
        inst[3] = (inst[3] & ~(0xFFFFL << 43)) | ((new_constant & 0xFFFFL) << 43);
        SLJIT_CACHE_FLUSH(inst, inst + 4);
 }
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_register_index(sljit_si reg)
+{
+       CHECK_REG_INDEX(check_sljit_get_register_index(reg));
+       return reg_map[reg];
+}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
+       void *instruction, sljit_si size)
+{
+       CHECK_ERROR();
+       CHECK(check_sljit_emit_op_custom(compiler, instruction, size));
+       return SLJIT_ERR_UNSUPPORTED;
+}
+
index b7bbb0384d5208025162506f9866c8f5eb0a8843..416c15afafa6a6180a1fc51296c3208d9fcb477b 100644 (file)
@@ -273,7 +273,9 @@ static sljit_si cpu_has_sse2 = -1;
 #endif
 static sljit_si cpu_has_cmov = -1;
 
-#if defined(_MSC_VER) && _MSC_VER >= 1400
+#ifdef _WIN32_WCE
+#include <cmnintrin.h>
+#elif defined(_MSC_VER) && _MSC_VER >= 1400
 #include <intrin.h>
 #endif
 
@@ -2934,3 +2936,69 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_consta
 {
        *(sljit_sw*)addr = new_constant;
 }
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_is_sse2_available(void)
+{
+#if (defined SLJIT_DETECT_SSE2 && SLJIT_DETECT_SSE2)
+       if (cpu_has_sse2 == -1)
+               get_cpu_features();
+       return cpu_has_sse2;
+#else
+       return 1;
+#endif
+}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_is_cmov_available(void)
+{
+       if (cpu_has_cmov == -1)
+               get_cpu_features();
+       return cpu_has_cmov;
+}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_emit_cmov(struct sljit_compiler *compiler,
+       sljit_si type,
+       sljit_si dst_reg,
+       sljit_si src, sljit_sw srcw)
+{
+       sljit_ub* inst;
+
+       CHECK_ERROR();
+#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
+       CHECK_ARGUMENT(sljit_x86_is_cmov_available());
+       CHECK_ARGUMENT(!(type & ~(0xff | SLJIT_INT_OP)));
+       CHECK_ARGUMENT((type & 0xff) >= SLJIT_EQUAL && (type & 0xff) <= SLJIT_D_ORDERED);
+       CHECK_ARGUMENT(FUNCTION_CHECK_IS_REG(dst_reg & ~SLJIT_INT_OP));
+       FUNCTION_CHECK_SRC(src, srcw);
+#endif
+#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
+       if (SLJIT_UNLIKELY(!!compiler->verbose)) {
+               fprintf(compiler->verbose, "  x86_cmov%s %s%s, ",
+                       !(dst_reg & SLJIT_INT_OP) ? "" : ".i",
+                       JUMP_PREFIX(type), jump_names[type & 0xff]);
+               sljit_verbose_reg(compiler, dst_reg & ~SLJIT_INT_OP);
+               fprintf(compiler->verbose, ", ");
+               sljit_verbose_param(compiler, src, srcw);
+               fprintf(compiler->verbose, "\n");
+       }
+#endif
+
+       ADJUST_LOCAL_OFFSET(src, srcw);
+       CHECK_EXTRA_REGS(src, srcw, (void)0);
+
+#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+       compiler->mode32 = dst_reg & SLJIT_INT_OP;
+#endif
+       dst_reg &= ~SLJIT_INT_OP;
+
+       if (SLJIT_UNLIKELY(src & SLJIT_IMM)) {
+               EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_IMM, srcw);
+               src = TMP_REG1;
+               srcw = 0;
+       }
+
+       inst = emit_x86_instruction(compiler, 2, dst_reg, 0, src, srcw);
+       FAIL_IF(!inst);
+       *inst++ = GROUP_0F;
+       *inst = get_jump_code(type & 0xff) - 0x40;
+       return SLJIT_SUCCESS;
+}
index 883bad7f7f70aeb163ba4bce6df36091f1c757f3..3f6704cb0ca4fc03a975696f8328cc5f0b9ada0a 100644 (file)
@@ -751,3 +751,7 @@ RC=0
 2:3,1
 2:4,1
 RC=0
+---------------------------- Test 108 ------------------------------
+RC=0
+---------------------------- Test 109 -----------------------------
+RC=0
index 884faf1c740ac0d23a9be30b3c27ec8498c10f21..6d7bc8015d2fb8b729c6b74e46383295e5a51e5e 100644 (file)
@@ -3,12 +3,14 @@
 # 32-bit PCRE libraries, and also using the perltest.pl script.
     
 #forbid_utf
+#newline_default lf any anycrlf
 #perltest
 
 /the quick brown fox/
     the quick brown fox
-    The quick brown FOX
     What do you know about the quick brown fox?
+\= Expect no match
+    The quick brown FOX
     What do you know about THE QUICK BROWN FOX?
 
 /The quick brown fox/i
@@ -51,7 +53,7 @@
     >>>aaabxyzpqrrrabbxyyyypqAzz
     >aaaabxyzpqrrrabbxyyyypqAzz
     >>>>abcxyzpqrrrabbxyyyypqAzz
-    *** Failers
+\= Expect no match
     abxyzpqrrabbxyyyypqAzz
     abxyzpqrrrrabbxyyyypqAzz
     abxyzpqrrrabxyyyypqAzz
@@ -62,7 +64,7 @@
 /^(abc){1,2}zz/
     abczz
     abcabczz
-    *** Failers
+\= Expect no match
     zz
     abcabcabczz
     >>abczz
@@ -76,7 +78,7 @@
     aac
     abbbbbbbbbbbc
     bbbbbbbbbbbac
-    *** Failers
+\= Expect no match
     aaac
     abbbbbbbbbbbac
 
@@ -89,7 +91,7 @@
     aac
     abbbbbbbbbbbc
     bbbbbbbbbbbac
-    *** Failers
+\= Expect no match
     aaac
     abbbbbbbbbbbac
 
     babc
     bbabc
     bababc
-    *** Failers
+\= Expect no match
     bababbc
     babababc
 
     babc
     bbabc
     bababc
-    *** Failers
+\= Expect no match
     bababbc
     babababc
 
     cthing
     dthing
     ething
-    *** Failers
+\= Expect no match
     fthing
     [thing
     \\thing
     cthing
     dthing
     ething
-    *** Failers
+\= Expect no match
     athing
     fthing
 
     fthing
     [thing
     \\thing
-    *** Failers
+\= Expect no match
     athing
     bthing
     ]thing
 /^[^]cde]/
     athing
     fthing
-    *** Failers
+\= Expect no match
     ]thing
     cthing
     dthing
     9
     10
     100
-    *** Failers
+\= Expect no match
     abc
 
 /^.*nter/
 /^xxx[0-9]+$/
     xxx0
     xxx1234
-    *** Failers
+\= Expect no match
     xxx
 
 /^.+[0-9][0-9][0-9]$/
     x123
+    x1234
     xx123
     123456
-    *** Failers
+\= Expect no match
     123
-    x1234
 
 /^.+?[0-9][0-9][0-9]$/
     x123
+    x1234
     xx123
     123456
-    *** Failers
+\= Expect no match
     123
-    x1234
 
 /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
     abc!pqr=apquxz.ixr.zzz.ac.uk
-    *** Failers
+\= Expect no match
     !pqr=apquxz.ixr.zzz.ac.uk
     abc!=apquxz.ixr.zzz.ac.uk
     abc!pqr=apquxz:ixr.zzz.ac.uk
 
 /:/
     Well, we need a colon: somewhere
-    *** Fail if we don't
+\= Expect no match
+    Fail without a colon
 
 /([\da-f:]+)$/i
     0abc
     5f03:12C0::932e
     fed def
     Any old stuff
-    *** Failers
+\= Expect no match
     0zzz
     gzzz
     fed\x20
 /^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/
     .1.2.3
     A.12.123.0
-    *** Failers
+\= Expect no match
     .1.2.3333
     1.2.3
     1234.2.3
 /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
     1 IN SOA non-sp1 non-sp2(
     1    IN    SOA    non-sp1    non-sp2   (
-    *** Failers
+\= Expect no match
     1IN SOA non-sp1 non-sp2(
 
 /^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/
     ab-c.pq-r.
     sxk.zzz.ac.uk.
     x-.y-.
-    *** Failers
+\= Expect no match
     -abc.peq.
 
 /^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/
     *.b0-a
     *.c3-b.c
     *.c-a.b-c
-    *** Failers
+\= Expect no match
     *.0
     *.a-
     *.a-b.c-
     \"1234\"
     \"abcd\" ;
     \"\" ; rhubarb
-    *** Failers
+\= Expect no match
     \"1234\" : things
 
 /^$/
     \
-    *** Failers
+\= Expect no match
+    A non-empty line
 
 /   ^    a   (?# begins with a)  b\sc (?# then b c) $ (?# then end)/x
     ab c
-    *** Failers
+\= Expect no match
     abc
     ab cde
 
 /(?x)   ^    a   (?# begins with a)  b\sc (?# then b c) $ (?# then end)/
     ab c
-    *** Failers
+\= Expect no match
     abc
     ab cde
 
 /^   a\ b[c ]d       $/x
     a bcd
     a b d
-    *** Failers
+\= Expect no match
     abcd
     ab d
 
     1234567890
     12345678ab
     12345678__
-    *** Failers
+\= Expect no match
     1234567
 
 /^[aeiou\d]{4,5}$/
     1234
     12345
     aaaaa
-    *** Failers
+\= Expect no match
     123456
 
 /^[aeiou\d]{4,5}?/
 /\A(abc|def)=(\1){2,3}\Z/
     abc=abcabc
     def=defdefdef
-    *** Failers
+\= Expect no match
     abc=defdef
 
 /^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/
 /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/
     From abcd  Mon Sep 01 12:33:02 1997
     From abcd  Mon Sep  1 12:33:02 1997
-    *** Failers
+\= Expect no match
     From abcd  Sep 01 12:33:02 1997
 
 /^12.34/s
 
 /^(\D*)(?=\d)(?!123)/
     abc456
-    *** Failers
+\= Expect no match
     abc123
 
 /^1234(?# test newlines
 
 /(?!^)abc/
     the abc
-    *** Failers
+\= Expect no match
     abc
 
 /(?=^)abc/
     abc
-    *** Failers
+\= Expect no match
     the abc
 
 /^[ab]{1,3}(ab*|b)/
     A. Other <user.1234\@dom.ain> (a comment)
     \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
     A missing angle <user\@some.where
-    *** Failers
+\= Expect no match
     The quick brown fox
 
 /[\040\t]*                    # Nab whitespace.
     A. Other <user.1234\@dom.ain> (a comment)
     \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
     A missing angle <user\@some.where
-    *** Failers
+\= Expect no match
     The quick brown fox
 
 /abc\0def\00pqr\000xyz\0000AB/
 /A\x0{2,3}Z/
     The A\x0\x0Z
     An A\0\x0\0Z
-    *** Failers
+\= Expect no match
     A\0Z
     A\0\x0\0\x0Z
 
 /^(cow|)\1(bell)/
     cowcowbell
     bell
-    *** Failers
+\= Expect no match
     cowbell
 
 /^\s/
     \nabc
     \rabc
     \tabc
-    *** Failers
+\= Expect no match
     abc
 
 /^a    b
     ab
     aaaab
     b
-    *** Failers
+\= Expect no match
     acb
 
 /^(a|)\1+b/
     aab
     aaaab
     b
-    *** Failers
+\= Expect no match
     ab
 
 /^(a|)\1?b/
     ab
     aab
     b
-    *** Failers
+\= Expect no match
     acb
 
 /^(a|)\1{2}b/
     aaab
     b
-    *** Failers
+\= Expect no match
     ab
     aab
     aaaab
     aaab
     aaaab
     b
-    *** Failers
+\= Expect no match
     ab
     aab
     aaaaab
     abbbbc
     abbbc
     abbc
-    *** Failers
+\= Expect no match
     abc
     abbbbbc
 
 
 /^[W-c]+$/
     WXY_^abc
-    *** Failers
+\= Expect no match
     wxy
 
 /^[W-c]+$/i
 
 /^abc$/
     abc
-    *** Failers
+\= Expect no match
     qqq\nabc
     abc\nzzz
     qqq\nabc\nzzz
 /\Aabc\Z/m
     abc
     abc\n 
-    *** Failers
+\= Expect no match
     qqq\nabc
     abc\nzzz
     qqq\nabc\nzzz
     abc\ndef
 
 /\A(.)*\Z/m
-    *** Failers
+\= Expect no match
     abc\ndef
 
 /(?:b)|(?::+)/
 
 /[-az]+/
     az-
-    *** Failers
+\= Expect no match
     b
 
 /[az-]+/
     za-
-    *** Failers
+\= Expect no match
     b
 
 /[a\-z]+/
     a-z
-    *** Failers
+\= Expect no match
     b
 
 /[a-z]+/
 
 /[\d-]+/
     12-34
-    *** Failers
+\= Expect no match
     aaa
 
 /[\d-z]+/
     12-34z
-    *** Failers
+\= Expect no match
     aaa
 
 /\x5c/
 
 /\x20Z/
     the Zoo
-    *** Failers
+\= Expect no match
     Zulu
 
 /(abc)\1/i
     ABCabc
     abcABC
 
-/ab{3cd/
-    ab{3cd
-
-/ab{3,cd/
-    ab{3,cd
-
-/ab{3,4a}cd/
-    ab{3,4a}cd
-
-/{4,5a}bc/
-    {4,5a}bc
-
 /abc$/
     abc
     abc\n
-    *** Failers
+\= Expect no match
     abc\ndef
 
 /(abc)\123/
 
 /^[A\8B\9C]+$/
     A8B9C
-    *** Failers 
+\= Expect no match 
     A8B9C\x00
 
 /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\12\123/
     baNOTcccd
     baNOTccd
     bacccd
-    *** Failers
+\= Expect no match
     anything
     b\bc   
     baccd
    
 /[^k]$/
     abc
-    *** Failers
+\= Expect no match
     abk   
    
 /[^k]{2,3}$/
     abc
     kbc
     kabc 
-    *** Failers
+\= Expect no match
     abk
     akb
     akk 
 /^\d{8,}\@.+[^k]$/
     12345678\@a.b.c.d
     123456789\@x.y.z
-    *** Failers
+\= Expect no match
     12345678\@x.y.uk
     1234567\@a.b.c.d       
 
 /(a)\1{8,}/
     aaaaaaaaa
     aaaaaaaaaa
-    *** Failers
+\= Expect no match
     aaaaaaa   
 
 /[^a]/
 /(\.\d\d((?=0)|\d(?=\d)))/
     1.230003938      
     1.875000282
-    *** Failers 
+\= Expect no match 
     1.235 
     
 /a(?)b/
      
 /^(\D*)(?=\d)(?!123)/
     ABC445
-    *** Failers
+\= Expect no match
     ABC123
     
 /^[W-]46]/
     W46]789 
     -46]789
-    *** Failers
+\= Expect no match
     Wall
     Zebra
     42
     [abcd] 
     ]abcd[
     \\backslash 
-    *** Failers
+\= Expect no match
     -46]789
     well
     
     01/01/2000
 
 /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
-  word cat dog elephant mussel cow horse canary baboon snake shark otherword
-  word cat dog elephant mussel cow horse canary baboon snake shark
+    word cat dog elephant mussel cow horse canary baboon snake shark otherword
+\= Expect no match
+    word cat dog elephant mussel cow horse canary baboon snake shark
 
 /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
-  word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
+\= Expect no match
+    word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
 
 /^(a){0,0}/
     bcd
     aaaaaaaa    
 
 /^(a){1,1}/
-    bcd
     abc
     aab  
+\= Expect no match
+    bcd
 
 /^(a){1,2}/
-    bcd
     abc
     aab  
+\= Expect no match
+    bcd
 
 /^(a){1,3}/
-    bcd
     abc
     aab
     aaa   
+\= Expect no match
+    bcd
 
 /^(a){1,}/
-    bcd
     abc
     aab
     aaa
     aaaaaaaa    
+\= Expect no match
+    bcd
 
 /.*\.gif/
     borfle\nbib.gif\nno
 /(.*X|^B)/
     abcde\n1234Xyz
     BarFoo 
-    *** Failers
+\= Expect no match
     abcde\nBar  
 
 /(.*X|^B)/m
 /(.*X|^B)/s
     abcde\n1234Xyz
     BarFoo 
-    *** Failers
+\= Expect no match
     abcde\nBar  
 
 /(.*X|^B)/ms
 /(?s)(.*X|^B)/
     abcde\n1234Xyz
     BarFoo 
-    *** Failers 
+\= Expect no match 
     abcde\nBar  
 
 /(?s:.*X|^B)/
     abcde\n1234Xyz
     BarFoo 
-    *** Failers 
+\= Expect no match 
     abcde\nBar  
 
 /^.*B/
-    **** Failers
+\= Expect no match
     abc\nB
      
 /(?s)^.*B/
 
 /^[abcdefghijklmnopqrstuvwxy0123456789]/
     n
-    *** Failers 
+\= Expect no match 
     z 
 
 /abcde{0,0}/
     abcd
-    *** Failers
+\= Expect no match
     abce  
 
 /ab[cd]{0,0}e/
     abe
-    *** Failers
+\= Expect no match
     abcde 
     
 /ab(c){0,0}d/
     abd
-    *** Failers
+\= Expect no match
     abcd   
 
 /a(b*)/
     a
     ab
     abbbb
-    *** Failers
+\= Expect no match
     bbbbb    
     
 /ab\d{0}e/
     abe
-    *** Failers
+\= Expect no match
     ab1e   
     
 /"([^\\"]+|\\.)*"/
     
 /a.b/
     acb
-    *** Failers 
+\= Expect no match 
     a\nb   
     
 /a[^a]b/s
     bbbbbac 
     
 /(?!\A)x/m
+    a\bx\n
+    a\nx\n
+\= Expect no match     
     x\nb\n
-    a\bx\n  
     
-/\x0{ab}/
-    \0{ab} 
-
 /(A|B)*?CD/
     CD 
     
     catfood
     arfootle
     rfoosh
-    *** Failers
+\= Expect no match
     barfoo
     towbarfoo
 
 /\w{3}(?<!bar)foo/
     catfood
-    *** Failers
+\= Expect no match
     foo
     barfoo
     towbarfoo
 
 /(?<=(foo)a)bar/
     fooabar
-    *** Failers
+\= Expect no match
     bar
     foobbar
       
 /\Aabc\z/m
     abc
-    *** Failers
+\= Expect no match
     abc\n   
     qqq\nabc
     abc\nzzz
     qqq\nabc\nzzz
 
-"(?>.*/)foo"
-    /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
-
 "(?>.*/)foo"
     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
+\= Expect no match     
+    /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
 
 /(?>(\.\d\d[1-9]?))\d+/
     1.230003938
     1.875000282
-    *** Failers 
+\= Expect no match 
     1.235 
 
 /^((?>\w+)|(?>\s+))*$/
     now is the time for all good men to come to the aid of the party
-    *** Failers
+\= Expect no match
     this is not a line with only words and spaces!
     
 /(\d+)(\w)/
 
 /((?>\d+))(\w)/
     12345a
-    *** Failers
+\= Expect no match
     12345+ 
 
 /(?>a+)b/
 /\(((?>[^()]+)|\([^()]+\))+\)/
     (abc)
     (abc(def)xyz)
-    *** Failers
+\= Expect no match
     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa   
 
 /a(?-i)b/i
     ab
     Ab
-    *** Failers 
+\= Expect no match 
     aB
     AB
         
 /(a (?x)b c)d e/
     a bcd e
-    *** Failers
+\= Expect no match
     a b cd e
     abcd e   
     a bcde 
  
 /(a b(?x)c d (?-x)e f)/
     a bcde f
-    *** Failers
+\= Expect no match
     abcdef  
 
 /(a(?i)b)c/
     abc
     aBc
-    *** Failers
+\= Expect no match
     abC
     aBC  
     Abc
 /a(?i:b)c/
     abc
     aBc
-    *** Failers 
+\= Expect no match 
     ABC
     abC
     aBC
 /a(?i:b)*c/
     aBc
     aBBc
-    *** Failers 
+\= Expect no match 
     aBC
     aBBC
     
 /a(?=b(?i)c)\w\wd/
     abcd
     abCd
-    *** Failers
+\= Expect no match
     aBCd
     abcD     
     
     more than million
     more than MILLION
     more \n than Million 
-    *** Failers
+\= Expect no match
     MORE THAN MILLION    
     more \n than \n million 
 
     more than million
     more than MILLION
     more \n than Million 
-    *** Failers
+\= Expect no match
     MORE THAN MILLION    
     more \n than \n million 
     
     abc
     aBbc
     aBBc 
-    *** Failers
+\= Expect no match
     Abc
     abAb    
     abbC 
 /(?=a(?i)b)\w\wc/
     abc
     aBc
-    *** Failers
+\= Expect no match
     Ab 
     abC
     aBC     
 /(?<=a(?i)b)(\w\w)c/
     abxxc
     aBxxc
-    *** Failers
+\= Expect no match
     Abxxc
     ABxxc
     abxxC      
 /(?:(a)|b)(?(1)A|B)/
     aA
     bB
-    *** Failers
+\= Expect no match
     aB
     bA    
 
     aa
     b
     bb  
-    *** Failers
+\= Expect no match
     ab   
     
 # Perl gets this next one wrong if the pattern ends with $; in that case it
     abc:
     12
     123
-    *** Failers
+\= Expect no match
     xyz    
 
 /^(?(?!abc)\d\d|\w{3}:)$/
     abc:
     12
-    *** Failers
+\= Expect no match
     123
     xyz    
     
     cat
     fcat
     focat   
-    *** Failers
+\= Expect no match
     foocat  
 
 /(?(?<!foo)cat|bar)/
     cat
     fcat
     focat   
-    *** Failers
+\= Expect no match
     foocat  
 
 /( \( )? [^()]+ (?(1) \) |) /x
     12
     12a
     12aa
-    *** Failers
+\= Expect no match
     1234    
 
 /((?i)blah)\s+\1/
     BLAH BLAH
     Blah Blah
     blaH blaH
-    *** Failers
+\= Expect no match
     blah BLAH
     Blah blah      
     blaH blah 
 /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /x
     12-sep-98
     12-09-98
-    *** Failers
+\= Expect no match
     sep-12-98
         
 /(?<=(foo))bar\1/
     foobarfoo
     foobarfootling 
-    *** Failers
+\= Expect no match
     foobar
     barfoo   
 
     aBCx
     bbx
     BBx
-    *** Failers
+\= Expect no match
     abcX
     aBCX
     bbX
     Europe 
     frog
     France
-    *** Failers
+\= Expect no match
     Africa     
 
 /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/
     xY
     zebra
     Zambesi
-    *** Failers
+\= Expect no match
     aCD  
     XY  
 
 /(?<=foo\n)^bar/m
     foo\nbar
-    *** Failers
+\= Expect no match
     bar
     baz\nbar   
 
     barbaz
     barbarbaz 
     koobarbaz 
-    *** Failers
+\= Expect no match
     baz
     foobarbaz 
 
-/The cases of aaaa and aaaaaa are missed out below because Perl does things/
-/differently. We know that odd, and maybe incorrect, things happen with/
-/recursive references in Perl, as far as 5.11.3 - see some stuff in test #2./
+# The cases of aaaa and aaaaaa are missed out below because Perl does things
+# differently. We know that odd, and maybe incorrect, things happen with
+# recursive references in Perl, as far as 5.11.3 - see some stuff in test #2.
 
 /^(a\1?){4}$/
+    aaaaa
+    aaaaaaa
+    aaaaaaaaaa
+\= Expect no match
     a
     aa
     aaa
-    aaaaa
-    aaaaaaa
     aaaaaaaa
     aaaaaaaaa
-    aaaaaaaaaa
     aaaaaaaaaaa
     aaaaaaaaaaaa
     aaaaaaaaaaaaa
     aaaaaaaaaaaaaa
     aaaaaaaaaaaaaaa
-    aaaaaaaaaaaaaaaa               
+    aaaaaaaaaaaaaaaa
 
 /^(a\1?)(a\1?)(a\2?)(a\3?)$/
-    a
-    aa
-    aaa
     aaaa
     aaaaa
     aaaaaa
     aaaaaaa
+    aaaaaaaaaa
+\= Expect no match
+    a
+    aa
+    aaa
     aaaaaaaa
     aaaaaaaaa
-    aaaaaaaaaa
     aaaaaaaaaaa
     aaaaaaaaaaaa
     aaaaaaaaaaaaa
     aaaaaaaaaaaaaaa
     aaaaaaaaaaaaaaaa               
 
-/The following tests are taken from the Perl 5.005 test suite; some of them/
-/are compatible with 5.004, but I'd rather not have to sort them out./
+# The following tests are taken from the Perl 5.005 test suite; some of them
+# are compatible with 5.004, but I'd rather not have to sort them out.
 
 /abc/
     abc
     xabcy
     ababc
-    *** Failers
+\= Expect no match
     xbc
     axc
     abx
 
 /ab+bc/
     abbc
-    *** Failers
+\= Expect no match
     abc
     abq
 
     abbbbc
 
 /ab{4,5}bc/
-    *** Failers
+\= Expect no match
     abq
     abbbbc
 
 
 /^abc$/
     abc
-    *** Failers
+\= Expect no match
     abbbbc
     abcc
 
 
 /abc$/
     aabc
-    *** Failers
-    aabc
+\= Expect no match
     aabcd
 
 /^/
 
 /a[bc]d/
     abd
-    *** Failers
+\= Expect no match
     axyzd
     abc
 
 
 /a[^bc]d/
     aed
-    *** Failers
+\= Expect no match
     abd
     abd
 
 
 /a[^]b]c/
     adc
-    *** Failers
     a-c
+\= Expect no match
     a]c
 
 /\ba\b/
     -a-
 
 /\by\b/
-    *** Failers
+\= Expect no match
     xy
     yz
     xyz
 
 /\Ba\B/
-    *** Failers
+\= Expect no match
     a-
     -a
     -a-
 
 /\W/
     -
-    *** Failers
-    -
+\= Expect no match
     a
 
 /a\sb/
 
 /a\Sb/
     a-b
-    *** Failers
-    a-b
+\= Expect no match
     a b
 
 /\d/
 
 /\D/
     -
-    *** Failers
-    -
+\= Expect no match
     1
 
 /[\w]/
 
 /[\W]/
     -
-    *** Failers
-    -
+\= Expect no match
     a
 
 /a[\s]b/
 
 /a[\S]b/
     a-b
-    *** Failers
-    a-b
+\= Expect no match
     a b
 
 /[\d]/
 
 /[\D]/
     -
-    *** Failers
-    -
+\= Expect no match
     1
 
 /ab|cd/
     cde
 
 /abc/
-    *** Failers
+\= Expect no match
     b
-    
 
 /a*/
-    
+    \
 
 /([abc])*d/
     abbbcd
     adcdcde
 
 /a[bcd]+dcdcde/
-    *** Failers
+\= Expect no match
     abcde
     adcdcde
 
     effgz
     ij
     reffgz
-    *** Failers
+\= Expect no match
     effg
     bcdd
 
     a
 
 /multiple words of text/
-    *** Failers
+\= Expect no match
     aa
     uh-uh
 
 
 /(a)|\1/
     a
-    *** Failers
     ab
+\= Expect no match
     x
 
 /(([a-c])b*?\2)*/
     ABC
     XABCY
     ABABC
-    *** Failers
+\= Expect no match
     aaxabxbaxbbx
     XBC
     AXC
     ABBC
 
 /ab+bc/i
-    *** Failers
+\= Expect no match
     ABC
     ABQ
 
     ABBBBC
 
 /ab{4,5}?bc/i
-    *** Failers
+\= Expect no match
     ABQ
     ABBBBC
 
 
 /^abc$/i
     ABC
-    *** Failers
+\= Expect no match
     ABBBBC
     ABCC
 
     AXYZC
 
 /a.*c/i
-    *** Failers
     AABC
+\= Expect no match
     AXYZD
 
 /a[bc]d/i
 
 /a[b-d]e/i
     ACE
-    *** Failers
+\= Expect no match
     ABC
     ABD
 
 
 /a[^-b]c/i
     ADC
-    *** Failers
+\= Expect no match
     ABD
     A-C
 
     DEF
 
 /$b/i
-    *** Failers
+\= Expect no match
     A]C
     B
 
 /[^ab]*/i
     CDE
 
-/abc/i
-
-/a*/i
-    
-
 /([abc])*d/i
     ABBBCD
 
     HIJ
 
 /^(ab|cd)e/i
+\= Expect no match
     ABCDE
 
 /(abc|)ef/i
     EFFGZ
     IJ
     REFFGZ
-    *** Failers
+\= Expect no match
     ADCDCDE
     EFFG
     BCDD
     C
 
 /multiple words of text/i
-    *** Failers
+\= Expect no match
     AA
     UH-UH
 
 
 /^(a\1?){4}$/
     aaaaaaaaaa
-    *** Failers
+\= Expect no match
     AB
     aaaaaaaaa
     aaaaaaaaaaa
 
 /^(a(?(1)\1)){4}$/
     aaaaaaaaaa
-    *** Failers
+\= Expect no match
     aaaaaaaaa
     aaaaaaaaaaa
 
 
 /(?<=a)b/
     ab
-    *** Failers
+\= Expect no match
     cb
     b
 
     Ab
 
 /(?:(?i)a)b/
-    *** Failers
+\= Expect no match
     cb
     aB
 
     Ab
 
 /(?i:a)b/
-    *** Failers
+\= Expect no match
     aB
     aB
 
     aB
 
 /(?:(?-i)a)b/i
-    *** Failers
-    aB
-    Ab
-
-/((?-i)a)b/i
-
-/(?:(?-i)a)b/i
-    aB
-
-/((?-i)a)b/i
     aB
-
-/(?:(?-i)a)b/i
-    *** Failers
+\= Expect no match
     Ab
     AB
 
-/((?-i)a)b/i
-
 /(?-i:a)b/i
     ab
 
     aB
 
 /(?-i:a)b/i
-    *** Failers
+\= Expect no match
     AB
     Ab
 
     aB
 
 /(?-i:a)b/i
-    *** Failers
+\= Expect no match
     Ab
     AB
 
 /((?-i:a))b/i
 
 /((?-i:a.))b/i
-    *** Failers
+\= Expect no match
     AB
     a\nB
 
     aaac
 
 /(?<![cd])b/
-    *** Failers
+\= Expect no match
     B\nB
     dbcb
 
     a
     ab
     aaa   
-    *** Failers
+\= Expect no match
     dbcb
     a--
     aa-- 
 /^b/
 
 /()^b/
-    *** Failers
+\= Expect no match
     a\nb\nc\n
     a\nb\nc\n
 
     a\nb\nc\n
 
 /(x)?(?(1)a|b)/
-    *** Failers
+\= Expect no match
     a
     a
 
 /^(\()?blah(?(1)(\)))$/
     (blah)
     blah
-    *** Failers
+\= Expect no match
     a
     blah)
     (blah
 /^(\(+)?blah(?(1)(\)))$/
     (blah)
     blah
-    *** Failers
+\= Expect no match
     blah)
     (blah
 
     a
 
 /(?(?=a)b|a)/
-    *** Failers
+\= Expect no match
     a
     a
 
     aaab
 
 /^(?=(a+?))\1ab/
-    *** Failers
+\= Expect no match
     aaab
     aaab
 
 /([\w:]+::)?(\w+)$/
     abcd
     xy:z:::abcd
-    *** Failers
+\= Expect no match
     abcd:
     abcd:
 
     ((abc(ade)ufh()()x
 
 /a\Z/
-    *** Failers
+\= Expect no match
     aaab
     a\nb\n
 
 
 /b\z/
     a\nb
-    *** Failers
     
 /^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/
     a
     the.quick.brown.fox
     a100.b200.300c  
     12-ab.1245 
-    *** Failers
+\= Expect no match
     \
     .a
     -a
 /(?>.*)(?<=(abcd|wxyz))/
     alphabetabcd
     endingwxyz
-    *** Failers
+\= Expect no match
     a rather long string that doesn't end with one of them
 
 /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/
     word cat dog elephant mussel cow horse canary baboon snake shark otherword
+\= Expect no match
     word cat dog elephant mussel cow horse canary baboon snake shark
   
 /word (?>[a-zA-Z0-9]+ ){0,30}otherword/
+\= Expect no match
     word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
 
 /(?<=\d{3}(?!999))foo/
     999foo
     123999foo 
-    *** Failers
+\= Expect no match
     123abcfoo
     
 /(?<=(?!...999)\d{3})foo/
     999foo
     123999foo 
-    *** Failers
+\= Expect no match
     123abcfoo
 
 /(?<=\d{3}(?!999)...)foo/
     123abcfoo
     123456foo 
-    *** Failers
+\= Expect no match
     123999foo  
     
 /(?<=\d{3}...)(?<!999)foo/
     123abcfoo   
     123456foo 
-    *** Failers
+\= Expect no match
     123999foo  
 
 /<a[\s]+href[\s]*=[\s]*          # find <a href=
     abcde
     -things
     0digit
-    *** Failers
+\= Expect no match
     bcdef    
     
 /[[:space:]]+/
     ab
 
 /(?!\A)x/m
-  a\nxb\n
+    a\nxb\n
 
 /(?!^)x/m
-  a\nxb\n
+\= Expect no match
+    a\nxb\n
 
 /abc\Qabc\Eabc/
     abcabcabc
 
 /   abc\Q abc\Eabc/x
     abc abcabc
-    *** Failers
+\= Expect no match
     abcabcabc  
     
 /abc#comment
 
 /\Gabc/
     abc
-    *** Failers
+\= Expect no match
     xyzabc  
 
 /\Gabc./g
 
 /a(?x: b c )d/
     XabcdY
-    *** Failers 
+\= Expect no match 
     Xa b c d Y 
 
 /((?x)x y z | a b c)/
 
 /(?i)AB(?-i)C/
     XabCY
-    *** Failers
+\= Expect no match
     XabcY  
 
 /((?i)AB(?-i)C|D)E/
     abCE
     DE
-    *** Failers
+\= Expect no match
     abcE
     abCe  
     dE
     a123:ddde:b342::324e:abcd
     a123:ddde:b342::324e:dcba:abcd
     a123:ddde:9999:b342::324e:dcba:abcd
-    *** Failers
+\= Expect no match
     1:2:3:4:5:6:7:8
     a123:bce:ddde:9999:b342::324e:dcba:abcd
     a123::9999:b342::324e:dcba:abcd
     -
     d
     ] 
-    *** Failers
+\= Expect no match
     b     
 
 /(a+)*b/
+\= Expect no match
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
     
 /(?i)reg(?:ul(?:[aä]|ae)r|ex)/
 
 /ab cd(?x) de fg/
     ab cddefg
-    ** Failers 
+\= Expect no match 
     abcddefg
 
 /(?<![^f]oo)(bar)/
     foobarX 
-    ** Failers 
+\= Expect no match 
     boobarX
 
 /(?<![^f])X/
     offX
-    ** Failers
+\= Expect no match
     onyX  
 
 /(?<=[^f])X/
     onyX
-    ** Failers
+\= Expect no match
     offX 
 
 /^/gm
     
 "(?x)(?-x: \s*#\s*)"
     A # B
-    ** Failers
+\= Expect no match
     #  
 
 "(?x-is)(?:(?-ixs) \s*#\s*) include"
     A #include
-    ** Failers
+\= Expect no match
     A#include  
     A #Include
 
     
 /^[\Eabc]/
     a
-    ** Failers 
+\= Expect no match 
     E 
     
 /^[a-\Ec]/
     b
-    ** Failers
+\= Expect no match
     -
     E    
 
 /^[a\E\E-\Ec]/
     b
-    ** Failers
+\= Expect no match
     -
     E    
 
 /^[\E\Qa\E-\Qz\E]+/
     b
-    ** Failers
+\= Expect no match
     -  
     
 /^[a\Q]bc\E]/
     D  
 
 /(a|)*\d/
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
+\= Expect no match
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
 /(?>a|)*\d/
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
+\= Expect no match
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
 /(?:a|)*\d/
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
+\= Expect no match
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
 /\Z/g
   abc\n
   
 /^(?s)(?>.*)(?<!\n)/
   abc
+\= Expect no match
   abc\n  
 
 /^(?![^\n]*\n\z)/
   abc
+\= Expect no match
   abc\n 
   
 /\z(?<!\n)/
   abc
+\= Expect no match
   abc\n  
 
 /(.*(.)?)*/
     p    
 
 /.*[op][xyz]/
+\= Expect no match
     fooabcfoo
 
 /(?(?=.*b)b|^)/
 
 /(?(?=^.*b)b|^)/
    adc
+\= Expect no match
    abc 
 
 /(?(?=.*b)b|^)*/
     XabX
     XAbX
     CcC 
-    ** Failers
+\= Expect no match
     XABX   
 
 /[\x00-\xff\s]+/
     \x0a\x0b\x0c\x0d
 
 /(abc)\1/i
+\= Expect no match
    abc
 
 /(abc)\1/
+\= Expect no match
    abc
 
 /[^a]*/i
     12ABC
 
 /[^a]*?X/i
-    ** Failers
+\= Expect no match
     12abc
     12ABC
     
 /[^a]+?X/i
-    ** Failers
+\= Expect no match
     12abc
     12ABC
 
     aaaabaaabaabab
 
 /(?>a+|ab)+?c/
+\= Expect no match
     aabc
 
 /(?>a+|ab)+c/
+\= Expect no match
     aabc
 
 /(?:a+|ab)+c/
     ab
 
 /^(?:a|ab)++c/
+\= Expect no match
     aaaabc
 
 /^(?>a|ab)++c/
+\= Expect no match
     aaaabc
 
 /^(?:a|ab)+c/
 
 /(?=abc){3}abc/aftertext
     abcabcabc
-    ** Failers
+\= Expect no match
     xyz  
     
 /(?=abc)+abc/aftertext
     abcabcabc
-    ** Failers
+\= Expect no match
     xyz  
     
 /(?=abc)++abc/aftertext
     abcabcabc
-    ** Failers
+\= Expect no match
     xyz  
     
 /(?=abc){0}xyz/
     xyz 
 
 /(?=abc){1}xyz/
-    ** Failers
+\= Expect no match
     xyz 
     
 /(?=(a))?./
 
 /^[\g<a>]+/
     ggg<<<aaa>>>
-    ** Failers
+\= Expect no match
     \\ga  
     
 /^[\ga]+/
      
 /(?<=a{2})b/i
     xaabc
-    ** Failers
+\= Expect no match
     xabc  
 
 /(?<!a{2})b/i
     xabc
-    ** Failers
+\= Expect no match
     xaabc  
 
 /(?<=a\h)c/
 /(?<=[^a]{2})b/
     axxbc
     aAAbc 
-    ** Failers
+\= Expect no match
     xaabc    
 
 /(?<=[^a]{2})b/i
     axxbc  
-    ** Failers
+\= Expect no match
     aAAbc 
     xaabc    
 
 
 /^(a{2,3}){2,}+a/
     aaaaaaa
-    ** Failers
+\= Expect no match
     aaaaaa
     aaaaaaaaa 
 
 /^(a{2,3})++a/
-    ** Failers
+\= Expect no match
     aaaaaa
 
 /^(a{2,3})*+a/
-    ** Failers
+\= Expect no match
     aaaaaa
 
-/ab\Cde/
-    abXde
-    
-/(?<=ab\Cde)X/
-    abZdeX
-
 /\H\h\V\v/
     X X\x0a
     X\x09X\x0b
-    ** Failers
+\= Expect no match
     \xa0 X\x0a   
     
 /\H*\h+\V?\v{3,4}/
     \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a
     \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a
     \x09\x20\xa0\x0a\x0b\x0c
-    ** Failers 
+\= Expect no match 
     \x09\x20\xa0\x0a\x0b
      
 /\H{3,4}/
 /\h*X\h?\H+Y\H?Z/
     >XNNNYZ
     >  X NYQZ
-    ** Failers
+\= Expect no match
     >XYZ   
     >  X NY Z
 
     
 /^abc\K/aftertext
     abcdef
-    ** Failers
+\= Expect no match
     defabcxyz   
 
-/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
+/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-2}Z/
     ababababbbabZXXXX
 
 /(?<A>tom|bon)-\g{A}/
     bon-bon 
     
 /(^(a|b\g{-1}))/
+\= Expect no match
     bacxxx
 
 /(?|(abc)|(xyz))\1/
     abcabc
     xyzxyz 
-    ** Failers
+\= Expect no match
     abcxyz
     xyzabc   
     
 /(?|(abc)|(xyz))(?1)/
     abcabc
     xyzabc 
-    ** Failers 
+\= Expect no match 
     xyzxyz 
  
 /^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/
 /(?'abc'\w+):\k<abc>{2}/
     a:aaxyz
     ab:ababxyz
-    ** Failers
+\= Expect no match
     a:axyz
     ab:abxyz
 
 /(?'abc'\w+):\g{abc}{2}/
     a:aaxyz
     ab:ababxyz
-    ** Failers
+\= Expect no match
     a:axyz
     ab:abxyz
 
     1.2.3.4
     131.111.10.206
     10.0.0.0
-    ** Failers
+\= Expect no match
     10.6
     455.3.4.5
 
     1.2.3.4
     131.111.10.206
     10.0.0.0
-    ** Failers
+\= Expect no match
     10.6
     455.3.4.5
 
 /^(\w++|\s++)*$/
     now is the time for all good men to come to the aid of the party
-    *** Failers
+\= Expect no match
     this is not a line with only words and spaces!
 
 /(\d++)(\w)/
     12345a
-    *** Failers
+\= Expect no match
     12345+
 
 /a++b/
 /\(([^()]++|\([^()]+\))+\)/
     (abc)
     (abc(def)xyz)
-    *** Failers
+\= Expect no match
     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
 /^([^()]|\((?1)*\))*$/
     abc
     a(b)c
     a(b(c))d
-    *** Failers)
+\= Expect no match)
     a(b(c)d
 
 /^>abc>([^()]|\((?1)*\))*<xyz<$/
     Satanoscillatemymetallicsonatas
     AmanaplanacanalPanama
     AblewasIereIsawElba
-    *** Failers
+\= Expect no match
     Thequickbrownfox
 
 /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/
     12
     (((2+2)*-3)-7)
     -12
-    *** Failers
+\= Expect no match
     ((2+2)*-3)-7)
 
 /^(x(y|(?1){2})z)/
     xyz
     xxyzxyzz
-    *** Failers
+\= Expect no match
     xxyzz
     xxyzxyzxyzz
 
     <abc <def> hij>
     <abc<>def>
     <abc<>
-    *** Failers
+\= Expect no match
     <abc
 
 /^a+(*FAIL)/
+\= Expect no match
     aaaaaa
     
 /a+b?c+(*FAIL)/
+\= Expect no match
     aaabccc
 
 /a+b?(*PRUNE)c+(*FAIL)/
+\= Expect no match
     aaabccc
 
 /a+b?(*COMMIT)c+(*FAIL)/
+\= Expect no match
     aaabccc
     
 /a+b?(*SKIP)c+(*FAIL)/
+\= Expect no match
     aaabcccaaabccc
 
 /^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
     dddddddd   
 
 /a+b?(*THEN)c+(*FAIL)/
+\= Expect no match
     aaabccc
 
 /(A (A|B(*ACCEPT)|C) D)(E)/x
     ABX
     AADE
     ACDE
-    ** Failers
+\= Expect no match
     AD 
         
 /^\W*+(?:((.)\W*+(?1)\W*+\2|)|((.)\W*+(?3)\W*+\4|\W*+.\W*+))\W*+$/i
     Satan, oscillate my metallic sonatas!
     A man, a plan, a canal: Panama!
     Able was I ere I saw Elba.
-    *** Failers
+\= Expect no match
     The quick brown fox
 
 /^((.)(?1)\2|.)$/
     abcdcba 
     pqaabaaqp  
     ablewasiereisawelba
+\= Expect no match     
     rhubarb
     the quick brown fox  
 
 /(a)(?<=b(?1))/
     baz
-    ** Failers
+\= Expect no match
     caz  
     
 /(?<=b(?1))(a)/
     zbaaz
-    ** Failers
+\= Expect no match
     aaa  
     
 /(?<X>a)(?<=b(?&X))/
 /^(?|(abc)|(def))\1/
     abcabc
     defdef 
-    ** Failers
+\= Expect no match
     abcdef
     defabc   
     
 /^(?|(abc)|(def))(?1)/
     abcabc
     defabc
-    ** Failers
+\= Expect no match
     defdef
     abcdef    
 
 /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |b(?<quote> (?<apostrophe>')|(?<realquote>")) ) (?('quote')[a-z]+|[0-9]+)/x,dupnames
     a\"aaaaa
     b\"aaaaa 
-    ** Failers 
+\= Expect no match 
     b\"11111
 
 /(?:(?1)|B)(A(*F)|C)/
     ABCD
     CCD
-    ** Failers
+\= Expect no match
     CAD   
 
 /^(?:(?1)|B)(A(*F)|C)/
     CCD
     BCD 
-    ** Failers
+\= Expect no match
     ABCD
     CAD
     BAD    
     BAD
     BCD
     BAX  
-    ** Failers
+\= Expect no match
     ACX
     ABC   
 
     (ab(cd)ef)
 
 /^(?=a(*SKIP)b|ac)/
-    ** Failers
+\= Expect no match
     ac
     
 /^(?=a(*PRUNE)b)/
     ab  
-    ** Failers 
+\= Expect no match 
     ac
 
 /^(?=a(*ACCEPT)b)/
 # I think is a Perl bug.
 
 /A(*COMMIT)(B|D)/
+\= Expect no match
     ACABX
 
 # Check the use of names for failure
 
 /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/mark
-    ** Failers
+\= Expect no match
     AC
     CB    
     
 /(*MARK:A)(*SKIP:B)(C|X)/mark
     C
+\= Expect no match
     D
      
 /^(A(*THEN:A)B|C(*THEN:B)D)/mark
-    ** Failers
+\= Expect no match
     CB    
 
 /^(?:A(*THEN:A)B|C(*THEN:B)D)/mark
+\= Expect no match
     CB    
     
 /^(?>A(*THEN:A)B|C(*THEN:B)D)/mark
+\= Expect no match
     CB    
     
 # This should succeed, as the skip causes bump to offset 1 (the mark). Note
     AAAC
 
 /(*:A)A+(*SKIP:A)(B|Z)/mark
+\= Expect no match
     AAAC
 
 # This should succeed, as a non-existent skip name disables the skip.
 
 /(*COMMIT)(A|P)(B|P)(C|P)/
     ABCDEFG
-    ** Failers
+\= Expect no match
     DEFGABC  
 
 # COMMIT inside an atomic group can't stop backtracking over the group.
     abbb
 
 /(\w+)b(*COMMIT)\w{2}/
+\= Expect no match
     abbb
 
 # Check opening parens in comment when seeking forward reference.
 # COMMIT should override THEN.
 
 /(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/
+\= Expect no match
   yes
 
 /(?>(*COMMIT)(yes|no)(*THEN)(*F))?/
+\= Expect no match
   yes
 
 /b?(*SKIP)c/
     abc
    
 /(*SKIP)bc/
+\= Expect no match
     a
 
 /(*SKIP)b/
+\= Expect no match
     a 
 
 /(?P<abn>(?P=abn)xxx|)+/
 /(?i:([^b]))(?1)/
     aa
     aA     
-    ** Failers
+\= Expect no match
     ab
     aB
     Ba
 
 /^(?&t)*+(?(DEFINE)(?<t>a))\w$/
     aaaaaaX
-    ** Failers 
+\= Expect no match 
     aaaaaa 
 
 /^(?&t)*(?(DEFINE)(?<t>a))\w$/
 /^(a)*+(\w)/
     aaaaX
     YZ 
-    ** Failers 
+\= Expect no match 
     aaaa
 
 /^(?:a)*+(\w)/
     aaaaX
     YZ 
-    ** Failers 
+\= Expect no match 
     aaaa
 
 /^(a)++(\w)/
     aaaaX
-    ** Failers 
+\= Expect no match 
     aaaa
     YZ 
 
 /^(?:a)++(\w)/
     aaaaX
-    ** Failers 
+\= Expect no match 
     aaaa
     YZ 
 
 
 /^(a){2,}+(\w)/
     aaaaX
-    ** Failers
+\= Expect no match
     aaa
     YZ 
 
 /^(?:a){2,}+(\w)/
     aaaaX
-    ** Failers
+\= Expect no match
     aaa
     YZ 
 
     aab  
 
 /(a)++(?1)b/
-    ** Failers
+\= Expect no match
     ab 
     aab
 
 /(a)*+(?1)b/
-    ** Failers
+\= Expect no match
     ab
     aab  
 
     aaaab
     
 /^(a)(?1)++ab/
+\= Expect no match
     aaaab
 
 /^(?=a(*:M))aZ/mark
@@ -4933,6 +4935,7 @@ name)/mark
 # Capture
 
 /^.*? (a(*THEN)b) c/x
+\= Expect no match
     aabc
 
 /^.*? (a(*THEN)b|(*F)) c/x
@@ -4942,11 +4945,13 @@ name)/mark
     aabc
 
 /^.*? ( (a(*THEN)b) ) c/x
+\= Expect no match
     aabc
 
 # Non-capture
 
 /^.*? (?:a(*THEN)b) c/x
+\= Expect no match
     aabc
 
 /^.*? (?:a(*THEN)b|(*F)) c/x
@@ -4956,11 +4961,13 @@ name)/mark
     aabc
 
 /^.*? (?: (?:a(*THEN)b) ) c/x
+\= Expect no match
     aabc
 
 # Atomic
 
 /^.*? (?>a(*THEN)b) c/x
+\= Expect no match
     aabc
 
 /^.*? (?>a(*THEN)b|(*F)) c/x
@@ -4970,11 +4977,13 @@ name)/mark
     aabc
 
 /^.*? (?> (?>a(*THEN)b) ) c/x
+\= Expect no match
     aabc
 
 # Possessive capture
 
 /^.*? (a(*THEN)b)++ c/x
+\= Expect no match
     aabc
 
 /^.*? (a(*THEN)b|(*F))++ c/x
@@ -4984,11 +4993,13 @@ name)/mark
     aabc
 
 /^.*? ( (a(*THEN)b)++ )++ c/x
+\= Expect no match
     aabc
 
 # Possessive non-capture
 
 /^.*? (?:a(*THEN)b)++ c/x
+\= Expect no match
     aabc
 
 /^.*? (?:a(*THEN)b|(*F))++ c/x
@@ -4998,6 +5009,7 @@ name)/mark
     aabc
 
 /^.*? (?: (?:a(*THEN)b)++ )++ c/x
+\= Expect no match
     aabc
     
 # Condition assertion
@@ -5008,12 +5020,14 @@ name)/mark
 # Condition
 
 /^.*?(?(?=a)a|b(*THEN)c)/
+\= Expect no match
     ba
 
 /^.*?(?:(?(?=a)a|b(*THEN)c)|d)/
     ba
 
 /^.*?(?(?=a)a(*THEN)b|c)/
+\= Expect no match
     ac
 
 # Assertion
@@ -5037,7 +5051,7 @@ name)/mark
 
 /(?<=(a(*COMMIT)b))c/
     xabcd
-    ** Failers 
+\= Expect no match 
     xacd
     
 /(?<!a(*FAIL)b)c/
@@ -5061,40 +5075,49 @@ name)/mark
 
 /(*MARK:A)(*PRUNE:B)(C|X)/mark
     C
+\= Expect no match
     D 
 
 /(*MARK:A)(*PRUNE:B)(C|X)/mark
     C
+\= Expect no match
     D 
 
 /(*MARK:A)(*THEN:B)(C|X)/mark
     C
+\= Expect no match
     D 
 
 /(*MARK:A)(*THEN:B)(C|X)/mark,no_start_optimize
     C
+\= Expect no match
     D 
 
 /(*MARK:A)(*THEN:B)(C|X)/mark
     C
+\= Expect no match
     D 
 
 # This should fail, as the skip causes a bump to offset 3 (the skip).
 
 /A(*MARK:A)A+(*SKIP)(B|Z) | AC/x,mark
+\= Expect no match
     AAAC
 
 # Same 
 
 /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/x,mark
+\= Expect no match
     AAAC
 
 /A(*:A)A+(*SKIP)(B|Z) | AC/x,mark
+\= Expect no match
     AAAC
 
 # This should fail, as a null name is the same as no name.
 
 /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/x,mark
+\= Expect no match
     AAAC
 
 # A check on what happens after hitting a mark and them bumping along to
@@ -5105,7 +5128,7 @@ name)/mark
 /A(*:A)B|XX(*:B)Y/mark
     AABC
     XXYZ 
-    ** Failers
+\= Expect no match
     XAQQ  
     XAQQXZZ  
     AXQQQ 
@@ -5114,14 +5137,14 @@ name)/mark
 /^(A(*THEN:A)B|C(*THEN:B)D)/mark
     AB
     CD
-    ** Failers
+\= Expect no match
     AC
     CB    
     
 /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/mark
     AB
     CD
-    ** Failers
+\= Expect no match
     AC
     CB    
     
@@ -5145,12 +5168,12 @@ name)/mark
     
 /b(*:m)f|a(*:n)w/mark
     aw 
-    ** Failers 
+\= Expect no match 
     abc
 
 /b(*:m)f|aw/mark
     abaw
-    ** Failers 
+\= Expect no match 
     abc
     abax 
 
@@ -5158,47 +5181,48 @@ name)/mark
     AAAC
 
 /a(*PRUNE:X)bc|qq/mark,no_start_optimize
-    ** Failers
+\= Expect no match
     axy
 
 /a(*THEN:X)bc|qq/mark,no_start_optimize
-    ** Failers
+\= Expect no match
     axy
 
 /(?=a(*MARK:A)b)..x/mark
     abxy
-    ** Failers
+\= Expect no match
     abpq  
 
 /(?=a(*MARK:A)b)..(*:Y)x/mark
     abxy
-    ** Failers
+\= Expect no match
     abpq  
 
 /(?=a(*PRUNE:A)b)..x/mark
     abxy
-    ** Failers
+\= Expect no match
     abpq  
 
 /(?=a(*PRUNE:A)b)..(*:Y)x/mark
     abxy
-    ** Failers
+\= Expect no match
     abpq  
 
 /(?=a(*THEN:A)b)..x/mark
     abxy
-    ** Failers
+\= Expect no match
     abpq  
 
 /(?=a(*THEN:A)b)..(*:Y)x/mark
     abxy
-    ** Failers
+\= Expect no match
     abpq  
 
 /(another)?(\1?)test/
     hello world test
 
 /(another)?(\1+)test/
+\= Expect no match
     hello world test
 
 /(a(*COMMIT)b){0}a(?1)|aac/
@@ -5216,18 +5240,6 @@ name)/mark
 /(?:.*?a)(?<=ba)/
     aba
 
-/.*?a(*PRUNE)b/
-    aab
-
-/.*?a(*PRUNE)b/s
-    aab
-
-/^a(*PRUNE)b/s
-    aab
-
-/.*?a(*SKIP)b/
-    aab
-
 /(?>.*?a)b/s
     aab
 
@@ -5235,6 +5247,7 @@ name)/mark
     aab
 
 /(?>^a)b/s
+\= Expect no match
     aab
 
 /(?>.*?)(?<=(abcd)|(wxyz))/
@@ -5246,6 +5259,7 @@ name)/mark
     endingwxyz 
 
 "(?>.*)foo"
+\= Expect no match
     abcdfooxyz
     
 "(?>.*?)foo"
@@ -5258,6 +5272,7 @@ name)/mark
     ac 
 
 /(?<=(*SKIP)ac)a/
+\= Expect no match
     aa
 
 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/x,mark
@@ -5331,6 +5346,7 @@ name)/mark
 # This gives "no match", as expected. 
 
 /aaaaa(*COMMIT)b|a+c/
+\= Expect no match
     aaaaaac
 
 # ---- Tests using THEN ----
@@ -5389,6 +5405,7 @@ name)/mark
 
 /(a(*COMMIT)b)c|abd/
     abc
+\= Expect no match
     abd
 
 /(?=a(*COMMIT)b)abc|abd/
@@ -5400,14 +5417,16 @@ name)/mark
     abd
 
 /a(?=b(*COMMIT)c)[^d]|abd/
+    abc
+\= Expect no match
     abd
-    abc 
 
 /a(?=bc).|abd/
     abd
     abc 
     
 /a(?>b(*COMMIT)c)d|abd/
+\= Expect no match
     abceabd 
 
 /a(?>bc)d|abd/
@@ -5417,6 +5436,7 @@ name)/mark
     abd
 
 /(?>a(*COMMIT)c)d|abd/
+\= Expect no match
     abd
 
 /((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/
@@ -5426,7 +5446,7 @@ name)/mark
 # made them compatible. 
     
 /^(a)?(?(1)a|b)+$/
-    *** Failers
+\= Expect no match
     a
 
 /(?=a\Kb)ab/
@@ -5441,58 +5461,73 @@ name)/mark
 /^abc(?<!b\Kq)d/
     abcd
 
-
 /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/x,mark
+\= Expect no match
     AAAC
 
 /^((abc|abcx)(*THEN)y|abcd)/
     abcd
-    *** Failers 
+\= Expect no match 
     abcxy 
     
 /^((yes|no)(*THEN)(*F))?/
+\= Expect no match
     yes
 
 /(A (.*)   C? (*THEN)  | A D) (*FAIL)/x
+\= Expect no match
     AbcdCBefgBhiBqz
 
 /(A (.*)   C? (*THEN)  | A D) z/x
+\= Expect no match
     AbcdCBefgBhiBqz
 
 /(A (.*)   C? (*THEN)  | A D) \s* (*FAIL)/x
+\= Expect no match
     AbcdCBefgBhiBqz
 
 /(A (.*)   C? (*THEN)  | A D) \s* z/x
+\= Expect no match
     AbcdCBefgBhiBqz
 
 /(A (.*)   (?:C|) (*THEN)  | A D) (*FAIL)/x
+\= Expect no match
     AbcdCBefgBhiBqz
 
 /(A (.*)   (?:C|) (*THEN)  | A D) z/x
+\= Expect no match
     AbcdCBefgBhiBqz
 
 /(A (.*)   C{0,6} (*THEN)  | A D) (*FAIL)/x
+\= Expect no match
     AbcdCBefgBhiBqz
 
 /(A (.*)   C{0,6} (*THEN)  | A D) z/x
+\= Expect no match
     AbcdCBefgBhiBqz
 
 /(A (.*)   (CE){0,6} (*THEN)  | A D) (*FAIL)/x
+\= Expect no match
     AbcdCEBefgBhiBqz
 
 /(A (.*)   (CE){0,6} (*THEN)  | A D) z/x
+\= Expect no match
     AbcdCEBefgBhiBqz
 
 /(A (.*)   (CE*){0,6} (*THEN)  | A D) (*FAIL)/x
+\= Expect no match
     AbcdCBefgBhiBqz
 
 /(A (.*)   (CE*){0,6} (*THEN)  | A D) z/x
+\= Expect no match
     AbcdCBefgBhiBqz
 
 /(?=a(*COMMIT)b|ac)ac|ac/
+\= Expect no match
     ac
 
 /(?=a(*COMMIT)b|(ac)) ac | (a)c/x
+\= Expect no match
     ac
 
 # ----
@@ -5519,6 +5554,7 @@ name)/mark
    bnn 
 
 /(?=b(*SKIP)a)bn|bnn/
+\= Expect no match
     bnn
 
 /(?=b(*THEN)a)bn|bnn/
@@ -5565,22 +5601,27 @@ name)/mark
 
 /^\d*\w{4}/
     1234
+\= Expect no match
     123 
 
 /^[^b]*\w{4}/
     aaaa
+\= Expect no match
     aaa     
 
 /^[^b]*\w{4}/i
     aaaa
+\= Expect no match
     aaa     
 
 /^a*\w{4}/
     aaaa
+\= Expect no match
     aaa     
 
 /^a*\w{4}/i
     aaaa
+\= Expect no match
     aaa     
 
 /(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames
@@ -5590,7 +5631,7 @@ name)/mark
 /(?<n>A)(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames
     AfooA
     AbarA  
-    ** Failers 
+\= Expect no match 
     Afoofoo
     Abarbar
 
@@ -5641,6 +5682,7 @@ name)/mark
     ababc
 
 /(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc/
+\= Expect no match
     acb
 
 '\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
@@ -5671,6 +5713,7 @@ name)/mark
     bbbaaabaabb
 
 /(?:(?P=same)?(?:(?P=same)(?P<same>a)(?P=same)|(?P=same)?(?P<same>b)(?P=same)){2}(?P=same)(?P<same>c)(?P=same)){2}(?P<same>z)?/g,dupnames
+\= Expect no match
     bbbaaaccccaaabbbcc
 
 /(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l/
@@ -5727,4 +5770,26 @@ name)/mark
 "(?|(\k'Pm')|(?'Pm'))"
     abcd
 
+/(?|(aaa)|(b))\g{1}/
+    aaaaaa
+    bb 
+
+/(?|(aaa)|(b))(?1)/
+    aaaaaa
+    baaa 
+\= Expect no match 
+    bb 
+
+/(?|(aaa)|(b))/
+    xaaa
+    xbc 
+
+/(?|(?'a'aaa)|(?'a'b))\k'a'/
+    aaaaaa
+    bb 
+
+/(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/dupnames
+    aaaccccaaa
+    bccccb 
+
 # End of testinput1 
index a1fdd928adda6f789ad67309bb592ca3dc5d8a48..550e1c9f341ce9853ac0b7d06386f59c9ea0b707 100644 (file)
@@ -1,45 +1,7 @@
 # This set of tests is for UTF-8 support and Unicode property support, with
 # relevance only for the 8-bit library.
 
-/X(\C{3})/utf
-    X\x{1234}
-
-/X(\C{4})/utf
-    X\x{1234}YZ
-
-/X\C*/utf
-    XYZabcdce
-
-/X\C*?/utf
-    XYZabcde
-
-/X\C{3,5}/utf
-    Xabcdefg
-    X\x{1234}
-    X\x{1234}YZ
-    X\x{1234}\x{512}
-    X\x{1234}\x{512}YZ
-
-/X\C{3,5}?/utf
-    Xabcdefg
-    X\x{1234}
-    X\x{1234}YZ
-    X\x{1234}\x{512}
-
-/a\Cb/utf
-    aXb
-    a\nb
-
-/a\C\Cb/utf
-    a\x{100}b
-
-/ab\Cde/utf
-    abXde
-
-/a\C\Cb/utf
-    a\x{100}b
-    ** Failers
-    a\x{12257}b
+# The next 4 patterns have UTF-8 errors
 
 /[Ã]/utf
 
@@ -47,7 +9,12 @@
 
 /ÃÃÃxxx/utf
 
+/Ã\82\82\82\82\82\82\82\82Ã/utf
+
+# Now test subjects
+
 /badutf/utf
+\= Expect UTF-8 errors
     X\xdf
     XX\xef
     XXX\xef\x80
     \xff
 
 /badutf/utf
+\= Expect UTF-8 errors
     XX\xfb\x80\x80\x80\x80
     XX\xfd\x80\x80\x80\x80\x80
     XX\xf7\xbf\xbf\xbf
 
 /shortutf/utf
+\= Expect UTF-8 errors
     XX\xdf\=ph
     XX\xef\=ph
     XX\xef\x80\=ph
     \xfd\x80\x80\x80\x80\=ph
 
 /anything/utf
+\= Expect UTF-8 errors
     X\xc0\x80
     XX\xc1\x8f
     XXX\xe0\x9f\x80
     \xfc\x83\x80\x80\x80\x80
     \xfe\x80\x80\x80\x80\x80
     \xff\x80\x80\x80\x80\x80
+    \xf8\x88\x80\x80\x80
+    \xf9\x87\x80\x80\x80
+    \xfc\x84\x80\x80\x80\x80
+    \xfd\x83\x80\x80\x80\x80
+\= Expect no match
     \xc3\x8f
     \xe0\xaf\x80
     \xe1\x80\x80
     \xf0\x9f\x80\x80
     \xf1\x8f\x80\x80
-    \xf8\x88\x80\x80\x80
-    \xf9\x87\x80\x80\x80
-    \xfc\x84\x80\x80\x80\x80
-    \xfd\x83\x80\x80\x80\x80
     \xf8\x88\x80\x80\x80\=no_utf_check
     \xf9\x87\x80\x80\x80\=no_utf_check
     \xfc\x84\x80\x80\x80\x80\=no_utf_check
     \xfd\x83\x80\x80\x80\x80\=no_utf_check
+    
+# Similar tests with offsets
 
+/badutf/utf
+\= Expect UTF-8 errors
+    X\xdfabcd
+    X\xdfabcd\=offset=1
+\= Expect no match
+    X\xdfabcd\=offset=2
+
+/(?<=x)badutf/utf
+\= Expect UTF-8 errors
+    X\xdfabcd
+    X\xdfabcd\=offset=1
+    X\xdfabcd\=offset=2
+    X\xdfabcd\xdf\=offset=3
+\= Expect no match
+    X\xdfabcd\=offset=3
+
+/(?<=xx)badutf/utf
+\= Expect UTF-8 errors
+    X\xdfabcd
+    X\xdfabcd\=offset=1
+    X\xdfabcd\=offset=2
+    X\xdfabcd\=offset=3
+
+/(?<=xxxx)badutf/utf
+\= Expect UTF-8 errors
+    X\xdfabcd
+    X\xdfabcd\=offset=1
+    X\xdfabcd\=offset=2
+    X\xdfabcd\=offset=3
+    X\xdfabc\xdf\=offset=6
+    X\xdfabc\xdf\=offset=7
+\= Expect no match
+    X\xdfabcd\=offset=6
 /\x{100}/IB,utf
 
 /\x{1000}/IB,utf
 
 /\x{212ab}/IB,utf
 
-# This one is here not because it's different to Perl, but because the way
-# the captured single-byte is displayed. (In Perl it becomes a character, and you
-# can't tell the difference.)
-
-/X(\C)(.*)/utf
-    X\x{1234}
-    X\nabc
-
-# This one is here because Perl gives out a grumbly error message (quite
-# correctly, but that messes up comparisons).
-
-/a\Cb/utf
-    *** Failers
-    a\x{100}b
-
 /[^ab\xC0-\xF0]/IB,utf
     \x{f1}
     \x{bf}
     \x{100}
     \x{1000}
-    *** Failers
+\= Expect no match
     \x{c0}
     \x{f0}
 
     \x{100}
     Z\x{100}
     \x{100}Z
-    *** Failers
 
 /[\xff]/IB,utf
     >\x{ff}<
 # This tests the stricter UTF-8 check according to RFC 3629.
 
 /X/utf
+\= Expect UTF-8 errors
     \x{d800}
-    \x{d800}\=no_utf_check
     \x{da00}
-    \x{da00}\=no_utf_check
     \x{dfff}
-    \x{dfff}\=no_utf_check
     \x{110000}
-    \x{110000}\=no_utf_check
     \x{2000000}
-    \x{2000000}\=no_utf_check
     \x{7fffffff}
+\= Expect no match
+    \x{d800}\=no_utf_check
+    \x{da00}\=no_utf_check
+    \x{dfff}\=no_utf_check
+    \x{110000}\=no_utf_check
+    \x{2000000}\=no_utf_check
     \x{7fffffff}\=no_utf_check
 
 /(*UTF8)\x{1234}/
-  abcd\x{1234}pqr
+    abcd\x{1234}pqr
 
 /(*CRLF)(*UTF)(*BSR_UNICODE)a\Rb/I
 
 
 /a+/utf
     a\x{123}aa\=offset=1
-    a\x{123}aa\=offset=2
     a\x{123}aa\=offset=3
     a\x{123}aa\=offset=4
-    a\x{123}aa\=offset=5
+\= Expect bad offset value
     a\x{123}aa\=offset=6
+\= Expect bad UTF-8 offset     
+    a\x{123}aa\=offset=2
+\= Expect no match
+    a\x{123}aa\=offset=5
 
 /\x{1234}+/Ii,utf
 
     Z\x{100}
     \x{100}
     \x{100}Z
-    *** Failers 
 
 /[z-\x{100}]/IB,utf
 
     \x{104}
     \x{105}
     \x{109}  
-    ** Failers
+\= Expect no match
     \x{100}
     \x{10a} 
     
     \x{ff}
     \x{100}
     \x{101} 
-    ** Failers
+\= Expect no match
     \x{102}
     Y
     y           
 /\x{3a3}B/IBi,utf
 
 /abc/utf,replace=Ã
-   abc
+    abc
+
+/(?<=(a)(?-1))x/I,utf
+    a\x80zx\=offset=3
 
 # End of testinput10
index 43d89e10e57760ddc01cf1237829f86db496adb7..2bdef9be15df86df1670379c46c89fde9b9aa7ed 100644 (file)
@@ -4,11 +4,8 @@
 # different, so they have separate output files.
     
 #forbid_utf
+#newline_default LF ANY ANYCRLF
 
-/a\Cb/
-    aXb
-    a\nb
-  
 /[^\x{c4}]/IB
   
 /\x{100}/I
 
 # Non-UTF characters 
 
-/\C{2,3}/
+/.{2,3}/
     \x{400000}\x{400001}\x{400002}\x{400003}
 
 /\x{400000}\x{800000}/IBi
 
 /[\V]/IB
 
+/(*THEN:\[A]{65501})/expand
+
 # End of testinput11
index 1cba4af6ea52c047b3256e67898ddebea5ee1e78..14a7715151ae3ae15ca54f896f6ab65ae5cb143a 100644 (file)
@@ -7,49 +7,6 @@
 /abc/utf
     Ã]
 
-/X(\C{3})/utf
-    X\x{11234}Y
-    X\x{11234}YZ
-
-/X(\C{4})/utf
-    X\x{11234}YZ
-    X\x{11234}YZW
-
-/X\C*/utf
-    XYZabcdce
-
-/X\C*?/utf
-    XYZabcde
-
-/X\C{3,5}/utf
-    Xabcdefg
-    X\x{11234}Y
-    X\x{11234}YZ
-    X\x{11234}\x{512}
-    X\x{11234}\x{512}YZ
-    X\x{11234}\x{512}\x{11234}Z
-
-/X\C{3,5}?/utf
-    Xabcdefg
-    X\x{11234}Y
-    X\x{11234}YZ
-    X\x{11234}\x{512}YZ
-    *** Failers
-    X\x{11234}
-
-/a\Cb/utf
-    aXb
-    a\nb
-
-/a\C\Cb/utf
-    a\x{12257}b
-    a\x{12257}\x{11234}b
-    ** Failers
-    a\x{100}b
-
-/ab\Cde/utf
-    abXde
-
 # Check maximum character size 
 
 /\x{ffff}/IB,utf
 
 /\x{212ab}/IB,utf
 
-# This one is here not because it's different to Perl, but because the way
-# the captured single-byte is displayed. (In Perl it becomes a character, and you
-# can't tell the difference.) 
-
-/X(\C)(.*)/utf
-    X\x{1234}
-    X\nabc
-
-# This one is here because Perl gives out a grumbly error message (quite
-# correctly, but that messes up comparisons). 
-
-/a\Cb/utf
-    *** Failers
-    a\x{100}b
-
 /[^ab\xC0-\xF0]/IB,utf
     \x{f1}
     \x{bf}
     \x{100}
     \x{1000}
-    *** Failers
+\= Expect no match
     \x{c0}
     \x{f0}
 
     \x{100}
     Z\x{100}
     \x{100}Z
-    *** Failers
 
 /[\xff]/IB,utf
     >\x{ff}<
 /^[\QĀ\E-\QŐ\E/B,utf
 
 /X/utf
-    XX\x{d800}
     XX\x{d800}\=no_utf_check
-    XX\x{da00}
     XX\x{da00}\=no_utf_check
-    XX\x{dc00}
     XX\x{dc00}\=no_utf_check
-    XX\x{de00}
     XX\x{de00}\=no_utf_check
-    XX\x{dfff}
     XX\x{dfff}\=no_utf_check
+\= Expect UTF error
+    XX\x{d800}
+    XX\x{da00}
+    XX\x{dc00}
+    XX\x{de00}
+    XX\x{dfff}
     XX\x{110000}
     XX\x{d800}\x{1234}
+\= Expect no match
+    XX\x{d800}\=offset=3
+    
+/(?<=.)X/utf
+    XX\x{d800}\=offset=3
 
 /(*UTF16)\x{11234}/
   abcd\x{11234}pqr
     a\x{123}aa\=offset=1
     a\x{123}aa\=offset=2
     a\x{123}aa\=offset=3
+\= Expect no match
     a\x{123}aa\=offset=4
+\= Expect bad offset error     
     a\x{123}aa\=offset=5
     a\x{123}aa\=offset=6
 
 # Check bad offset 
 
 /a/utf
+\= Expect bad UTF-16 offset, or no match in 32-bit
     \x{10000}\=offset=1
     \x{10000}ab\=offset=1
+\= Expect 16-bit match, 32-bit no match
     \x{10000}ab\=offset=2
+\= Expect no match     
     \x{10000}ab\=offset=3
+\= Expect no match in 16-bit, bad offset in 32-bit    
     \x{10000}ab\=offset=4
+\= Expect bad offset     
     \x{10000}ab\=offset=5
 
 //utf
 
 /\o{4200000}/utf
 
-/\C/utf
-    \x{110000}
-
 /\x{100}*A/IB,utf
     A
 
     Z\x{100}
     \x{100}
     \x{100}Z
-    *** Failers 
 
 /[z-\x{100}]/IB,utf
 
     \x{104}
     \x{105}
     \x{109}  
-    ** Failers
+\= Expect no match
     \x{100}
     \x{10a} 
     
     \x{ff}
     \x{100}
     \x{101} 
-    ** Failers
+\= Expect no match
     \x{102}
     Y
     y           
 
 /\x{3a3}B/IBi,utf
 
+/./utf
+    \x{110000}
+
 # End of testinput12
index 69ca2b6a834f7330a09ae489ffe8455735203947..f97f3ec2c7868f7c0dd2c1685e64e8c8cf15dd83 100644 (file)
-# These are:
-#
-# (1) Tests of the match-limiting features. The results are different for
-# interpretive or JIT matching, so this test should not be run with JIT. The
-# same tests are run using JIT in test 16.
-
-# (2) Other tests that must not be run with JIT.
-
-/(a+)*zz/I
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
-  aaaaaaaaaaaaaz\=find_limits
-
-!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
-   /* this is a C style comment */\=find_limits
-
-/^(?>a)++/
-    aa\=find_limits
-    aaaaaaaaa\=find_limits
-    
-/(a)(?1)++/
-    aa\=find_limits
-    aaaaaaaaa\=find_limits
-
-/a(?:.)*?a/ims
-    abbbbbbbbbbbbbbbbbbbbba\=find_limits
-    
-/a(?:.(*THEN))*?a/ims
-    abbbbbbbbbbbbbbbbbbbbba\=find_limits
-
-/a(?:.(*THEN:ABC))*?a/ims
-    abbbbbbbbbbbbbbbbbbbbba\=find_limits
-
-/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
-     aabbccddee\=find_limits
-
-/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
-     aabbccddee\=find_limits
-
-/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
-     aabbccddee\=find_limits
-
-/(*LIMIT_MATCH=12bc)abc/
-
-/(*LIMIT_MATCH=4294967290)abc/
-
-/(*LIMIT_RECURSION=4294967280)abc/I
-
-/(a+)*zz/
-    aaaaaaaaaaaaaz
-    aaaaaaaaaaaaaz\=match_limit=3000
-
-/(a+)*zz/
-    aaaaaaaaaaaaaz\=recursion_limit=10
-
-/(*LIMIT_MATCH=3000)(a+)*zz/I
-    aaaaaaaaaaaaaz
-    aaaaaaaaaaaaaz\=match_limit=60000
-
-/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
-    aaaaaaaaaaaaaz
-
-/(*LIMIT_MATCH=60000)(a+)*zz/I
-    aaaaaaaaaaaaaz
-    aaaaaaaaaaaaaz\=match_limit=3000
-
-/(*LIMIT_RECURSION=10)(a+)*zz/I
-    aaaaaaaaaaaaaz
-    aaaaaaaaaaaaaz\=recursion_limit=1000
-
-/(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/I
-    aaaaaaaaaaaaaz
-
-/(*LIMIT_RECURSION=1000)(a+)*zz/I
-    aaaaaaaaaaaaaz
-    aaaaaaaaaaaaaz\=recursion_limit=10
-    
-# These three have infinitely nested recursions. 
-    
-/((?2))((?1))/
-    abc
-
-/((?(R2)a+|(?1)b))/
-    aaaabcde
-
-/(?(R)a*(?1)|((?R))b)/
-    aaaabcde
-    
-# The allusedtext modifier does not work with JIT, which does not maintain
-# the leftchar/rightchar data.
-
-/abc(?=xyz)/allusedtext
-    abcxyzpqr
-    abcxyzpqr\=aftertext
-    
-/(?<=pqr)abc(?=xyz)/allusedtext
-    xyzpqrabcxyzpqr
-    xyzpqrabcxyzpqr\=aftertext
-    
-/a\b/
-    a.\=allusedtext
-    a\=allusedtext  
-
-/abc\Kxyz/
-    abcxyz\=allusedtext
-
-/abc(?=xyz(*ACCEPT))/
-    abcxyz\=allusedtext
-
-/abc(?=abcde)(?=ab)/allusedtext
-    abcabcdefg
+# These test special (mostly error) UTF features of DFA matching. They are a 
+# selection of the more comprehensive tests that are run for non-DFA matching.
+# The output is different for the different widths.
+
+#subject dfa
+
+/X/utf
+    XX\x{d800}
+    XX\x{d800}\=offset=3
+    XX\x{d800}\=no_utf_check
+    XX\x{da00}
+    XX\x{da00}\=no_utf_check
+    XX\x{dc00}
+    XX\x{dc00}\=no_utf_check
+    XX\x{de00}
+    XX\x{de00}\=no_utf_check
+    XX\x{dfff}
+    XX\x{dfff}\=no_utf_check
+    XX\x{110000}
+    XX\x{d800}\x{1234}
+          
+/badutf/utf
+    X\xdf
+    XX\xef
+    XXX\xef\x80
+    X\xf7
+    XX\xf7\x80
+    XXX\xf7\x80\x80
+
+/shortutf/utf
+    XX\xdf\=ph
+    XX\xef\=ph
+    XX\xef\x80\=ph
+    \xf7\=ph
+    \xf7\x80\=ph
 
 # End of testinput14
index d23b127256950d72de137d3a45dca697201d53dd..4ea9ffdc5de18fbbf7fb94cd88cb24ccf0168577 100644 (file)
@@ -1,9 +1,163 @@
-# This test is run only when JIT support is not available. It checks that an
-# attempt to use it has the expected behaviour. It also tests things that
-# are different without JIT.
+# These are:
+#
+# (1) Tests of the match-limiting features. The results are different for
+# interpretive or JIT matching, so this test should not be run with JIT. The
+# same tests are run using JIT in test 17.
 
-/abc/I,jit,jitverify
+# (2) Other tests that must not be run with JIT.
 
-/a*/I
+/(a+)*zz/I
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
+  aaaaaaaaaaaaaz\=find_limits
+
+!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
+   /* this is a C style comment */\=find_limits
+
+/^(?>a)++/
+    aa\=find_limits
+    aaaaaaaaa\=find_limits
+    
+/(a)(?1)++/
+    aa\=find_limits
+    aaaaaaaaa\=find_limits
+
+/a(?:.)*?a/ims
+    abbbbbbbbbbbbbbbbbbbbba\=find_limits
+    
+/a(?:.(*THEN))*?a/ims
+    abbbbbbbbbbbbbbbbbbbbba\=find_limits
+
+/a(?:.(*THEN:ABC))*?a/ims
+    abbbbbbbbbbbbbbbbbbbbba\=find_limits
+
+/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
+     aabbccddee\=find_limits
+
+/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
+     aabbccddee\=find_limits
+
+/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
+     aabbccddee\=find_limits
+
+/(*LIMIT_MATCH=12bc)abc/
+
+/(*LIMIT_MATCH=4294967290)abc/
+
+/(*LIMIT_RECURSION=4294967280)abc/I
+
+/(a+)*zz/
+    aaaaaaaaaaaaaz
+    aaaaaaaaaaaaaz\=match_limit=3000
+
+/(a+)*zz/
+    aaaaaaaaaaaaaz\=recursion_limit=10
+
+/(*LIMIT_MATCH=3000)(a+)*zz/I
+    aaaaaaaaaaaaaz
+    aaaaaaaaaaaaaz\=match_limit=60000
+
+/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
+    aaaaaaaaaaaaaz
+
+/(*LIMIT_MATCH=60000)(a+)*zz/I
+    aaaaaaaaaaaaaz
+    aaaaaaaaaaaaaz\=match_limit=3000
+
+/(*LIMIT_RECURSION=10)(a+)*zz/I
+    aaaaaaaaaaaaaz
+    aaaaaaaaaaaaaz\=recursion_limit=1000
+
+/(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/I
+    aaaaaaaaaaaaaz
+
+/(*LIMIT_RECURSION=1000)(a+)*zz/I
+    aaaaaaaaaaaaaz
+    aaaaaaaaaaaaaz\=recursion_limit=10
+    
+# These three have infinitely nested recursions. 
+    
+/((?2))((?1))/
+    abc
+
+/((?(R2)a+|(?1)b))/
+    aaaabcde
+
+/(?(R)a*(?1)|((?R))b)/
+    aaaabcde
+    
+# The allusedtext modifier does not work with JIT, which does not maintain
+# the leftchar/rightchar data.
+
+/abc(?=xyz)/allusedtext
+    abcxyzpqr
+    abcxyzpqr\=aftertext
+    
+/(?<=pqr)abc(?=xyz)/allusedtext
+    xyzpqrabcxyzpqr
+    xyzpqrabcxyzpqr\=aftertext
+    
+/a\b/
+    a.\=allusedtext
+    a\=allusedtext  
+
+/abc\Kxyz/
+    abcxyz\=allusedtext
+
+/abc(?=xyz(*ACCEPT))/
+    abcxyz\=allusedtext
+
+/abc(?=abcde)(?=ab)/allusedtext
+    abcabcdefg
+    
+# These tests provoke recursion loops, which give a different error message
+# when JIT is used.
+
+/(?R)/I
+    abcd
+
+/(a|(?R))/I
+    abcd
+    defg 
+
+/(ab|(bc|(de|(?R))))/I
+    abcd
+    fghi 
+
+/(ab|(bc|(de|(?1))))/I
+    abcd
+    fghi 
+
+/x(ab|(bc|(de|(?1)x)x)x)/I
+    xab123
+    xfghi 
+
+/(?!\w)(?R)/
+    abcd
+    =abc 
+
+/(?=\w)(?R)/
+    =abc 
+    abcd
+
+/(?<!\w)(?R)/
+    abcd
+
+/(?<=\w)(?R)/
+    abcd
+
+/(a+|(?R)b)/
+    aaa
+    bbb 
+
+/[^\xff]((?1))/BI
+    abcd
+    
+# These tests don't behave the same with JIT 
+
+/\w+(?C1)/BI,no_auto_possess
+    abc\=callout_fail=1
+
+/(*NO_AUTO_POSSESS)\w+(?C1)/BI
+    abc\=callout_fail=1
 
 # End of testinput15
index c26dfafe2bf0f13ed0a04a8b0b4ca84ede4451e7..8a4820772593066759d2b76eabc49dbc98573f15 100644 (file)
@@ -1,205 +1,9 @@
-# This test is run only when JIT support is available. It checks JIT complete
-# and partial modes, and things that are different with JIT.
+# This test is run only when JIT support is not available. It checks that an
+# attempt to use it has the expected behaviour. It also tests things that
+# are different without JIT.
 
-#pattern jitverify
+/abc/I,jit,jitverify
 
-# JIT does not support this pattern (callout at start of condition).
-
-/(?(?C1)(?=a)a)/I
-
-# The following pattern cannot be compiled by JIT.
-
-/b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*/I
-
-# Check that an infinite recursion loop is caught.
-
-/(?(R)a*(?1)|((?R))b)/
-    aaaabcde
-
-/abcd/I
-    abcd
-    xyz
-
-/(*NO_JIT)abcd/I
-    abcd
-    xyz
-
-/abcd/
-    abcd
-    ab\=ps
-    ab\=ph
-    xyz
-
-/abcd/jitfast
-    abcd
-    ab\=ps
-    ab\=ph
-    xyz
-
-/abcd/jit=1
-    abcd
-    ab\=ps
-    ab\=ph
-    xyz
-    xyz\=ps
-
-/abcd/jit=1,jitfast
-    abcd
-    ab\=ps
-    ab\=ph
-    xyz
-    xyz\=ps
-
-/abcd/jit=2
-    abcd
-    ab\=ps
-    ab\=ph
-    xyz
-
-/abcd/jit=2,jitfast
-    abcd
-    ab\=ps
-    ab\=ph
-    xyz
-
-/abcd/jit=3
-    abcd
-    ab\=ps
-    ab\=ph
-    xyz
-
-/abcd/jit=4
-    abcd
-    ab\=ps
-    ab\=ph
-    xyz
-
-/abcd/jit=5
-    abcd
-    ab\=ps
-    ab\=ph
-    xyz
-
-/abcd/jit=6
-    abcd
-    ab\=ps
-    ab\=ph
-    xyz
-
-/abcd/jit=7
-    abcd
-    ab\=ps
-    ab\=ph
-    xyz
-
-/abcd/I,jit=2
-
-/(*NO_START_OPT)a(*:m)b/mark
-    a
-
-/^12345678abcd/m
-    12345678abcd
-    
-# Limits tests that give different output with JIT. 
-
-/(a+)*zz/I
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
-  aaaaaaaaaaaaaz\=find_limits
-
-!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
-   /* this is a C style comment */\=find_limits
-
-/^(?>a)++/
-    aa\=find_limits
-    aaaaaaaaa\=find_limits
-    
-/(a)(?1)++/
-    aa\=find_limits
-    aaaaaaaaa\=find_limits
-
-/a(?:.)*?a/ims
-    abbbbbbbbbbbbbbbbbbbbba\=find_limits
-    
-/a(?:.(*THEN))*?a/ims
-    abbbbbbbbbbbbbbbbbbbbba\=find_limits
-
-/a(?:.(*THEN:ABC))*?a/ims
-    abbbbbbbbbbbbbbbbbbbbba\=find_limits
-
-/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
-     aabbccddee\=find_limits
-
-/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
-     aabbccddee\=find_limits
-
-/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
-     aabbccddee\=find_limits
-
-/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/jitfast
-     aabbccddee\=find_limits
-     aabbccddee\=jitstack=1
-
-/(a+)*zz/
-    aaaaaaaaaaaaaz
-    aaaaaaaaaaaaaz\=match_limit=3000
-
-/(*LIMIT_MATCH=3000)(a+)*zz/I
-    aaaaaaaaaaaaaz
-    aaaaaaaaaaaaaz\=match_limit=60000
-
-/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
-    aaaaaaaaaaaaaz
-
-/(*LIMIT_MATCH=60000)(a+)*zz/I
-    aaaaaaaaaaaaaz
-    aaaaaaaaaaaaaz\=match_limit=3000
-
-# These three have infinitely nested recursions. 
-    
-/((?2))((?1))/
-    abc
-
-/((?(R2)a+|(?1)b))/
-    aaaabcde
-
-/(?(R)a*(?1)|((?R))b)/
-    aaaabcde
-    
-# Invalid options disable JIT when called via pcre2_match(), causing the
-# match to happen via the interpreter, but for fast JIT invalid options are
-# ignored, so an unanchored match happens.
-
-/abcd/
-    abcd\=anchored
-    fail abcd\=anchored 
-    
-/abcd/jitfast
-    abcd\=anchored 
-    succeed abcd\=anchored 
-    
-# Push/pop does not lose the JIT information, though jitverify applies only to
-# compilation, but serializing (save/load) discards JIT data completely.
-
-/^abc\Kdef/info,push
-#pop jitverify
-    abcdef
-
-/^abc\Kdef/info,push
-#save testsaved1
-#load testsaved1
-#pop jitverify
-    abcdef
-    
-#load testsaved1
-#pop jit,jitverify
-    abcdef
-    
-# Test pattern compilation
-
-/(?:a|b|c|d|e)(?R)/jit=1
-
-/(?:a|b|c|d|e)(?R)(?R)/jit=1
-
-/(a(?:a|b|c|d|e)b){8,16}/jit=1
+/a*/I
 
 # End of testinput16
index d636d38ebf82ec26219bf3baea6bf8933542ccf2..1474eb9a6ba497acd3ce9f0f6152f981d8a0da06 100644 (file)
-# This set of tests is run only with the 8-bit library. It tests the POSIX
-# interface, which is supported only with the 8-bit library. This test should
-# not be run with JIT (which is not available for the POSIX interface).
+# This test is run only when JIT support is available. It checks JIT complete
+# and partial modes, and things that are different with JIT.
+
+#pattern jitverify
+
+# JIT does not support this pattern (callout at start of condition).
+
+/(?(?C1)(?=a)a)/I
+
+# The following pattern cannot be compiled by JIT.
+
+/b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*/I
+
+# Check that an infinite recursion loop is caught.
+
+/(?(R)a*(?1)|((?R))b)/
+    aaaabcde
+
+/abcd/I
+    abcd
+\= Expect no match
+    xyz
+
+/(*NO_JIT)abcd/I
+    abcd
+\= Expect no match
+    xyz
+
+/abcd/
+    abcd
+    ab\=ps
+    ab\=ph
+\= Expect no match
+    xyz
+
+/abcd/jitfast
+    abcd
+    ab\=ps
+    ab\=ph
+\= Expect no match
+    xyz
+
+/abcd/jit=1
+    abcd
+    ab\=ps
+    ab\=ph
+\= Expect no match
+    xyz
+    xyz\=ps
+
+/abcd/jit=1,jitfast
+    abcd
+    ab\=ps
+    ab\=ph
+    xyz\=ps
+\= Expect no match
+    xyz
+
+/abcd/jit=2
+    abcd
+    ab\=ps
+    ab\=ph
+\= Expect no match
+    xyz
+
+/abcd/jit=2,jitfast
+    abcd
+    ab\=ps
+    ab\=ph
+    xyz
+
+/abcd/jit=3
+    abcd
+    ab\=ps
+    ab\=ph
+\= Expect no match
+    xyz
+
+/abcd/jit=4
+    abcd
+    ab\=ps
+    ab\=ph
+\= Expect no match
+    xyz
+
+/abcd/jit=5
+    abcd
+    ab\=ps
+    ab\=ph
+\= Expect no match
+    xyz
+
+/abcd/jit=6
+    abcd
+    ab\=ps
+    ab\=ph
+\= Expect no match
+    xyz
+
+/abcd/jit=7
+    abcd
+    ab\=ps
+    ab\=ph
+\= Expect no match
+    xyz
+
+/abcd/I,jit=2
+
+/(*NO_START_OPT)a(*:m)b/mark
+\= Expect no match
+    a
+
+/^12345678abcd/m
+    12345678abcd
+    
+# Limits tests that give different output with JIT. 
+
+/(a+)*zz/I
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
+\= Expect no match
+  aaaaaaaaaaaaaz\=find_limits
+
+!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
+   /* this is a C style comment */\=find_limits
+
+/^(?>a)++/
+    aa\=find_limits
+    aaaaaaaaa\=find_limits
+    
+/(a)(?1)++/
+    aa\=find_limits
+    aaaaaaaaa\=find_limits
+
+/a(?:.)*?a/ims
+    abbbbbbbbbbbbbbbbbbbbba\=find_limits
     
-#forbid_utf
-#pattern posix
+/a(?:.(*THEN))*?a/ims
+    abbbbbbbbbbbbbbbbbbbbba\=find_limits
+
+/a(?:.(*THEN:ABC))*?a/ims
+    abbbbbbbbbbbbbbbbbbbbba\=find_limits
+
+/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
+     aabbccddee\=find_limits
+
+/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
+     aabbccddee\=find_limits
+
+/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
+     aabbccddee\=find_limits
 
-# Test invalid options
+/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/jitfast
+     aabbccddee\=find_limits
+     aabbccddee\=jitstack=1
 
-/abc/auto_callout
+/(a+)*zz/
+\= Expect no match
+    aaaaaaaaaaaaaz
+\= Expect limit exceeded
+    aaaaaaaaaaaaaz\=match_limit=3000
 
-/abc/
-   abc\=find_limits
+/(*LIMIT_MATCH=3000)(a+)*zz/I
+    aaaaaaaaaaaaaz
+    aaaaaaaaaaaaaz\=match_limit=60000
 
-/abc/
-  abc\=partial_hard
+/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
+    aaaaaaaaaaaaaz
 
-# Real tests
+/(*LIMIT_MATCH=60000)(a+)*zz/I
+\= Expect no match
+    aaaaaaaaaaaaaz
+\= Expect limit exceeded
+    aaaaaaaaaaaaaz\=match_limit=3000
 
-/abc/
+# These three have infinitely nested recursions. 
+    
+/((?2))((?1))/
     abc
-    *** Failers
 
-/^abc|def/
+/((?(R2)a+|(?1)b))/
+    aaaabcde
+
+/(?(R)a*(?1)|((?R))b)/
+    aaaabcde
+    
+# Invalid options disable JIT when called via pcre2_match(), causing the
+# match to happen via the interpreter, but for fast JIT invalid options are
+# ignored, so an unanchored match happens.
+
+/abcd/
+    abcd\=anchored
+\= Expect no match
+    fail abcd\=anchored 
+    
+/abcd/jitfast
+    abcd\=anchored 
+    succeed abcd\=anchored 
+    
+# Push/pop does not lose the JIT information, though jitverify applies only to
+# compilation, but serializing (save/load) discards JIT data completely.
+
+/^abc\Kdef/info,push
+#pop jitverify
     abcdef
-    abcdef\=notbol
 
-/.*((abc)$|(def))/
-    defabc
-    defabc\=noteol
+/^abc\Kdef/info,push
+#save testsaved1
+#load testsaved1
+#pop jitverify
+    abcdef
+    
+#load testsaved1
+#pop jit,jitverify
+    abcdef
+    
+# Test pattern compilation
 
-/the quick brown fox/
-    the quick brown fox
-    *** Failers
-    The Quick Brown Fox
+/(?:a|b|c|d|e)(?R)/jit=1
 
-/the quick brown fox/i
-    the quick brown fox
-    The Quick Brown Fox
+/(?:a|b|c|d|e)(?R)(?R)/jit=1
 
-/abc.def/
-    *** Failers
-    abc\ndef
+/(a(?:a|b|c|d|e)b){8,16}/jit=1
 
-/abc$/
-    abc
-    abc\n
+/(?:|a|){100}x/jit=1
 
-/(abc)\2/
+# These tests provoke recursion loops, which give a different error message
+# when JIT is used.
 
-/(abc\1)/
-    abc
+/(?R)/I
+    abcd
 
-/a*(b+)(z)(z)/
-    aaaabbbbzzzz
-    aaaabbbbzzzz\=ovector=0
-    aaaabbbbzzzz\=ovector=1
-    aaaabbbbzzzz\=ovector=2
+/(a|(?R))/I
+    abcd
+    defg 
 
-/ab.cd/
-    ab-cd
-    ab=cd
-    ** Failers
-    ab\ncd
+/(ab|(bc|(de|(?R))))/I
+    abcd
+    fghi 
 
-/ab.cd/s
-    ab-cd
-    ab=cd
-    ab\ncd
+/(ab|(bc|(de|(?1))))/I
+    abcd
+    fghi 
 
-/a(b)c/no_auto_capture
-    abc
+/x(ab|(bc|(de|(?1)x)x)x)/I
+    xab123
+    xfghi 
 
-/a(?P<name>b)c/no_auto_capture
-    abc
+/(?!\w)(?R)/
+    abcd
+    =abc 
 
-/a?|b?/
-    abc
-    ** Failers
-    ddd\=notempty
+/(?=\w)(?R)/
+    =abc 
+    abcd
+
+/(?<!\w)(?R)/
+    abcd
+
+/(?<=\w)(?R)/
+    abcd
+
+/(a+|(?R)b)/
+    aaa
+    bbb 
 
-/\w+A/
-   CDAAAAB
+/[^\xff]((?1))/BI
+    abcd
 
-/\w+A/ungreedy
-   CDAAAAB
-   
-/\Biss\B/I,aftertext
-    Mississippi
+/(x(?1)){4}/
 
-/abc/\
+/[axm]{7}/
 
-"(?(?C)"
+/(.|.)*?bx/
+    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabax
 
-# End of testdata/testinput16  
+# End of testinput17
index a517905947fbe220ca1c00ba0138f67471848e0f..c75b84247b0fe4c4cce386da6c242175b1eeb911 100644 (file)
 # This set of tests is run only with the 8-bit library. It tests the POSIX
-# interface with UTF/UCP support, which is supported only with the 8-bit
-# library. This test should not be run with JIT (which is not available for the
-# POSIX interface).
+# interface, which is supported only with the 8-bit library. This test should
+# not be run with JIT (which is not available for the POSIX interface).
     
+#forbid_utf
 #pattern posix
 
-/a\x{1234}b/utf
-    a\x{1234}b
+# Test invalid options
 
-/\w/
-    +++\x{c2}
+/abc/auto_callout
 
-/\w/ucp
-    +++\x{c2}
-    
-# End of testdata/testinput17
+/abc/
+   abc\=find_limits
+
+/abc/
+  abc\=partial_hard
+
+# Real tests
+
+/abc/
+    abc
+
+/^abc|def/
+    abcdef
+    abcdef\=notbol
+
+/.*((abc)$|(def))/
+    defabc
+    defabc\=noteol
+
+/the quick brown fox/
+    the quick brown fox
+\= Expect no match
+    The Quick Brown Fox
+
+/the quick brown fox/i
+    the quick brown fox
+    The Quick Brown Fox
+
+/(*LF)abc.def/
+\= Expect no match
+    abc\ndef
+
+/(*LF)abc$/
+    abc
+    abc\n
+
+/(abc)\2/
+
+/(abc\1)/
+\= Expect no match
+    abc
+
+/a*(b+)(z)(z)/
+    aaaabbbbzzzz
+    aaaabbbbzzzz\=ovector=0
+    aaaabbbbzzzz\=ovector=1
+    aaaabbbbzzzz\=ovector=2
+
+/(*ANY)ab.cd/
+    ab-cd
+    ab=cd
+\= Expect no match
+    ab\ncd
+
+/ab.cd/s
+    ab-cd
+    ab=cd
+    ab\ncd
+
+/a(b)c/no_auto_capture
+    abc
+
+/a(?P<name>b)c/no_auto_capture
+    abc
+
+/a?|b?/
+    abc
+\= Expect no match
+    ddd\=notempty
+
+/\w+A/
+   CDAAAAB
+
+/\w+A/ungreedy
+   CDAAAAB
+   
+/\Biss\B/I,aftertext
+    Mississippi
+
+/abc/\
+
+"(?(?C)"
+
+/abcd/substitute_extended
+
+/\[A]{1000000}**/expand,regerror_buffsize=31
+
+/\[A]{1000000}**/expand,regerror_buffsize=32
+
+# End of testdata/testinput18
index 155fd13763d97a4996f04911363bd73b80f8e3f4..7a90f1aeadc35d75e84cd276ee71be0871d9a357 100644 (file)
@@ -1,62 +1,18 @@
-# This set of tests exercises the serialization/deserialization functions in
-# the library. It does not use UTF or JIT.
-
-#forbid_utf
-
-# Compile several patterns, push them onto the stack, and then write them
-# all to a file.
-
-#pattern push
-
-/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
-  (?(DEFINE)
-  (?<NAME_PAT>[a-z]+)
-  (?<ADDRESS_PAT>\d+)
-  )/x
-/^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i
-
-#save testsaved1
-
-# Do it again for some more patterns.
-
-/(*MARK:A)(*SKIP:B)(C|X)/mark
-/(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames
-
-#save testsaved2
-#pattern -push
-
-# Reload the patterns, then pop them one by one and check them.
-
-#load testsaved1
-#load testsaved2
-
-#pop info
-    foofoo             
-    barbar
-    
-#pop mark
-    C
-    D 
-    
-#pop
-    AmanaplanacanalPanama   
-
-#pop info
-    metcalfe 33
+# This set of tests is run only with the 8-bit library. It tests the POSIX
+# interface with UTF/UCP support, which is supported only with the 8-bit
+# library. This test should not be run with JIT (which is not available for the
+# POSIX interface).
     
-# Check for an error when different tables are used.
-
-/abc/push,tables=1
-/xyz/push,tables=2
-#save testsaved1
+#pattern posix
 
-#pop
-    xyz
+/a\x{1234}b/utf
+    a\x{1234}b
 
-#pop
-    abc
+/\w/
+\= Expect no match
+    +++\x{c2}
 
-#pop should give an error
-    pqr
-
-# End of testinput19 
+/\w/ucp
+    +++\x{c2}
+    
+# End of testdata/testinput19
index e0e149f4250eabc41e60e3895be1cc6eb3e003d8..071cca133d433819a166e222786f519610ed6cff 100644 (file)
@@ -9,6 +9,7 @@
 # test 5. 
 
 #forbid_utf
+#newline_default lf any anycrlf
 
 # Test binary zeroes in the pattern
 
     abc
     defabc
     abc\=anchored
-    *** Failers
+\= Expect no match
     defabc\=anchored
     ABC
 
 /^abc/I
     abc
     abc\=anchored
-    *** Failers
+\= Expect no match
     defabc
     defabc\=anchored
 
@@ -51,7 +52,7 @@
 
 /^abc$/I
     abc
-    *** Failers
+\= Expect no match
     def\nabc
 
 /ab\idef/
 
 /abc$/I,dollar_endonly
     abc
-    *** Failers
+\= Expect no match
     abc\n
     abc\ndef
 
 
 /the quick brown fox/I,anchored
     the quick brown fox
-    *** Failers
+\= Expect no match
     this is a line with the quick brown fox
 
 /ab(?z)cd/
 /(?<!bar|cattle)foo/I
     foo
     catfoo
-    *** Failers
+\= Expect no match
     the barfoo
     and cattlefoo
 
 /a$/I
     a
     a\n
-    *** Failers
+\= Expect no match
     a\=noteol
     a\n\=noteol
 
     a
     a\n
     a\n\=noteol
-    *** Failers
+\= Expect no match
     a\=noteol
 
 /\Aabc/Im
 
 /(?<=foo\n)^bar/Im
     foo\nbarbar
-    ***Failers
+\= Expect no match
     rhubarb
     barbell
     abc\nbarton
 
 /^(?<=foo\n)bar/Im
     foo\nbarbar
-    ***Failers
+\= Expect no match
     rhubarb
     barbell
     abc\nbarton
 /(?>^abc)/Im
     abc
     def\nabc
-    *** Failers
+\= Expect no match
     defabc
 
 /(?<=ab(c+)d)ef/
 /(?<=bullock|donkey)-cart/I
     the bullock-cart
     a donkey-cart race
-    *** Failers
+\= Expect no match
     cart
     horse-and-cart
 
     zZZ
     bZZ
     BZZ
-    *** Failers
+\= Expect no match
     ZZ
     abXYZZ
     zzz
 /(?<!(foo)a)bar/I
     bar
     foobbar
-    *** Failers
+\= Expect no match
     fooabar
 
-/This one is here because Perl behaves differently; see also the following/I
+# This one is here because Perl behaves differently; see also the following.
 
 /^(a\1?){4}$/I
+\= Expect no match
     aaaa
     aaaaaa
     
-/Perl does not fail these two for the final subjects. Neither did PCRE until/
-/release 8.01. The problem is in backtracking into a subpattern that contains/
-/a recursive reference to itself. PCRE has now made these into atomic patterns./
+# Perl does not fail these two for the final subjects. Neither did PCRE until
+# release 8.01. The problem is in backtracking into a subpattern that contains
+# a recursive reference to itself. PCRE has now made these into atomic patterns.
 
 /^(xa|=?\1a){2}$/
     xa=xaa
-    ** Failers
+\= Expect no match
     xa=xaaa
 
 /^(xa|=?\1a)+$/
     xa=xaa
-    ** Failers
+\= Expect no match
     xa=xaaa
 
-/These are syntax tests from Perl 5.005/I
+# These are syntax tests from Perl 5.005
 
 /a[b-a]/
 
 
 /\Biss\B/Ig,aftertext
     Mississippi
-    *** Failers
+\= Expect no match
     Mississippi\=anchored
 
 /(?<=[Ms])iss/Ig,aftertext
 /^ab\n/Igm,aftertext
     ab\nab\ncd
 
+/^/gm,newline=any
+    a\rb\nc\r\nxyz\=aftertext
+
 /abc/I
 
 /abc|bac/I
     b
     ab
     \
-    *** Failers
+\= Expect no match
     \=notempty
 
 /|-/I
     abcd
     -abc
     ab-c\=notempty
-    *** Failers
+\= Expect no match
     abc\=notempty
 
 /^.?abcd/I
     (ab(xycd)pqr
     () abc ()
     12(abcde(fsh)xyz(foo(bar))lmno)89
-    *** Failers
+\= Expect no match
     abcd
     abcd)
     (abcd
     (ab(xy)cd)
     (a(b(c)d)e)
     ((ab))
-    *** Failers
+\= Expect no match
     ()
 
 /\(  (?: (?>[^()]+) | (?R) )? \) /Ix
 /((?-i)[[:lower:]])[[:lower:]]/Ii
     ab
     aB
-    *** Failers
+\= Expect no match
     Ab
     AB
 
 /a(?i)b/IB
     ab
     aB
-    *** Failers
+\= Expect no match
     AB
 
 /(a(?i)b)/IB
     ab
     aB
-    *** Failers
+\= Expect no match
     AB
 
 /   (?i)abc/IBx
 /\Q\Eabc/IB
 
 /x*+\w/IB
-    *** Failers
+\= Expect no match
     xxxxx
 
 /x?+/IB
 
 /^(\w++|\s++)*$/I
     now is the time for all good men to come to the aid of the party
-    *** Failers
+\= Expect no match
     this is not a line with only words and spaces!
 
 /(\d++)(\w)/I
     12345a
-    *** Failers
+\= Expect no match
     12345+
 
 /a++b/I
 /\(([^()]++|\([^()]+\))+\)/I
     (abc)
     (abc(def)xyz)
-    *** Failers
+\= Expect no match
     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
 /(abc){1,3}+/IB
     <abc <def> hij>
     <abc<>def>
     <abc<>
-    *** Failers
+\= Expect no match
     <abc
 
 /8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b/IB
 /^a/Im
   abcde
   xy\nabc
-  *** Failers
+\= Expect no match
   xyabc
 
 /c|abc/I
 /abc(?C)def/I
     abcdef
     1234abcdef
-    *** Failers
+\= Expect no match
     abcxyz
     abcxyzf
 
 
 /(?C1)\dabc(?C2)def/I
     1234abcdef
-    *** Failers
+\= Expect no match
     abcdef
 
 /(?C1)\dabc(?C2)def/I
     1234abcdef
-    *** Failers
+\= Expect no match
     abcdef
 
 /(?C255)ab/I
 /(?C12vr)x/I
 
 /abc(?C)def/I
-    *** Failers
     \x83\x0\x61bcdef
 
 /(abc)(?C)de(?C1)f/I
     123abcdef
     123abcdef\=callout_capture
     123abcdefC-\=callout_none
-    *** Failers
+\= Expect no match
     123abcdef\=callout_fail=1
 
 /(?C0)(abc(?C1))*/I
     abcabcabc
     abcabc\=callout_fail=1:3
-    *** Failers
     abcabcabc\=callout_fail=1:3
 
 /(\d{3}(?C))*/I
    abcxyz\=callout_capture
 
 /a(b+)(c*)(?C1)/I
+\= Expect no match
     abbbbbccc\=callout_data=1
 
 /a(b+?)(c*?)(?C1)/I
+\= Expect no match
     abbbbbccc\=callout_data=1
 
 /(?C)abc/I
 
 /(?C)a|b/I
 
-/(?R)/I
-
-/(a|(?R))/I
-
-/(ab|(bc|(de|(?R))))/I
-
 /x(ab|(bc|(de|(?R))))/I
     xab
     xbc
     xde
     xxab
     xxxab
-    *** Failers
+\= Expect no match
     xyab
 
-/(ab|(bc|(de|(?1))))/I
-
-/x(ab|(bc|(de|(?1)x)x)x)/I
-
 /^([^()]|\((?1)*\))*$/I
     abc
     a(b)c
     a(b(c))d
-    *** Failers)
+\= Expect no match)
     a(b(c)d
 
 /^>abc>([^()]|\((?1)*\))*<xyz<$/I
     12
     (((2+2)*-3)-7)
     -12
-    *** Failers
+\= Expect no match
     ((2+2)*-3)-7)
 
 /^(x(y|(?1){2})z)/I
     xyz
     xxyzxyzz
-    *** Failers
+\= Expect no match
     xxyzz
     xxyzxyzxyzz
 
     <abc <def> hij>
     <abc<>def>
     <abc<>
-    *** Failers
+\= Expect no match
     <abc
 
 /(?1)/I
     Satan, oscillate my metallic sonatas!
     A man, a plan, a canal: Panama!
     Able was I ere I saw Elba.
-    *** Failers
+\= Expect no match
     The quick brown fox
 
 /((?(R)a|b))\1(?1)?/I
    aaabbb
    aaabbb\=callout_data=0
    aaabbb\=callout_data=1
+\= Expect no match    
    aaabbb\=callout_data=-1
 
 /ab(?P<one>cd)ef(?P<two>gh)/I
 
 "\[((?P<elem>\d+)(,(?P>elem))*)\]"I
     [10,20,30,5,5,4,4,2,43,23,4234]
-    *** Failers
+\= Expect no match
     []
 
 "\[((?P<elem>\d+)(,(?P>elem))*)?\]"I
 
 /(a(b(?2)c)){0,2}/IB
 
-/[ab]{1}+/IB
+/[ab]{1}+/B
+
+/()(?1){1}/B
+
+/()(?1)/B
 
 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
      Baby Bjorn Active Carrier - With free SHIPPING!!
 
 /abcde/IB,auto_callout
   abcde
+\= Expect no match
   abcdfe
 
 /a*b/IB,auto_callout
 /a+b/IB,auto_callout
   ab
   aaaab
+\= Expect no match 
   aaaacb
 
 /(abc|def)x/IB,auto_callout
   abcx
   defx
-  ** Failers 
+\= Expect no match 
   abcdefzx
 
 /(abc|def)x/IB,auto_callout
   abcx
   defx
-  ** Failers 
+\= Expect no match 
   abcdefzx
 
 /(ab|cd){3,4}/I,auto_callout
   abcdcdcdcdcd
 
 /([ab]{,4}c|xy)/IB,auto_callout
+\= Expect no match 
     Note: that { does NOT introduce a quantifier
 
 /([ab]{,4}c|xy)/IB,auto_callout
+\= Expect no match 
     Note: that { does NOT introduce a quantifier
 
 /([ab]{1,4}c|xy){4,5}?123/IB,auto_callout
   ab cd\=offset=1
 
 /\b.*/Is
-  ab cd\=offset=1
+  ab cd\=startoffset=1
 
 /(?!.bcd).*/I
   Xbcd12345
     abcd\=ps
     abcde\=ps
     the quick brown abc\=ps
-    ** Failers\=ps
+\= Expect no match\=ps
     the quick brown abxyz fox\=ps
 
 "^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$"I
     02/\=ps
     02/0\=ps
     02/1\=ps
-    ** Failers\=ps
+\= Expect no match\=ps
     \=ps
     123\=ps
     33/4/04\=ps
     1234X
     12345\=ps
     12345X
-    *** Failers
+\= Expect no match
     1X
     123456\=ps
 
 
 /line\nbreak/I,firstline
     this is a line\nbreak
-    ** Failers
+\= Expect no match
     line one\nthis is a line\nbreak in the second line
 
 /line\nbreak/Im,firstline
     this is a line\nbreak
-    ** Failers
+\= Expect no match
     line one\nthis is a line\nbreak in the second line
 
 /(?i)(?-i)AbCd/I
     AbCd
-    ** Failers
+\= Expect no match
     abcd
 
 /a{11111111111111111111}/I
 /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames
     a1b\=copy=A
     a2b\=copy=A
-    ** Failers
     a1b\=copy=Z,copy=A
     
 /(?|(?<a>)(?<b>)(?<a>)|(?<a>)(?<b>)(?<a>))/I,dupnames
 /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames
     a1b\=get=A
     a2b\=get=A
-    ** Failers
     a1b\=get=Z,get=A
 
 /^(?P<A>a)(?P<A>b)/I,dupnames
 
 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I
 
-/ In this next test, J is not set at the outer level; consequently it isn't
-set in the pattern's options; consequently pcre_get_named_substring() produces
-a random value. /Ix
+# In this next test, J is not set at the outer level; consequently it isn't set
+# in the pattern's options; consequently pcre2_substring_get_byname() produces
+# a random value.
 
 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
     a bc d\=copy=A,copy=B,copy=C
@@ -1507,7 +1509,7 @@ a random value. /Ix
 /^(?P<A>a)?(?(A)a|b)/I
     aabc
     bc
-    ** Failers
+\= Expect no match
     abc
 
 /(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
@@ -1539,7 +1541,7 @@ a random value. /Ix
 /^abc/Im,newline=lf
     xyz\nabc
     xyz\r\nabc
-    ** Failers
+\= Expect no match
     xyz\rabc
     xyzabc\r
     xyzabc\rpqr
@@ -1548,13 +1550,13 @@ a random value. /Ix
 
 /^abc/Im,newline=crlf
     xyz\r\nabclf>
-    ** Failers
+\= Expect no match
     xyz\nabclf
     xyz\rabclf
     
 /^abc/Im,newline=cr
     xyz\rabc
-    ** Failers
+\= Expect no match
     xyz\nabc
     xyz\r\nabc
 
@@ -1612,7 +1614,7 @@ a random value. /Ix
 
 /^a+A\d/IB
     aaaA5
-    ** Failers
+\= Expect no match
     aaaa5
 
 /^a*A\d/IBi
@@ -1784,7 +1786,7 @@ a random value. /Ix
 /^(?:(?(ZZ)a|b)(?<ZZ>X))+/
     bXaX
     bXbX
-    ** Failers
+\= Expect no match
     aXaX
     aXbX
 
@@ -1805,14 +1807,14 @@ a random value. /Ix
 /^((?(abc)a|b)(?<abc>x|y))+/
     bxay
     bxby
-    ** Failers
+\= Expect no match
     axby
 
 /^(((?P=abc)|X)(?<abc>x|y))+/
     XxXxxx
     XxXyyx
     XxXyxx
-    ** Failers
+\= Expect no match
     x
 
 /^(?1)(abc)/
@@ -1845,7 +1847,7 @@ a random value. /Ix
     Satan, oscillate my metallic sonatas!
     A man, a plan, a canal: Panama!
     Able was I ere I saw Elba.
-    *** Failers
+\= Expect no match
     The quick brown fox
 
 /(?=(\w+))\1:/I
@@ -1856,14 +1858,14 @@ a random value. /Ix
 
 /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/dupnames
     adaa
-    ** Failers
+\= Expect no match
     addd
     adbb
 
 /(?'abc'a|b)(?<abc>d|e)(?&abc){2}/dupnames
     bdaa
     bdab
-    ** Failers
+\= Expect no match
     bddd
 
 /(?(<bc))/
@@ -1885,26 +1887,27 @@ a random value. /Ix
 /(?(DEFINE) abc) xyz/Ix
 
 /(a|)*\d/
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=ovector=0
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4\=ovector=0
+\= Expect no match
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=ovector=0
 
 /^a.b/newline=lf
     a\rb
-    ** Failers
+\= Expect no match
     a\nb
 
 /^a.b/newline=cr
     a\nb
-    ** Failers
+\= Expect no match
     a\rb
 
 /^a.b/newline=anycrlf
     a\x85b
-    ** Failers
+\= Expect no match
     a\rb
 
 /^a.b/newline=any
-    ** Failers
+\= Expect no match
     a\nb
     a\rb
     a\x85b
@@ -1922,7 +1925,7 @@ a random value. /Ix
     a\x0bb
     a\x0cb
     a\x85b
-    ** Failers
+\= Expect no match
     a\n\rb
 
 /^a\R*b/bsr=unicode
@@ -1945,7 +1948,7 @@ a random value. /Ix
     a\x85b
     a\n\rb
     a\n\r\x85\x0cb
-    ** Failers
+\= Expect no match
     ab
 
 /^a\R{1,3}b/bsr=unicode
@@ -1956,7 +1959,7 @@ a random value. /Ix
     a\r\n\r\n\r\nb
     a\n\r\n\rb
     a\n\n\r\nb
-    ** Failers
+\= Expect no match
     a\n\n\n\rb
     a\r
 
@@ -1980,12 +1983,14 @@ a random value. /Ix
     123axbaxbaxbx456
 
 /(abc)(?i:(?1))/
-   defabcabcxyz
-   DEFabcABCXYZ
+    defabcabcxyz
+\= Expect no match
+    DEFabcABCXYZ
 
 /(abc)(?:(?i)(?1))/
-   defabcabcxyz
-   DEFabcABCXYZ
+    defabcabcxyz
+\= Expect no match
+    DEFabcABCXYZ
 
 /^(a)\g-2/
 
@@ -1999,24 +2004,24 @@ a random value. /Ix
 
 /^a.b/newline=lf
     a\rb
-    *** Failers
+\= Expect no match
     a\nb
 
 /.+foo/
     afoo
-    ** Failers
+\= Expect no match
     \r\nfoo
     \nfoo
 
 /.+foo/newline=crlf
     afoo
     \nfoo
-    ** Failers
+\= Expect no match
     \r\nfoo
 
 /.+foo/newline=any
     afoo
-    ** Failers
+\= Expect no match
     \nfoo
     \r\nfoo
 
@@ -2028,7 +2033,7 @@ a random value. /Ix
 /^$/gm,newline=any
     abc\r\rxyz
     abc\n\rxyz  
-    ** Failers 
+\= Expect no match 
     abc\r\nxyz
 
 /(?m)^$/g,newline=any,aftertext
@@ -2045,7 +2050,7 @@ a random value. /Ix
 
 /^X/m
     XABC
-    ** Failers 
+\= Expect no match 
     XABC\=notbol
 
 /(ab|c)(?-1)/B
@@ -2053,7 +2058,7 @@ a random value. /Ix
 
 /xy(?+1)(abc)/B
     xyabcabc
-    ** Failers
+\= Expect no match
     xyabc  
     
 /x(?-0)y/
@@ -2067,13 +2072,13 @@ a random value. /Ix
 /^(abc)?(?(-1)X|Y)/B
     abcX
     Y
-    ** Failers
+\= Expect no match
     abcY   
     
 /^((?(+1)X|Y)(abc))+/B
     YabcXabc
     YabcXabcXabc
-    ** Failers
+\= Expect no match
     XabcXabc  
 
 /(?(-1)a)/B
@@ -2088,7 +2093,7 @@ a random value. /Ix
 /(?<A>tom|bon)-\k{A}/
     tom-tom
     bon-bon 
-    ** Failers
+\= Expect no match
     tom-bon  
 
 /\g{A/
@@ -2106,7 +2111,7 @@ a random value. /Ix
     xxyzx 
 
 /\H++X/B
-    ** Failers
+\= Expect no match
     XXXX
     
 /\H+\hY/B
@@ -2162,21 +2167,27 @@ a random value. /Ix
 /A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/B
 
 /^a+(*FAIL)/auto_callout
+\= Expect no match
     aaaaaa
     
 /a+b?c+(*FAIL)/auto_callout
+\= Expect no match
     aaabccc
 
 /a+b?(*PRUNE)c+(*FAIL)/auto_callout
+\= Expect no match
     aaabccc
 
 /a+b?(*COMMIT)c+(*FAIL)/auto_callout
+\= Expect no match
     aaabccc
     
 /a+b?(*SKIP)c+(*FAIL)/auto_callout
+\= Expect no match
     aaabcccaaabccc
 
 /a+b?(*THEN)c+(*FAIL)/auto_callout
+\= Expect no match
     aaabccc
     
 /a(*MARK)b/
@@ -2190,6 +2201,7 @@ a random value. /Ix
 /(?1)\c[/
 
 /.+A/newline=crlf
+\= Expect no match
     \r\nA
     
 /\nA/newline=crlf
@@ -2205,33 +2217,33 @@ a random value. /Ix
 
 /(*CR)a.b/
     a\nb
-    ** Failers
+\= Expect no match
     a\rb  
 
 /(*CR)a.b/newline=lf
     a\nb
-    ** Failers
+\= Expect no match
     a\rb  
 
 /(*LF)a.b/newline=CRLF
     a\rb
-    ** Failers
+\= Expect no match
     a\nb  
 
 /(*CRLF)a.b/
     a\rb
     a\nb  
-    ** Failers
+\= Expect no match
     a\r\nb  
 
 /(*ANYCRLF)a.b/newline=CR
-    ** Failers
+\= Expect no match
     a\rb
     a\nb  
     a\r\nb  
 
 /(*ANY)a.b/newline=cr
-    ** Failers
+\= Expect no match
     a\rb
     a\nb  
     a\r\nb  
@@ -2250,7 +2262,7 @@ a random value. /Ix
     a\rb
     a\nb
     a\r\nb
-    ** Failers
+\= Expect no match
     a\x85b
     a\x0bb     
 
@@ -2265,7 +2277,7 @@ a random value. /Ix
     a\rb
     a\nb
     a\r\nb
-    ** Failers
+\= Expect no match
     a\x85b
     a\x0bb     
 
@@ -2280,7 +2292,7 @@ a random value. /Ix
     a\r\n\nb
     a\n\r\rb
     a\r\n\r\n\r\n\r\nb
-    ** Failers
+\= Expect no match
     a\x85\x85b
     a\x0b\x0bb     
 
@@ -2290,7 +2302,7 @@ a random value. /Ix
     a\r\n\n\r\rb
     a\x85\x85b
     a\x0b\x0bb     
-    ** Failers 
+\= Expect no match 
     a\r\r\r\r\rb 
  
 /(*BSR_ANYCRLF)a\Rb/I
@@ -2343,14 +2355,6 @@ a random value. /Ix
 
 /(?P>)/
 
-/(?!\w)(?R)/
-
-/(?=\w)(?R)/
-
-/(?<!\w)(?R)/
-
-/(?<=\w)(?R)/
-
 /[[:foo:]]/
 
 /[[:1234:]]/
@@ -2374,10 +2378,11 @@ a random value. /Ix
 /^(?+1)(?<a>x|y){0}z/
     xzxx
     yzyy 
-    ** Failers
+\= Expect no match
     xxz  
 
 /(\3)(\1)(a)/
+\= Expect no match
     cat
 
 /(\3)(\1)(a)/alt_bsux,allow_empty_class,match_unset_backref,dupnames
@@ -2397,12 +2402,12 @@ a random value. /Ix
 
 /(?1)[]a()b](abc)/
     abcbabc
-    ** Failers 
+\= Expect no match 
     abcXabc
 
 /(?1)[^]a()b](abc)/
     abcXabc
-    ** Failers 
+\= Expect no match 
     abcbabc
 
 /(?2)[]a()b](abc)(xyz)/
@@ -2419,27 +2424,27 @@ a random value. /Ix
 /a[^]b/
 
 /a[]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
-    ** Failers
+\= Expect no match
     ab
 
 /a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
-    ** Failers
+\= Expect no match
     ab 
 
 /a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
-    ** Failers
+\= Expect no match
     ab 
 
 /a[^]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     aXb
     a\nb 
-    ** Failers
+\= Expect no match
     ab  
     
 /a[^]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     aXb
     a\nX\nXb 
-    ** Failers
+\= Expect no match
     ab  
 
 /a(?!)b/B
@@ -2462,13 +2467,13 @@ a random value. /Ix
 /xyz/auto_callout
   xyz 
   abcxyz 
-  ** Failers 
+\= Expect no match 
   abc
   abcxypqr  
   
 /xyz/auto_callout,no_start_optimize
   abcxyz 
-  ** Failers 
+\= Expect no match 
   abc
   abcxypqr  
   
@@ -2624,10 +2629,12 @@ a random value. /Ix
     ++++Z1234\=ps
 
 /Z(*F)/
+\= Expect no match
     Z\=ps
     ZA\=ps
     
 /Z(?!)/
+\= Expect no match
     Z\=ps
     ZA\=ps
 
@@ -2680,14 +2687,14 @@ a random value. /Ix
     abcdef
     abcdef\=notempty_atstart
     xyzabcdef\=notempty_atstart
-    ** Failers
+\= Expect no match
     abcdef\=notempty
     xyzabcdef\=notempty
     
 /^(?:(?=abc)|abc\K)/aftertext,startchar
     abcdef
     abcdef\=notempty_atstart
-    ** Failers 
+\= Expect no match 
     abcdef\=notempty
 
 /a?b?/aftertext
@@ -2696,13 +2703,13 @@ a random value. /Ix
     xyzabc\=notempty
     xyzabc\=notempty_atstart
     xyz\=notempty_atstart
-    ** Failers 
+\= Expect no match 
     xyz\=notempty
 
 /^a?b?/aftertext
     xyz
     xyzabc
-    ** Failers 
+\= Expect no match 
     xyzabc\=notempty
     xyzabc\=notempty_atstart
     xyz\=notempty_atstart
@@ -2750,7 +2757,7 @@ a random value. /Ix
 
 /(?i:\g<name>)(?-i:(?<name>a))/
     XaaX
-    ** Failers 
+\= Expect no match 
     XAAX 
 
 /(?-i:\g<+1>)(?i:(a))/
@@ -2835,20 +2842,20 @@ a random value. /Ix
     (?('quote')[a-z]+|[0-9]+)/Ix,dupnames
     a"aaaaa
     b"aaaaa 
-    ** Failers 
+\= Expect no match 
     b"11111
     a"11111 
     
 /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/IBx,dupnames
     abcdX
     eX
-    ** Failers
+\= Expect no match
     abcdY
     ey     
     
 /(?<A>a) (b)(c)  (?<A>d  (?(R&A)$ | (?4)) )/IBx,dupnames
     abcdd
-    ** Failers
+\= Expect no match
     abcdde  
 
 /abcd*/
@@ -2882,7 +2889,7 @@ a random value. /Ix
     XABD
     BAD
     ABXABD  
-    ** Failers 
+\= Expect no match 
     ABX 
     BAXBAD  
 
@@ -2893,6 +2900,7 @@ a random value. /Ix
     cat
 
 /(\3)(\1)(a)/I
+\= Expect no match
     cat
 
 /i(?(DEFINE)(?<s>a))/I
@@ -2905,7 +2913,7 @@ a random value. /Ix
     XabX
     XAbX
     CcC 
-    ** Failers
+\= Expect no match
     XABX   
 
 /(?i)a(?s)b|c/B
@@ -2919,13 +2927,15 @@ a random value. /Ix
 
 /^(?&t)*(?(DEFINE)(?<t>.))$/B
 
-/ -- This one is here because Perl gives the match as "b" rather than "ab". I
-     believe this to be a Perl bug. --/
+# This one is here because Perl gives the match as "b" rather than "ab". I
+# believe this to be a Perl bug.
       
 /(?>a\Kb)z|(ab)/
     ab\=startchar 
 
 /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
+    abcd
+    0abc 
 
 /abc(*MARK:)pqr/
 
@@ -2937,6 +2947,7 @@ a random value. /Ix
 # bug because replacing the B in the pattern by (B|D) does make it fail.
 
 /A(*COMMIT)B/aftertext,mark
+\= Expect no match
     ACABX
 
 # These should be different, but in Perl they are not, which I think
@@ -2946,13 +2957,14 @@ a random value. /Ix
     AC
 
 /A(*PRUNE)B|A(*PRUNE)C/mark
+\= Expect no match
     AC
     
 # Mark names can be duplicated. Perl doesn't give a mark for this one,
 # though PCRE2 does.
 
 /^A(*:A)B|^X(*:A)Y/mark
-    ** Failers
+\= Expect no match
     XAQQ
     
 # COMMIT at the start of a pattern should be the same as an anchor. Perl 
@@ -2963,16 +2975,19 @@ a random value. /Ix
     ABCDEFG
     
 /(*COMMIT)ABC/no_start_optimize
-    ** Failers
+\= Expect no match
     DEFGABC
     
 /^(ab (c+(*THEN)cd) | xyz)/x
+\= Expect no match
     abcccd  
 
 /^(ab (c+(*PRUNE)cd) | xyz)/x
+\= Expect no match
     abcccd  
 
 /^(ab (c+(*FAIL)cd) | xyz)/x
+\= Expect no match
     abcccd  
     
 # Perl gets some of these wrong
@@ -2991,20 +3006,20 @@ a random value. /Ix
 
 /A\NB./B
     ACBD
-    *** Failers
+\= Expect no match
     A\nB
     ACB\n   
 
 /A\NB./Bs
     ACBD
     ACB\n 
-    *** Failers
+\= Expect no match
     A\nB  
   
 /A\NB/newline=crlf
     A\nB
     A\rB
-    ** Failers
+\= Expect no match
     A\r\nB    
 
 /\R+b/B
@@ -3033,6 +3048,7 @@ a random value. /Ix
     X\x0d\x0a
 
 /X\H++\R/B
+\= Expect no match
     X\x0d\x0a
 
 /(?<=abc)def/
@@ -3067,17 +3083,21 @@ a random value. /Ix
     abc\=ph
 
 /abc\B/
-    abc
     abc\=ps
     abc\=ph
+\= Expect no match
+    abc
 
 /.+/
+\= Bad offsets
+    abc\=offset=4
+    abc\=offset=-4 
+\= Valid data
     abc\=offset=0
     abc\=offset=1
     abc\=offset=2
+\= Expect no match
     abc\=offset=3
-    abc\=offset=4
-    abc\=offset=-4 
 
 /^\cģ/
 
@@ -3116,12 +3136,12 @@ a random value. /Ix
 
 /^(a)*+(\w)/
     aaaaX
-    ** Failers 
+\= Expect no match 
     aaaa
 
 /^(?:a)*+(\w)/
     aaaaX
-    ** Failers 
+\= Expect no match 
     aaaa
 
 /(a)++1234/IB
@@ -3187,7 +3207,7 @@ a random value. /Ix
 
 /(?1)(?:(b(*ACCEPT))){0}c/
     bc
-    ** Failers 
+\= Expect no match 
     b 
 
 /(?1)(?:((*ACCEPT))){0}c/
@@ -3195,18 +3215,22 @@ a random value. /Ix
     c\=notempty
 
 /^.*?(?(?=a)a|b(*THEN)c)/
+\= Expect no match 
     ba
 
 /^.*?(?(?=a)a|bc)/
     ba
 
 /^.*?(?(?=a)a(*THEN)b|c)/
+\= Expect no match 
     ac
 
 /^.*?(?(?=a)a(*THEN)b)c/
+\= Expect no match 
     ac
 
 /^.*?(a(*THEN)b)c/
+\= Expect no match 
     aabc
     
 /^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
@@ -3223,9 +3247,11 @@ a random value. /Ix
 
 /(*MARK:A)(*SKIP:B)(C|X)/mark
     C
+\= Expect no match 
     D
      
 /(*:A)A+(*SKIP:A)(B|Z)/mark
+\= Expect no match 
     AAAC
 
 # ----------------------------
@@ -3240,6 +3266,7 @@ a random value. /Ix
     
 /(?>(*ACCEPT)b)c/
     c
+\= Expect no match 
     c\=notempty
 
 /(?:(?>(a)))+a%/allaftertext
@@ -3302,14 +3329,13 @@ a random value. /Ix
 
 /[:a[:abc]b:]/B
 
-/(a+|(?R)b)/
-
 /^(a(*:A)(d|e(*:B))z|aeq)/auto_callout
     adz
     aez
     aeqwerty
 
 /.(*F)/
+\= Expect no match
     abc\=ph
 
 /\btype\b\W*?\btext\b\W*?\bjavascript\b/I
@@ -3323,9 +3349,10 @@ a random value. /Ix
     ax
 
 'a*(*ACCEPT)b'aftertext
-    \=notempty_atstart
     abc\=notempty_atstart
     bbb\=notempty_atstart
+\= Expect no match
+    \=notempty_atstart
 
 /(*ACCEPT)a/I,aftertext
     bax
@@ -3335,7 +3362,7 @@ a random value. /Ix
 
 /^(?>a+)(?>(z+))\w/B
     aaaazzzzb
-    ** Failers
+\= Expect no match
     aazz  
 
 /(.)(\1|a(?2))/
@@ -3345,6 +3372,7 @@ a random value. /Ix
     cbbbc
     
 /(.)((?(1)c|a)|a(?2))/
+\= Expect no match
     baa  
 
 /(?P<abn>(?P=abn)xxx)/B
@@ -3353,7 +3381,7 @@ a random value. /Ix
 
 /^a\x41z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     aAz
-    *** Failers
+\= Expect no match
     ax41z
 
 /^a[m\x41]z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
@@ -3364,7 +3392,7 @@ a random value. /Ix
 
 /^a\u0041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     aAz
-    *** Failers
+\= Expect no match
     au0041z
 
 /^a[m\u0041]z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
@@ -3372,12 +3400,12 @@ a random value. /Ix
 
 /^a\u041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     au041z
-    *** Failers
+\= Expect no match
     aAz
 
 /^a\U0041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     aU0041z
-    *** Failers
+\= Expect no match
     aAz
 
 /(?(?=c)c|d)++Y/B
@@ -3402,7 +3430,7 @@ a random value. /Ix
 /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/x,mark
     AABC
     XXYZ 
-    ** Failers
+\= Expect no match
     XAQQ  
     XAQQXZZ  
     AXQQQ 
@@ -3413,12 +3441,12 @@ a random value. /Ix
     
 /(b|q)(*:m)f|a(*:n)w/mark
     aw 
-    ** Failers 
+\= Expect no match 
     abc
 
 /(q|b)(*:m)f|a(*:n)w/mark
     aw 
-    ** Failers 
+\= Expect no match 
     abc
 
 # After a partial match, the behaviour is as for a failure. 
@@ -3666,8 +3694,9 @@ a random value. /Ix
      ad 
 
 /^(?!a(*THEN)b|ac)../
-     ac
      ad 
+\= Expect no match
+     ac
 
 /^(?=a(*THEN)b|ac)/
     ac
@@ -3694,6 +3723,7 @@ a random value. /Ix
     bnn
 
 /(?(?=b(*SKIP)a)bn|bnn)/
+\= Expect no match
     bnn
 
 /(?=b(*THEN)a|)bn|bnn/
@@ -3712,41 +3742,40 @@ a random value. /Ix
 
 /[bcd]*a/B
 
-# A complete set of tests for auto-possessification of character types.
-
-/\D+\D \D+\d \D+\S \D+\s \D+\W \D+\w \D+. \D+\C \D+\R \D+\H \D+\h \D+\V \D+\v \D+\Z \D+\z \D+$/Bx
+# A complete set of tests for auto-possessification of character types, but
+# omitting \C because it might be disabled (it has its own tests).
 
-/\d+\D \d+\d \d+\S \d+\s \d+\W \d+\w \d+. \d+\C \d+\R \d+\H \d+\h \d+\V \d+\v \d+\Z \d+\z \d+$/Bx
+/\D+\D \D+\d \D+\S \D+\s \D+\W \D+\w \D+. \D+\R \D+\H \D+\h \D+\V \D+\v \D+\Z \D+\z \D+$/Bx
 
-/\S+\D \S+\d \S+\S \S+\s \S+\W \S+\w \S+. \S+\C \S+\R \S+\H \S+\h \S+\V \S+\v \S+\Z \S+\z \S+$/Bx
+/\d+\D \d+\d \d+\S \d+\s \d+\W \d+\w \d+. \d+\R \d+\H \d+\h \d+\V \d+\v \d+\Z \d+\z \d+$/Bx
 
-/\s+\D \s+\d \s+\S \s+\s \s+\W \s+\w \s+. \s+\C \s+\R \s+\H \s+\h \s+\V \s+\v \s+\Z \s+\z \s+$/Bx
+/\S+\D \S+\d \S+\S \S+\s \S+\W \S+\w \S+. \S+\R \S+\H \S+\h \S+\V \S+\v \S+\Z \S+\z \S+$/Bx
 
-/\W+\D \W+\d \W+\S \W+\s \W+\W \W+\w \W+. \W+\C \W+\R \W+\H \W+\h \W+\V \W+\v \W+\Z \W+\z \W+$/Bx
+/\s+\D \s+\d \s+\S \s+\s \s+\W \s+\w \s+. \s+\R \s+\H \s+\h \s+\V \s+\v \s+\Z \s+\z \s+$/Bx
 
-/\w+\D \w+\d \w+\S \w+\s \w+\W \w+\w \w+. \w+\C \w+\R \w+\H \w+\h \w+\V \w+\v \w+\Z \w+\z \w+$/Bx
+/\W+\D \W+\d \W+\S \W+\s \W+\W \W+\w \W+. \W+\R \W+\H \W+\h \W+\V \W+\v \W+\Z \W+\z \W+$/Bx
 
-/\C+\D \C+\d \C+\S \C+\s \C+\W \C+\w \C+. \C+\C \C+\R \C+\H \C+\h \C+\V \C+\v \C+\Z \C+\z \C+$/Bx
+/\w+\D \w+\d \w+\S \w+\s \w+\W \w+\w \w+. \w+\R \w+\H \w+\h \w+\V \w+\v \w+\Z \w+\z \w+$/Bx
 
-/\R+\D \R+\d \R+\S \R+\s \R+\W \R+\w \R+. \R+\C \R+\R \R+\H \R+\h \R+\V \R+\v \R+\Z \R+\z \R+$/Bx
+/\R+\D \R+\d \R+\S \R+\s \R+\W \R+\w \R+. \R+\R \R+\H \R+\h \R+\V \R+\v \R+\Z \R+\z \R+$/Bx
 
-/\H+\D \H+\d \H+\S \H+\s \H+\W \H+\w \H+. \H+\C \H+\R \H+\H \H+\h \H+\V \H+\v \H+\Z \H+\z \H+$/Bx
+/\H+\D \H+\d \H+\S \H+\s \H+\W \H+\w \H+. \H+\R \H+\H \H+\h \H+\V \H+\v \H+\Z \H+\z \H+$/Bx
 
-/\h+\D \h+\d \h+\S \h+\s \h+\W \h+\w \h+. \h+\C \h+\R \h+\H \h+\h \h+\V \h+\v \h+\Z \h+\z \h+$/Bx
+/\h+\D \h+\d \h+\S \h+\s \h+\W \h+\w \h+. \h+\R \h+\H \h+\h \h+\V \h+\v \h+\Z \h+\z \h+$/Bx
 
-/\V+\D \V+\d \V+\S \V+\s \V+\W \V+\w \V+. \V+\C \V+\R \V+\H \V+\h \V+\V \V+\v \V+\Z \V+\z \V+$/Bx
+/\V+\D \V+\d \V+\S \V+\s \V+\W \V+\w \V+. \V+\R \V+\H \V+\h \V+\V \V+\v \V+\Z \V+\z \V+$/Bx
 
-/\v+\D \v+\d \v+\S \v+\s \v+\W \v+\w \v+. \v+\C \v+\R \v+\H \v+\h \v+\V \v+\v \v+\Z \v+\z \v+$/Bx
+/\v+\D \v+\d \v+\S \v+\s \v+\W \v+\w \v+. \v+\R \v+\H \v+\h \v+\V \v+\v \v+\Z \v+\z \v+$/Bx
 
-/ a+\D  a+\d  a+\S  a+\s  a+\W  a+\w  a+.  a+\C  a+\R  a+\H  a+\h  a+\V  a+\v  a+\Z  a+\z  a+$/Bx
+/ a+\D  a+\d  a+\S  a+\s  a+\W  a+\w  a+.  a+\R  a+\H  a+\h  a+\V  a+\v  a+\Z  a+\z  a+$/Bx
 
-/\n+\D \n+\d \n+\S \n+\s \n+\W \n+\w \n+. \n+\C \n+\R \n+\H \n+\h \n+\V \n+\v \n+\Z \n+\z \n+$/Bx
+/\n+\D \n+\d \n+\S \n+\s \n+\W \n+\w \n+. \n+\R \n+\H \n+\h \n+\V \n+\v \n+\Z \n+\z \n+$/Bx
 
-/ .+\D  .+\d  .+\S  .+\s  .+\W  .+\w  .+.  .+\C  .+\R  .+\H  .+\h  .+\V  .+\v  .+\Z  .+\z  .+$/Bx
+/ .+\D  .+\d  .+\S  .+\s  .+\W  .+\w  .+.  .+\R  .+\H  .+\h  .+\V  .+\v  .+\Z  .+\z  .+$/Bx
 
-/ .+\D  .+\d  .+\S  .+\s  .+\W  .+\w  .+.  .+\C  .+\R  .+\H  .+\h  .+\V  .+\v  .+\Z  .+\z  .+$/Bsx
+/ .+\D  .+\d  .+\S  .+\s  .+\W  .+\w  .+.  .+\R  .+\H  .+\h  .+\V  .+\v  .+\Z  .+\z  .+$/Bsx
 
-/\D+$  \d+$  \S+$  \s+$  \W+$  \w+$  \C+$  \R+$  \H+$  \h+$  \V+$  \v+$   a+$  \n+$   .+$  .+$/Bmx
+/ \D+$  \d+$  \S+$  \s+$  \W+$  \w+$  \R+$  \H+$  \h+$  \V+$ \v+$  a+$   \n+$  .+$  .+$/Bmx
 
 /(?=a+)a(a+)++a/B
 
@@ -3889,7 +3918,7 @@ a random value. /Ix
     a /red/ thing 
     red is a colour
     put it all on red  
-    ** Failers
+\= Expect no match
     no reduction
     Alfred Winifred
     
@@ -3899,6 +3928,7 @@ a random value. /Ix
     abcd\=startchar
 
 /abcd/newline=lf,firstline
+\= Expect no match
     xx\nxabcd
     
 # Test stack guard external calls.
@@ -3937,7 +3967,7 @@ a random value. /Ix
 /^(?(?=abc)\w{3}:|\d\d)$/
     abc:
     12
-    *** Failers
+\= Expect no match
     123
     xyz    
 
@@ -3975,13 +4005,13 @@ a random value. /Ix
 
 /(?(VERSION=8)yes|no){3}/I
     yesnononoyes
-    ** Failers
+\= Expect no match
     yesno   
 
 /(?:(?<VERSION>abc)|xyz)(?(VERSION)yes|no)/I
     abcyes
     xyzno
-    ** Failers
+\= Expect no match
     abcno
     xyzyes    
 
@@ -3991,6 +4021,8 @@ a random value. /Ix
 
 /(?(VERSION>=10.0.0)yes|no)/
 
+/(?(VERSION=10.101)yes|no)/
+
 /abcd/I
 
 /abcd/I,no_start_optimize
@@ -4008,8 +4040,6 @@ a random value. /Ix
 
 /(((((a)))))/parens_nest_limit=2
 
-# Tests for pcre2_substitute()
-
 /abc/replace=XYZ
     123123
     123abc123
@@ -4087,13 +4117,58 @@ a random value. /Ix
     
 /(.)(.)/g,replace=$2$1
     abcdefgh  
+    
+/(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=${*MARK}
+    apple lemon blackberry
+    apple strudel
+    fruitless  
+
+/(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/replace=${*MARK} sauce,
+    apple lemon blackberry
+
+/(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=<$*MARK>
+    apple lemon blackberry
+    apple strudel
+    fruitless  
+    
+/(*:pear)apple/g,replace=${*MARKING} 
+    apple lemon blackberry
+
+/(*:pear)apple/g,replace=${*MARK-time
+    apple lemon blackberry
+
+/(*:pear)apple/g,replace=${*mark} 
+    apple lemon blackberry
+
+/(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=<$*MARKET>
+    apple lemon blackberry
+
+/(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=[22]${*MARK}
+    apple lemon blackberry
+    apple lemon blackberry\=substitute_overflow_length
+
+/(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=[23]${*MARK}
+    apple lemon blackberry
 
-# End of substitute tests 
+/abc/
+    123abc123\=replace=[9]XYZ
+    123abc123\=substitute_overflow_length,replace=[9]XYZ
+    123abc123\=substitute_overflow_length,replace=[6]XYZ
+    123abc123\=substitute_overflow_length,replace=[1]XYZ
+    123abc123\=substitute_overflow_length,replace=[0]XYZ
+
+/a(b)c/
+    123abc123\=replace=[9]x$1z
+    123abc123\=substitute_overflow_length,replace=[9]x$1z
+    123abc123\=substitute_overflow_length,replace=[6]x$1z
+    123abc123\=substitute_overflow_length,replace=[1]x$1z
+    123abc123\=substitute_overflow_length,replace=[0]x$1z
 
 "((?=(?(?=(?(?=(?(?=()))))))))"
     a
 
 "(?(?=)==)(((((((((?=)))))))))"
+\= Expect no match
     a
 
 /(a)(b)|(c)/
@@ -4117,9 +4192,11 @@ a random value. /Ix
 /^abc/info,no_dotstar_anchor
 
 /.*\d/info,auto_callout
+\= Expect no match
     aaa
 
 /.*\d/info,no_dotstar_anchor,auto_callout
+\= Expect no match
     aaa
 
 /.*\d/dotall,info
@@ -4161,7 +4238,7 @@ a random value. /Ix
 /(?(?=0)(?=00)?00765|(?!3).56)/
      00765
      456
-     ** Failers
+\= Expect no match
      356   
 
 '^(a)*+(\w)'
@@ -4233,7 +4310,7 @@ a random value. /Ix
 
 /(?(?!)a|b)/
     bbb
-    ** Failers 
+\= Expect no match 
     aaa 
 
 # JIT gives a different error message for the infinite recursion
@@ -4265,9 +4342,8 @@ a random value. /Ix
 
 /((?2){73}(?2))((?1))/info
 
-/ab\Cde/never_backslash_c
-
 /abc/
+\= Expect no match
     \[9x!xxx(]{9999}
     
 /(abc)*/
@@ -4327,4 +4403,401 @@ a random value. /Ix
 
 /^(?:(?(1)x|)+)+$()/B
 
+/[[:>:]](?<)/
+
+/((?x)(*:0))#(?'/
+
+/(?C$[$)(?<]/
+
+/(?C$)$)(?<]/
+
+/(?(R))*+/B
+    abcd
+
+/((?x)(?#))#(?'/
+
+/((?x)(?#))#(?'abc')/I
+
+/[[:\\](?<[::]/
+
+/[[:\\](?'abc')[a:]/I
+
+"[[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[:::::::::::::::::[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[[[:::E[[[:[:[[:[:::[[:::E[[[:[:[[:'[:::::E[[[:[::::::[[[:[[[[[[[::E[[[:[::::::[[[:[[[[[[[[:[[::[::::[[:::::::[[:[[[[[[[:[[::[:[[:[~"
+
+/()(?(R)0)*+/B
+
+/(?R-:(?</
+
+/(?(?C{\Q})(?!(?'/
+
+/(?(?C{\Q})(?!(?'abc')))/I
+
+/(?1){3918}(((((0(\k'R'))))(?J)(?'R'(?'R'\3){99})))/I
+
+/(?|(aaa)|(b))\g{1}/I
+
+/(?|(aaa)|(b))(?1)/I
+
+/(?|(aaa)|(b))/I
+
+/(?|(?'a'aaa)|(?'a'b))\k'a'/I
+
+/(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/I,dupnames
+
+/ab{3cd/
+    ab{3cd
+
+/ab{3,cd/
+    ab{3,cd
+
+/ab{3,4a}cd/
+    ab{3,4a}cd
+
+/{4,5a}bc/
+    {4,5a}bc
+
+/\x0{ab}/
+    \0{ab} 
+
+/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
+    ababababbbabZXXXX
+
+/.*?a(*PRUNE)b/
+    aab
+
+/.*?a(*PRUNE)b/s
+    aab
+
+/^a(*PRUNE)b/s
+\= Expect no match
+    aab
+
+/.*?a(*SKIP)b/
+    aab
+
+/(?(8000000000/
+
+/((?(R8000000000)))/
+
+/0(?0)|(1)(*THEN)(*SKIP:0)(*FAIL)/
+\= Expect no match
+    01
+
+/(?(1)()\983040\2)/
+
+/(*LIMIT_MATCH=)abc/
+
+/(*CRLF)(*LIMIT_MATCH=)abc/
+
+/(?:ab)?(?:ab)(?:ab)/
+    abab
+    ababab
+\= Expect no match
+    aba
+
+/((*MARK:A))++a(*SKIP:B)b/
+\= Expect no match
+    aacb
+
+/(*MARK:a\zb)z/alt_verbnames 
+    
+/(*:ab\t(d\)c)xxx/
+
+/(*:ab\t(d\)c)xxx/alt_verbnames,mark
+    cxxxz
+
+/(*:A\Qxx)x\EB)x/alt_verbnames,mark
+    x
+    
+/(*:A\ExxxB)x/alt_verbnames,mark
+    x 
+    
+/(*: A \ and #comment
+     \ B)x/x,alt_verbnames,mark
+    x  
+    
+/(*:A
+B)x/alt_verbnames,mark 
+    x
+
+/(*:abc\Qpqr)/alt_verbnames
+
+/abc/use_offset_limit
+    1234abcde\=offset_limit=100
+    1234abcde\=offset_limit=9
+    1234abcde\=offset_limit=4
+    1234abcde\=offset_limit=4,offset=4
+\= Expect no match
+    1234abcde\=offset_limit=4,offset=5
+    1234abcde\=offset_limit=3
+
+/(?<=abc)/use_offset_limit
+    1234abc\=offset_limit=7
+\= Expect no match
+    1234abc\=offset_limit=6
+    
+/A/g,replace=-,use_offset_limit
+    XAXAXAXAXA\=offset_limit=4
+
+/abc/
+\= Expect error
+    1234abcde\=offset_limit=4
+
+/^\w/m,use_offset_limit
+    \n..\naa\=offset_limit=3
+    \n..\naa\=offset_limit=4
+
+/abcd/null_context
+    abcd\=null_context
+\= Expect error     
+    abcd\=null_context,find_limits
+    abcd\=allusedtext,startchar 
+
+/abcd/replace=w\rx\x82y\o{333}z(\Q12\$34$$\x34\E5$$),substitute_extended
+    abcd
+    
+/a(bc)(DE)/replace=a\u$1\U$1\E$1\l$2\L$2\Eab\Uab\LYZ\EDone,substitute_extended
+    abcDE
+/abcd/replace=xy\kz,substitute_extended
+    abcd
+
+/a(?:(b)|(c))/substitute_extended,replace=X${1:+1:-1}X${2:+2:-2}
+    ab
+    ac
+    ab\=replace=${1:+$1\:$1:$2}
+    ac\=replace=${1:+$1\:$1:$2}
+
+/a(?:(b)|(c))/substitute_extended,replace=X${1:-1:-1}X${2:-2:-2}
+    ab
+    ac
+
+/(a)/substitute_extended,replace=>${1:+\Q$1:{}$$\E+\U$1}<
+    a
+
+/X(b)Y/substitute_extended
+    XbY\=replace=x${1:+$1\U$1}y
+    XbY\=replace=\Ux${1:+$1$1}y
+
+/a/substitute_extended,replace=${*MARK:+a:b}
+    a
+
+/(abcd)/replace=${1:+xy\kz},substitute_extended
+    abcd
+
+/(abcd)/
+    abcd\=replace=${1:+xy\kz},substitute_extended
+
+/abcd/substitute_extended,replace=>$1<
+    abcd
+
+/abcd/substitute_extended,replace=>xxx${xyz}<<<
+    abcd
+
+/(?J)(?:(?<A>a)|(?<A>b))/replace=<$A>
+    [a]
+    [b] 
+\= Expect error     
+    (a)\=ovector=1
+
+/(a)|(b)/replace=<$1>
+\= Expect error
+    b
+
+/(aa)(BB)/substitute_extended,replace=\U$1\L$2\E$1..\U$1\l$2$1
+    aaBB
+
+/^(o(\1{72}{\"{\\{00000059079}\d*){74}}){19}/I
+
+/((p(?'K/
+
+/((p(?'K/no_auto_capture
+
+/abc/replace=A$3123456789Z
+    abc
+
+/(?<!a{65535}a{5})x/I
+
+/(?<!a{65535})x/I
+
+/(?=a\K)/replace=z
+    BaCaD
+    
+/(?'abcdefghijklmnopqrstuvwxyzABCDEFG'toolong)/
+/(?'abcdefghijklmnopqrstuvwxyzABCDEF'justright)/ 
+
+# These two use zero-termination
+/abcd/max_pattern_length=3
+
+/abc/max_pattern_length=3
+
+# These two, being hex, pass the length
+/abcdefab/hex,max_pattern_length=3
+
+/abcdef/hex,max_pattern_length=3
+
+# These two patterns used to take a long time to compile
+
+"(.*)
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI
+
+"(?<=a()
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+a)"xI
+
+# When (?| is used and groups of the same number may be different,
+# we have to rely on a count to catch overly complicated patterns.
+
+"(?|()|())(.*)
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI
+
+"(?|()|())(?<=a()
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+a)"xI
+
+# Test the use of malloc for caching group information when there are more
+# groups than fit into the on-stack workspace.
+
+/\[()]{1024}/I,expand
+
+# Test minlength capped at 65535
+
+/(A{65000})\1{65000}/I
+
+# Test group scans when numbers are not unique
+
+/(?|()+|(a)+)/BI
+
+/(?|(a)+|()+)/BI
+
+/(?|()|(a))/BI
+
+/(?|(a)|())/BI
+
+# Test CRLF handling in empty string substitutions
+
+/^$/gm,newline=anycrlf,replace=-
+    X\r\n\r\nY
+
+/^$/gm,newline=crlf,replace=-
+    X\r\n\r\nY
+
+/^$/gm,newline=any,replace=-
+    X\r\n\r\nY
+
+"(*ANYCRLF)(?m)^(.*[^0-9\r\n].*|)$"g,replace=NaN
+    15\r\nfoo\r\n20\r\nbar\r\nbaz\r\n\r\n20
+
+/a[[:punct:]b]/bincode
+
+/a[b[:punct:]]/bincode
+
+/L(?#(|++<!(2)?/B
+
+/L(?#(|++<!(2)?/B,no_auto_possess
+
+/L(?#(|++<!(2)?/B,auto_callout
+
+/L(?#(|++<!(2)?/B,no_auto_possess,auto_callout
+
+/(A*)\E+/B,auto_callout
+
+/()\Q\E*]/B,auto_callout
+    a[bc]d
+
+/\x8a+f|;T?(*:;.'?`(\xeap ){![^()!y*''C*(?';]{1;(\x08)/B,alt_verbnames,dupnames,extended
+
+# Tests for NULL characters in comments and verb "names" and callouts
+
+# /A#B\x00C\x0aZ/
+/41 23 42 00 43 0a 5a/Bx,hex
+
+# /A+#B\x00C\x0a+/
+/41 2b 23 42 00 43 0a 2b/Bx,hex
+
+# /A(*:B\x00W#X\00Y\x0aC)Z/
+/41 28 2a 3a 42 00 57 23 58 00 59 0a 43 29 5a/Bx,hex,alt_verbnames
+
+# /A(*:B\x00W#X\00Y\x0aC)Z/
+/41 28 2a 3a 42 00 57 23 58 00 59 0a 43 29 5a/Bx,hex
+
+# /A(?C{X\x00Y})B/
+/41 28 3f 43 7b 58 00 59 7d 29 42/B,hex
+
+# /A(?#X\x00Y)B/
+/41 28 3f 23 7b 00 7d 29 42/B,hex
+
+# Tests for leading comment in extended patterns
+
+/ (?-x):?/extended
+
+/\v(?-x):?/extended
+
+/0b 28 3f 2d 78 29 3a/hex,extended
+
+/#comment
+(?-x):?/extended
+
+/(8(*:6^\x09x\xa6l\)6!|\xd0:[^:|)\x09d\Z\d{85*m(?'(?<1!)*\W[*\xff]!!h\w]*\xbe;/alt_bsux,alt_verbnames,allow_empty_class,dollar_endonly,extended,multiline,never_utf,no_dotstar_anchor,no_start_optimize
+
+/a|(b)c/replace=>$1<,substitute_unset_empty
+    cat
+    xbcom 
+
+/a|(b)c/
+    cat\=replace=>$1<
+    cat\=replace=>$1<,substitute_unset_empty
+    xbcom\=replace=>$1<,substitute_unset_empty
+
+/a|(b)c/substitute_extended
+    cat\=replace=>${2:-xx}<
+    cat\=replace=>${2:-xx}<,substitute_unknown_unset
+    cat\=replace=>${X:-xx}<,substitute_unknown_unset
+
+/a|(?'X'b)c/replace=>$X<,substitute_unset_empty
+    cat
+    xbcom 
+
+/a|(?'X'b)c/replace=>$Y<,substitute_unset_empty
+    cat
+    cat\=substitute_unknown_unset 
+    cat\=substitute_unknown_unset,-substitute_unset_empty 
+
+/a|(b)c/replace=>$2<,substitute_unset_empty
+    cat
+    cat\=substitute_unknown_unset 
+    cat\=substitute_unknown_unset,-substitute_unset_empty 
+
+/()()()/use_offset_limit
+    \=ovector=11000000000
+    \=callout_fail=11000000000
+    \=callout_fail=1:11000000000
+    \=callout_data=11000000000 
+    \=callout_data=-11000000000 
+    \=offset_limit=1100000000000000000000 
+    \=copy=11000000000 
+
+/(*MARK:A\x00b)/mark
+    abc
+
+/(*MARK:A\x00b)/mark,alt_verbnames
+    abc
+
+# /(*MARK:A\x00b)/
+/28 2a 4d 41 52 4b 3a 41 00 62 29/mark,hex
+    abc
+
+# /(*MARK:A\x00b)/
+/28 2a 4d 41 52 4b 3a 41 00 62 29/mark,hex,alt_verbnames
+    abc
+
 # End of testinput2 
diff --git a/testdata/testinput20 b/testdata/testinput20
new file mode 100644 (file)
index 0000000..9ec3174
--- /dev/null
@@ -0,0 +1,63 @@
+# This set of tests exercises the serialization/deserialization functions in
+# the library. It does not use UTF or JIT.
+
+#forbid_utf
+
+# Compile several patterns, push them onto the stack, and then write them
+# all to a file.
+
+#pattern push
+
+/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
+  (?(DEFINE)
+  (?<NAME_PAT>[a-z]+)
+  (?<ADDRESS_PAT>\d+)
+  )/x
+/^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i
+
+#save testsaved1
+
+# Do it again for some more patterns.
+
+/(*MARK:A)(*SKIP:B)(C|X)/mark
+/(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames
+
+#save testsaved2
+#pattern -push
+
+# Reload the patterns, then pop them one by one and check them.
+
+#load testsaved1
+#load testsaved2
+
+#pop info
+    foofoo             
+    barbar
+    
+#pop mark
+    C
+\= Expect no match     
+    D 
+    
+#pop
+    AmanaplanacanalPanama   
+
+#pop info
+    metcalfe 33
+    
+# Check for an error when different tables are used.
+
+/abc/push,tables=1
+/xyz/push,tables=2
+#save testsaved1
+
+#pop
+    xyz
+
+#pop
+    abc
+
+#pop should give an error
+    pqr
+
+# End of testinput20
diff --git a/testdata/testinput21 b/testdata/testinput21
new file mode 100644 (file)
index 0000000..1d1fbed
--- /dev/null
@@ -0,0 +1,16 @@
+# These are tests of \C that do not involve UTF. They are not run when \C is
+# disabled by compiling with --enable-never-backslash-C.
+
+/\C+\D \C+\d \C+\S \C+\s \C+\W \C+\w \C+. \C+\R \C+\H \C+\h \C+\V \C+\v \C+\Z \C+\z \C+$/Bx
+
+/\D+\C \d+\C \S+\C \s+\C \W+\C \w+\C .+\C \R+\C \H+\C \h+\C \V+\C \v+\C a+\C \n+\C \C+\C/Bx
+
+/ab\Cde/never_backslash_c
+
+/ab\Cde/info
+    abXde
+    
+/(?<=ab\Cde)X/
+    abZdeX
+
+# End of testinput21
diff --git a/testdata/testinput22 b/testdata/testinput22
new file mode 100644 (file)
index 0000000..f684cf4
--- /dev/null
@@ -0,0 +1,95 @@
+# Tests of \C when Unicode support is available. Note that \C is not supported
+# for DFA matching in UTF mode, so this test is not run with -dfa. The output
+# of this test is different in 8-, 16-, and 32-bit modes. Some tests may match
+# in some widths and not in others.
+
+/ab\Cde/utf,info
+    abXde
+
+# This should produce an error diagnostic (\C in UTF lookbehind)
+
+/(?<=ab\Cde)X/utf
+
+# Autopossessification tests
+
+/\C+\X \X+\C/Bx
+
+/\C+\X \X+\C/Bx,utf
+
+/\C\X*TӅ;\r
+{0,6}\v+\rF
+/utf
+\= Expect no match
+    Ӆ\x0a
+
+/\C(\W?ſ)'?{{/utf
+\= Expect no match
+    \\C(\\W?ſ)'?{{
+
+/X(\C{3})/utf
+    X\x{1234}
+    X\x{11234}Y
+    X\x{11234}YZ
+
+/X(\C{4})/utf
+    X\x{1234}YZ
+    X\x{11234}YZ
+    X\x{11234}YZW
+
+/X\C*/utf
+    XYZabcdce
+
+/X\C*?/utf
+    XYZabcde
+
+/X\C{3,5}/utf
+    Xabcdefg
+    X\x{1234}
+    X\x{1234}YZ
+    X\x{1234}\x{512}
+    X\x{1234}\x{512}YZ
+    X\x{11234}Y
+    X\x{11234}YZ
+    X\x{11234}\x{512}
+    X\x{11234}\x{512}YZ
+    X\x{11234}\x{512}\x{11234}Z
+
+/X\C{3,5}?/utf
+    Xabcdefg
+    X\x{1234}
+    X\x{1234}YZ
+    X\x{1234}\x{512}
+    X\x{11234}Y
+    X\x{11234}YZ
+    X\x{11234}\x{512}YZ
+    X\x{11234}
+
+/a\Cb/utf
+    aXb
+    a\nb
+    a\x{100}b
+
+/a\C\Cb/utf
+    a\x{100}b
+    a\x{12257}b
+    a\x{12257}\x{11234}b
+
+/ab\Cde/utf
+    abXde
+
+# This one is here not because it's different to Perl, but because the way
+# the captured single code unit is displayed. (In Perl it becomes a character,
+# and you can't tell the difference.)
+
+/X(\C)(.*)/utf
+    X\x{1234}
+    X\nabc
+
+# This one is here because Perl gives out a grumbly error message (quite
+# correctly, but that messes up comparisons).
+
+/a\Cb/utf
+\= Expect no match in 8-bit mode
+    a\x{100}b
+
+# End of testinput22
diff --git a/testdata/testinput23 b/testdata/testinput23
new file mode 100644 (file)
index 0000000..d0a9bc4
--- /dev/null
@@ -0,0 +1,7 @@
+# This test is run when PCRE2 has been built with --enable-never-backslash-C,
+# which disables the use of \C. All we can do is check that it gives the 
+# correct error message.
+
+/a\Cb/
+
+# End of testinput23
index 2e1fbf515b052b37e3b82e450865d5d078567d55..71e95fec4ae07825bc4405d9329475ec279159ca 100644 (file)
@@ -8,35 +8,35 @@
 #forbid_utf
 
 /^[\w]+/
-    *** Failers
+\= Expect no match
     École
 
 /^[\w]+/locale=fr_FR
     École
 
 /^[\w]+/
-    *** Failers
+\= Expect no match
     École
 
 /^[\W]+/
     École
 
 /^[\W]+/locale=fr_FR
-    *** Failers
+\= Expect no match
     École
 
 /[\b]/
     \b
-    *** Failers
+\= Expect no match
     a
 
 /[\b]/locale=fr_FR
     \b
-    *** Failers
+\= Expect no match
     a
 
 /^\w+/
-    *** Failers
+\= Expect no match
     École
 
 /^\w+/locale=fr_FR
     École
 
 /(.+)\b(.+)/locale=fr_FR
-    *** Failers
+\= Expect no match
     École
 
 /École/i
     École
-    *** Failers
+\= Expect no match
     école
 
 /École/i,locale=fr_FR
@@ -72,7 +72,7 @@
 
 /^[\xc8-\xc9]/
     École
-    *** Failers 
+\= Expect no match
     école
 
 /\W+/
index 421b3fbd32bd9ad0775f05b00ddb5b154a0e0d9a..ce9145d25433e23bf162df54c593978a5616bdd7 100644 (file)
@@ -3,20 +3,21 @@
 # some of the property tests may differ because of different versions of
 # Unicode in use by PCRE2 and Perl.
 
+#newline_default lf anycrlf any
 #perltest
 
 /a.b/utf
     acb
     a\x7fb
     a\x{100}b
-    *** Failers
+\= Expect no match
     a\nb
 
 /a(.{3})b/utf
     a\x{4000}xyb
     a\x{4000}\x7fyb
     a\x{4000}\x{100}yb
-    *** Failers
+\= Expect no match
     a\x{4000}b
     ac\ncb
 
@@ -54,7 +55,7 @@
     a\x{1234}xyb
     a\x{1234}\x{4321}yb
     a\x{1234}\x{4321}\x{3412}b
-    *** Failers
+\= Expect no match
     a\x{1234}b
     ac\ncb
 
@@ -64,7 +65,7 @@
     a\x{1234}\x{4321}\x{3412}b
     axxxxbcdefghijb
     a\x{1234}\x{4321}\x{3412}\x{3421}b
-    *** Failers
+\= Expect no match
     a\x{1234}b
 
 /a(.{3,}?)b/utf
@@ -73,7 +74,7 @@
     a\x{1234}\x{4321}\x{3412}b
     axxxxbcdefghijb
     a\x{1234}\x{4321}\x{3412}\x{3421}b
-    *** Failers
+\= Expect no match
     a\x{1234}b
 
 /a(.{3,5})b/utf
@@ -84,7 +85,7 @@
     a\x{1234}\x{4321}\x{3412}\x{3421}b
     axbxxbcdefghijb
     axxxxxbcdefghijb
-    *** Failers
+\= Expect no match
     a\x{1234}b
     axxxxxxbcdefghijb
 
     a\x{1234}\x{4321}\x{3412}\x{3421}b
     axbxxbcdefghijb
     axxxxxbcdefghijb
-    *** Failers
+\= Expect no match
     a\x{1234}b
     axxxxxxbcdefghijb
 
 /^[a\x{c0}]/utf
-    *** Failers
+\= Expect no match
     \x{100}
 
 /(?<=aXb)cd/utf
 
 /(?:\x{100}){3}b/utf
     \x{100}\x{100}\x{100}b
-    *** Failers
+\= Expect no match
     \x{100}\x{100}b
 
 /\x{ab}/utf
     \x{ab}
     \xc2\xab
-    *** Failers
+\= Expect no match
     \x00{ab}
 
 /(?<=(.))X/utf
     WXYZ
     \x{256}XYZ
-    *** Failers
+\= Expect no match
     XYZ
 
 /[^a]+/g,utf
 
 /\D+/utf
     12abcd34
-    *** Failers
+\= Expect no match
     1234
 
 /\D{2,3}/utf
     12abcd34
     12ab34
-    *** Failers
+\= Expect no match
     1234
     12a34
 
 /\D{2,3}?/utf
     12abcd34
     12ab34
-    *** Failers
+\= Expect no match
     1234
     12a34
 
 /\d+/utf
     12abcd34
-    *** Failers
 
 /\d{2,3}/utf
     12abcd34
     1234abcd
-    *** Failers
+\= Expect no match
     1.4
 
 /\d{2,3}?/utf
     12abcd34
     1234abcd
-    *** Failers
+\= Expect no match
     1.4
 
 /\S+/utf
     12abcd34
-    *** Failers
+\= Expect no match
     \    \
 
 /\S{2,3}/utf
     12abcd34
     1234abcd
-    *** Failers
+\= Expect no match
     \     \
 
 /\S{2,3}?/utf
     12abcd34
     1234abcd
-    *** Failers
+\= Expect no match
     \     \
 
 />\s+</utf,aftertext
     12>      <34
-    *** Failers
 
 />\s{2,3}</utf,aftertext
     ab>  <cd
     ab>   <ce
-    *** Failers
+\= Expect no match
     ab>    <cd
 
 />\s{2,3}?</utf,aftertext
     ab>  <cd
     ab>   <ce
-    *** Failers
+\= Expect no match
     ab>    <cd
 
 /\w+/utf
     12      34
-    *** Failers
+\= Expect no match
     +++=*!
 
 /\w{2,3}/utf
     ab  cd
     abcd ce
-    *** Failers
+\= Expect no match
     a.b.c
 
 /\w{2,3}?/utf
     ab  cd
     abcd ce
-    *** Failers
+\= Expect no match
     a.b.c
 
 /\W+/utf
     12====34
-    *** Failers
+\= Expect no match
     abcd
 
 /\W{2,3}/utf
     ab====cd
     ab==cd
-    *** Failers
+\= Expect no match
     a.b.c
 
 /\W{2,3}?/utf
     ab====cd
     ab==cd
-    *** Failers
+\= Expect no match
     a.b.c
 
 /[\x{100}]/utf
     \x{100}
     Z\x{100}
     \x{100}Z
-    *** Failers
 
 /[Z\x{100}]/utf
     Z\x{100}
     \x{100}
     \x{100}Z
-    *** Failers
 
 /[\x{100}\x{200}]/utf
-   ab\x{100}cd
-   ab\x{200}cd
-   *** Failers
+    ab\x{100}cd
+    ab\x{200}cd
 
 /[\x{100}-\x{200}]/utf
-   ab\x{100}cd
-   ab\x{200}cd
-   ab\x{111}cd
-   *** Failers
+    ab\x{100}cd
+    ab\x{200}cd
+    ab\x{111}cd
 
 /[z-\x{200}]/utf
-   ab\x{100}cd
-   ab\x{200}cd
-   ab\x{111}cd
-   abzcd
-   ab|cd
-   *** Failers
+    ab\x{100}cd
+    ab\x{200}cd
+    ab\x{111}cd
+    abzcd
+    ab|cd
 
 /[Q\x{100}\x{200}]/utf
-   ab\x{100}cd
-   ab\x{200}cd
-   Q?
-   *** Failers
+    ab\x{100}cd
+    ab\x{200}cd
+    Q?
 
 /[Q\x{100}-\x{200}]/utf
-   ab\x{100}cd
-   ab\x{200}cd
-   ab\x{111}cd
-   Q?
-   *** Failers
+    ab\x{100}cd
+    ab\x{200}cd
+    ab\x{111}cd
+    Q?
 
 /[Qz-\x{200}]/utf
-   ab\x{100}cd
-   ab\x{200}cd
-   ab\x{111}cd
-   abzcd
-   ab|cd
-   Q?
-   *** Failers
+    ab\x{100}cd
+    ab\x{200}cd
+    ab\x{111}cd
+    abzcd
+    ab|cd
+    Q?
 
 /[\x{100}\x{200}]{1,3}/utf
-   ab\x{100}cd
-   ab\x{200}cd
-   ab\x{200}\x{100}\x{200}\x{100}cd
-   *** Failers
+    ab\x{100}cd
+    ab\x{200}cd
+    ab\x{200}\x{100}\x{200}\x{100}cd
 
 /[\x{100}\x{200}]{1,3}?/utf
-   ab\x{100}cd
-   ab\x{200}cd
-   ab\x{200}\x{100}\x{200}\x{100}cd
-   *** Failers
+    ab\x{100}cd
+    ab\x{200}cd
+    ab\x{200}\x{100}\x{200}\x{100}cd
 
 /[Q\x{100}\x{200}]{1,3}/utf
-   ab\x{100}cd
-   ab\x{200}cd
-   ab\x{200}\x{100}\x{200}\x{100}cd
-   *** Failers
+    ab\x{100}cd
+    ab\x{200}cd
+    ab\x{200}\x{100}\x{200}\x{100}cd
 
 /[Q\x{100}\x{200}]{1,3}?/utf
-   ab\x{100}cd
-   ab\x{200}cd
-   ab\x{200}\x{100}\x{200}\x{100}cd
-   *** Failers
+    ab\x{100}cd
+    ab\x{200}cd
+    ab\x{200}\x{100}\x{200}\x{100}cd
 
 /(?<=[\x{100}\x{200}])X/utf
     abc\x{200}X
     abc\x{100}X
-    *** Failers
+\= Expect no match
     X
 
 /(?<=[Q\x{100}\x{200}])X/utf
     abc\x{200}X
     abc\x{100}X
     abQX
-    *** Failers
+\= Expect no match
     X
 
 /(?<=[\x{100}\x{200}]{3})X/utf
     abc\x{100}\x{200}\x{100}X
-    *** Failers
+\= Expect no match
     abc\x{200}X
     X
 
     AX
     \x{150}X
     \x{500}X
-    *** Failers
+\= Expect no match
     \x{100}X
     \x{200}X
 
     AX
     \x{150}X
     \x{500}X
-    *** Failers
+\= Expect no match
     \x{100}X
     \x{200}X
     QX
 /[^\x{100}-\x{200}]X/utf
     AX
     \x{500}X
-    *** Failers
+\= Expect no match
     \x{100}X
     \x{150}X
     \x{200}X
     z
     Z
     \x{100}
-    *** Failers
+\= Expect no match
     \x{102}
     y
 
     \x{123}
 
 /^[ac]*b/utf
+\= Expect no match
   xb
 
 /^[ac\x{100}]*b/utf
+\= Expect no match
   xb
 
 /^[^x]*b/i,utf
+\= Expect no match
   xb
 
 /^[^x]*b/utf
+\= Expect no match
   xb
 
 /^\d*b/utf
+\= Expect no match
   xb
 
 /(|a)/g,utf
     AAB\x{123}BAA
 
 /(abc)\1/i,utf
+\= Expect no match
    abc
 
 /(abc)\1/utf
+\= Expect no match
    abc
 
 /a(*:a\x{1234}b)/utf,mark
 
 /^\d*\w{4}/utf
     1234
+\= Expect no match     
     123
 
 /^[^b]*\w{4}/utf
     aaaa
+\= Expect no match     
     aaa
 
 /^[^b]*\w{4}/i,utf
     aaaa
+\= Expect no match     
     aaa
 
 /^\x{100}*.{4}/utf
     \x{100}\x{100}\x{100}\x{100}
+\= Expect no match     
     \x{100}\x{100}\x{100}
 
 /^\x{100}*.{4}/i,utf
     \x{100}\x{100}\x{100}\x{100}
+\= Expect no match     
     \x{100}\x{100}\x{100}
 
 /^a+[a\x{200}]/utf
 /^\pC\pL\pM\pN\pP\pS\pZ</utf
     \x7f\x{c0}\x{30f}\x{660}\x{66c}\x{f01}\x{1680}<
     \np\x{300}9!\$ < 
-    ** Failers 
+\= Expect no match     
     ap\x{300}9!\$ < 
   
 /^\PC/utf
     X
-    ** Failers 
+\= Expect no match     
     \x7f
   
 /^\PL/utf
     9
-    ** Failers 
+\= Expect no match     
     \x{c0}
   
 /^\PM/utf
     X
-    ** Failers 
+\= Expect no match     
     \x{30f}
   
 /^\PN/utf
     X
-    ** Failers 
+\= Expect no match     
     \x{660}
   
 /^\PP/utf
     X
-    ** Failers 
+\= Expect no match 
     \x{66c}
   
 /^\PS/utf
     X
-    ** Failers 
+\= Expect no match 
     \x{f01}
   
 /^\PZ/utf
     X
-    ** Failers 
+\= Expect no match 
     \x{1680}
     
 /^\p{Cc}/utf
     \x{017}
     \x{09f} 
-    ** Failers
+\= Expect no match
     \x{0600} 
   
 /^\p{Cf}/utf
     \x{601}
-    ** Failers
+\= Expect no match
     \x{09f} 
   
 /^\p{Cn}/utf
     \x{e0000}
-    ** Failers
+\= Expect no match
     \x{09f} 
   
 /^\p{Co}/utf
     \x{f8ff}
-    ** Failers
+\= Expect no match
     \x{09f} 
   
 /^\p{Ll}/utf
     a
-    ** Failers 
+\= Expect no match 
     Z
     \x{e000}  
   
 /^\p{Lm}/utf
     \x{2b0}
-    ** Failers
+\= Expect no match
     a 
   
 /^\p{Lo}/utf
     \x{4d00}
     \x{4db4}
     \x{4db5}     
-    ** Failers
+\= Expect no match
     a 
     \x{2b0}
     \x{4db6} 
   
 /^\p{Lt}/utf
     \x{1c5}
-    ** Failers
+\= Expect no match
     a 
     \x{2b0}
   
 /^\p{Lu}/utf
     A
-    ** Failers
+\= Expect no match
     \x{2b0}
   
 /^\p{Mc}/utf
     \x{903}
-    ** Failers
+\= Expect no match
     X
     \x{300}
        
 /^\p{Me}/utf
     \x{488}
-    ** Failers
+\= Expect no match
     X
     \x{903}
     \x{300}
   
 /^\p{Mn}/utf
     \x{300}
-    ** Failers
+\= Expect no match
     X
     \x{903}
   
     0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665}\x{666}\x{667}\x{668}\x{669}\x{66a}
     \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6}\x{6f7}\x{6f8}\x{6f9}\x{6fa}
     \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d}\x{96e}\x{96f}\x{970}
-    ** Failers
+\= Expect no match
     X
   
 /^\p{Nl}/utf
     \x{16ee}
-    ** Failers
+\= Expect no match
     X
     \x{966}
   
 /^\p{No}/utf
     \x{b2}
     \x{b3}
-    ** Failers
+\= Expect no match
     X
     \x{16ee}
   
 /^\p{Pc}/utf
     \x5f
     \x{203f}
-    ** Failers
+\= Expect no match
     X
     -
     \x{58a}
 /^\p{Pd}/utf
     -
     \x{58a}
-    ** Failers
+\= Expect no match
     X
     \x{203f}
   
     ]
     }
     \x{f3b}
-    ** Failers
+\= Expect no match
     X
     \x{203f}
     (
 /^\p{Pf}/utf
     \x{bb}
     \x{2019}
-    ** Failers
+\= Expect no match
     X
     \x{203f}
   
 /^\p{Pi}/utf
     \x{ab}
     \x{2018}
-    ** Failers
+\= Expect no match
     X
     \x{203f}
   
 /^\p{Po}/utf
     !
     \x{37e}
-    ** Failers
+\= Expect no match
     X
     \x{203f}
   
     [
     {
     \x{f3c}
-    ** Failers
+\= Expect no match
     X
     )
     ]
   
 /^\p{Sk}/utf
     \x{2c2}
-    ** Failers
+\= Expect no match
     X
     \x{9f2}
   
 /^\p{Sm}+/utf
     +<|~\x{ac}\x{2044}
-    ** Failers
+\= Expect no match
     X
     \x{9f2}
   
 /^\p{So}/utf
     \x{a6}
     \x{482} 
-    ** Failers
+\= Expect no match
     X
     \x{9f2}
   
 /^\p{Zl}/utf
     \x{2028}
-    ** Failers
+\= Expect no match
     X
     \x{2029}
   
 /^\p{Zp}/utf
     \x{2029}
-    ** Failers
+\= Expect no match
     X
     \x{2028}
   
 /\p{Nd}+(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}+?(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}{2,}(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}{2,}?(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}*(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}*?(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}{2}(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}{2,3}(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}{2,3}?(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}?(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}??(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}*+(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}*+(...)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}*+(....)/utf
-      ** Failers
-      \x{660}\x{661}\x{662}ABC
+\= Expect no match
+    \x{660}\x{661}\x{662}ABC
   
 /(?<=A\p{Nd})XYZ/utf
     A2XYZ
     123A5XYZPQR
     ABA\x{660}XYZpqr
-    ** Failers
+\= Expect no match
     AXYZ
     XYZ     
     
     1XYZ
     AB=XYZ.. 
     XYZ 
-    ** Failers
+\= Expect no match
     WXYZ 
 
 /[\P{Nd}]+/utf
     abcd
-    ** Failers
+\= Expect no match
     1234
 
 /\D+/utf
-    11111111111111111111111111111111111111111111111111111111111111111111111
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+    11111111111111111111111111111111111111111111111111111111111111111111111
      
 /\P{Nd}+/utf
-    11111111111111111111111111111111111111111111111111111111111111111111111
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+    11111111111111111111111111111111111111111111111111111111111111111111111
 
 /[\D]+/utf
-    11111111111111111111111111111111111111111111111111111111111111111111111
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+    11111111111111111111111111111111111111111111111111111111111111111111111
 
 /[\P{Nd}]+/utf
-    11111111111111111111111111111111111111111111111111111111111111111111111
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+    11111111111111111111111111111111111111111111111111111111111111111111111
 
 /[\D\P{Nd}]+/utf
-    11111111111111111111111111111111111111111111111111111111111111111111111
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+    11111111111111111111111111111111111111111111111111111111111111111111111
 
 /\pL/utf
     a
 /\p{Lu}/utf
     A
     aZ
-    ** Failers
+\= Expect no match
     abc   
 
 /\p{Ll}/utf
     a
     Az
-    ** Failers
+\= Expect no match
     ABC   
 
 /A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
-    ** Failers
+\= Expect no match
     a\x{391}\x{10427}\x{ff3a}\x{1fb0}   
     A\x{3b1}\x{10427}\x{ff3a}\x{1fb0}
     A\x{391}\x{1044F}\x{ff3a}\x{1fb0}
     A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C 
 
 /^\X(.)/utf
-    *** Failers
+\= Expect no match
     A\x{300}\x{301}\x{302}
 
 /^\X{2,3}(.)/utf
 
 /^\p{Han}+/utf
     \x{2e81}\x{3007}\x{2f804}\x{31a0}
-    ** Failers
+\= Expect no match
     \x{2e7f}  
 
 /^\P{Katakana}+/utf
     \x{3105}
-    ** Failers
+\= Expect no match
     \x{30ff}  
 
 /^[\p{Arabic}]/utf
     \x{06e9}
     \x{060b}
-    ** Failers
+\= Expect no match
     X\x{06e9}   
 
 /^[\P{Yi}]/utf
     \x{2f800}
-    ** Failers
+\= Expect no match
     \x{a014}
     \x{a4c6}   
     
 /^\p{Any}X/utf
     AXYZ
     \x{1234}XYZ 
-    ** Failers
+\= Expect no match
     X  
     
 /^\P{Any}X/utf
-    ** Failers
+\= Expect no match
     AX
     
 /^\p{Any}?X/utf
     XYZ
     AXYZ
     \x{1234}XYZ 
-    ** Failers
+\= Expect no match
     ABXYZ   
 
 /^\P{Any}?X/utf
     XYZ
-    ** Failers
+\= Expect no match
     AXYZ
     \x{1234}XYZ 
     ABXYZ   
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
-    ** Failers
+\= Expect no match
     XYZ
 
 /^\P{Any}+X/utf
-    ** Failers
+\= Expect no match
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
-    ** Failers
 
 /^\P{Any}*X/utf
     XYZ
-    ** Failers
+\= Expect no match
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
 /^[\p{Any}]X/utf
     AXYZ
     \x{1234}XYZ 
-    ** Failers
+\= Expect no match
     X  
     
 /^[\P{Any}]X/utf
-    ** Failers
+\= Expect no match
     AX
     
 /^[\p{Any}]?X/utf
     XYZ
     AXYZ
     \x{1234}XYZ 
-    ** Failers
+\= Expect no match
     ABXYZ   
 
 /^[\P{Any}]?X/utf
     XYZ
-    ** Failers
+\= Expect no match
     AXYZ
     \x{1234}XYZ 
     ABXYZ   
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
-    ** Failers
+\= Expect no match
     XYZ
 
 /^[\P{Any}]+X/utf
-    ** Failers
+\= Expect no match
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
-    ** Failers
 
 /^[\P{Any}]*X/utf
     XYZ
-    ** Failers
+\= Expect no match
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
     \x{1234}\n\r\x{3456}xyz 
 
 /^\P{Any}{3,5}?/utf
-    ** Failers
+\= Expect no match
     abcdefgh
     \x{1234}\n\r\x{3456}xyz 
 
      AXY
      aXY
      \x{1c5}XY
-     ** Failers
-     \x{1bb}XY
-     \x{2b0}XY
-     !XY      
+\= Expect no match
+    \x{1bb}XY
+    \x{2b0}XY
+    !XY      
 
 /^[\p{L&}]X/utf
-     AXY
-     aXY
+    AXY
+    aXY
      \x{1c5}XY
-     ** Failers
-     \x{1bb}XY
-     \x{2b0}XY
-     !XY      
+\= Expect no match
+    \x{1bb}XY
+    \x{2b0}XY
+    !XY      
 
 /^\p{L&}+X/utf
-     AXY
-     aXY
-     AbcdeXyz 
-     \x{1c5}AbXY
-     abcDEXypqreXlmn 
-     ** Failers
-     \x{1bb}XY
-     \x{2b0}XY
-     !XY      
+    AXY
+    aXY
+    AbcdeXyz 
+    \x{1c5}AbXY
+    abcDEXypqreXlmn 
+\= Expect no match
+    \x{1bb}XY
+    \x{2b0}XY
+    !XY      
 
 /^[\p{L&}]+X/utf
-     AXY
-     aXY
-     AbcdeXyz 
-     \x{1c5}AbXY
-     abcDEXypqreXlmn 
-     ** Failers
-     \x{1bb}XY
-     \x{2b0}XY
-     !XY      
+    AXY
+    aXY
+    AbcdeXyz 
+    \x{1c5}AbXY
+    abcDEXypqreXlmn 
+\= Expect no match
+    \x{1bb}XY
+    \x{2b0}XY
+    !XY      
 
 /^\p{L&}+?X/utf
-     AXY
-     aXY
-     AbcdeXyz 
-     \x{1c5}AbXY
-     abcDEXypqreXlmn 
-     ** Failers
-     \x{1bb}XY
-     \x{2b0}XY
-     !XY      
+    AXY
+    aXY
+    AbcdeXyz 
+    \x{1c5}AbXY
+    abcDEXypqreXlmn 
+\= Expect no match
+    \x{1bb}XY
+    \x{2b0}XY
+    !XY      
 
 /^[\p{L&}]+?X/utf
-     AXY
-     aXY
-     AbcdeXyz 
-     \x{1c5}AbXY
-     abcDEXypqreXlmn 
-     ** Failers
-     \x{1bb}XY
-     \x{2b0}XY
-     !XY      
+    AXY
+    aXY
+    AbcdeXyz 
+    \x{1c5}AbXY
+    abcDEXypqreXlmn 
+\= Expect no match
+    \x{1bb}XY
+    \x{2b0}XY
+    !XY      
 
 /^\P{L&}X/utf
-     !XY
-     \x{1bb}XY
-     \x{2b0}XY
-     ** Failers
-     \x{1c5}XY
-     AXY      
+    !XY
+    \x{1bb}XY
+    \x{2b0}XY
+\= Expect no match
+    \x{1c5}XY
+    AXY      
 
 /^[\P{L&}]X/utf
-     !XY
-     \x{1bb}XY
-     \x{2b0}XY
-     ** Failers
-     \x{1c5}XY
-     AXY      
+    !XY
+    \x{1bb}XY
+    \x{2b0}XY
+\= Expect no match
+    \x{1c5}XY
+    AXY      
 
 /^(\p{Z}[^\p{C}\p{Z}]+)*$/
     \xa0!
     123abc\xc4\xc5zz
 
 /\X{1,3}\d/
-  \x8aBCD
+\= Expect no match
+    \x8aBCD
   
 /\X?\d/
-  \x8aBCD 
+\= Expect no match
+    \x8aBCD 
 
 /\P{L}?\d/
-  \x8aBCD 
+\= Expect no match
+    \x8aBCD 
 
 /[\PPP\x8a]{1,}\x80/
     A\x80
     \x{6e9} 
     \x{6ef}
     \x{6fa}  
-    ** Failers
+\= Expect no match
     \x{650}
     \x{651}  
     \x{652}  
     \x{654}
     \x{655}
     \x{200c} 
-    ** Failers
+\= Expect no match
     \x{64a}
     \x{656}     
 
     \x{1049d}
     \x{104a0}
     \x{104a9}
-    ** Failers
+\= Expect no match
     \x{1049e}
     \x{1049f}
     \x{104aa}           
 
 /\x{a77d}\x{1d79}/utf
     \x{a77d}\x{1d79}
-    ** Failers 
+\= Expect no match 
     \x{1d79}\x{a77d} 
 
 /(A)\1/i,utf
     .+\x{a1}\x{a0}
 
 /\p{Zs}*?\R/
-    ** Failers
+\= Expect no match
     a\xFCb   
 
 /\p{Zs}*\R/
-    ** Failers 
+\= Expect no match 
     a\xFCb   
 
 /ⱥ/i,utf
     \x{1111}\x{ae4c}\x{1111}\x{ae4c}\x{1111}\x{ae4c}\x{1111}\x{ae4c}X
 
 /\X*Z/utf,no_start_optimize
-  A\x{300}
+\= Expect no match
+    A\x{300}
 
 /\X*(.)/utf,no_start_optimize
-  A\x{1111}\x{ae4c}\x{1169}
+    A\x{1111}\x{ae4c}\x{1169}
 
 # --------------------------------------------
 
 
 /^\p{Any}*\d{4}/utf
     1234
+\= Expect no match
     123 
 
 /^\X*\w{4}/utf
     1234
+\= Expect no match
     123  
 
 /^A\s+Z/utf,ucp
     \x{1d173}\x{1d174}\x{1d175}\x{1d176}\x{1d177}\x{1d178}\x{1d179}\x{1d17a}
     \x{e0001}
     \x{e0020}\x{e0030}\x{e0040}\x{e0050}\x{e0060}\x{e0070}\x{e007f}
-    ** Failers
+\= Expect no match
     \x{09}
     \x{0a}
     \x{1D}
     \x{1d173}\x{1d174}\x{1d175}\x{1d176}\x{1d177}\x{1d178}\x{1d179}\x{1d17a}
     \x{e0001}
     \x{e0020}\x{e0030}\x{e0040}\x{e0050}\x{e0060}\x{e0070}\x{e007f}
-    ** Failers
+\= Expect no match
     \x{09}
     \x{1D}
     \x{85}
     !\"#%&'()*,-./:;?@[\\]_{}
     \x{a1}\x{a7}  
     \x{37e} 
-    ** Failers
+\= Expect no match
     abcde  
 
 /^[[:^graph:]]+$/utf,ucp
     \x{09}\x{0a}\x{1D}\x{20}\x{85}\x{a0}\x{1680}
     \x{2028}\x{2029}\x{202f}\x{2065}
     \x{3000}\x{e0002}\x{e001f}\x{e0080}
-    ** Failers
+\= Expect no match
     Letter:ABC
     Mark:\x{300}\x{1d172}\x{1d17b}
     Number:9\x{660}
 /^[[:^print:]]+$/utf,ucp
     \x{09}\x{1D}\x{85}\x{2028}\x{2029}\x{2065}
     \x{e0002}\x{e001f}\x{e0080}
-    ** Failers
+\= Expect no match
     Space: \x{a0}
     \x{1680}\x{2000}\x{2001}\x{2002}\x{2003}\x{2004}\x{2005}
     \x{2006}\x{2007}\x{2008}\x{2009}\x{200a} 
 
 /^[[:^punct:]]+$/utf,ucp
     abcde  
-    ** Failers
+\= Expect no match
     \$+<=>^`|~
     !\"#%&'()*,-./:;?@[\\]_{}
     \x{a1}\x{a7}  
     \x{23a}\x{23a}\x{2c65}\x{23a}
 
 /^(\x{23a})\1*(....)/i,utf
+\= Expect no match
     \x{23a}\x{2c65}\x{2c65}\x{2c65}
     \x{23a}\x{23a}\x{2c65}\x{23a}
 
 
 "[\S\V\H]"utf
 
-/\C\X*TӅ;\r
-{0,6}\v+\rF
-/utf
-    Ӆ\x0a
+/[^\p{Any}]*+x/utf
+    x
 
-/\C(\W?ſ)'?{{/utf
-    \\C(\\W?ſ)'?{{
+/[[:punct:]]/utf,ucp
+    \x{b4} 
+
+/[[:^ascii:]]/utf,ucp
+    \x{100}
+    \x{200}
+    \x{300}
+    \x{37e}
+\= Expect no match     
+    aa
+    99
+    
+/[[:^ascii:]\w]/utf,ucp
+    aa
+    99
+    gg
+    \x{100}
+    \x{200}
+    \x{300}
+    \x{37e}
+
+/[\w[:^ascii:]]/utf,ucp
+    aa
+    99
+    gg
+    \x{100}
+    \x{200}
+    \x{300}
+    \x{37e}
+
+/[^[:ascii:]\W]/utf,ucp
+    \x{100}
+    \x{200}
+\= Expect no match     
+    aa
+    99
+    gg
+    \x{37e}
+
+/[^[:^ascii:]\d]/utf,ucp
+    a
+    ~
+    \a
+    \x{7f}
+\= Expect no match
+    0
+    \x{389}
+    \x{20ac}
 
 # End of testinput4
index 7e2ba45d6b2a9a206a67350397695fdc63dee905..2e13a7c452712a23e7868d9556a3453d5b096f86 100644 (file)
 # test 4.
 
 /^[\p{Arabic}]/utf
-    ** Failers
+\= Expect no match
     \x{061c}
     
 /^[[:graph:]]+$/utf,ucp
-    ** Failers
+\= Expect no match
     \x{61c}
     \x{2066}
     \x{2067}
@@ -23,7 +23,7 @@
     \x{2069}
 
 /^[[:print:]]+$/utf,ucp
-    ** Failers
+\= Expect no match
     \x{61c}
     \x{2066}
     \x{2067}
@@ -54,6 +54,7 @@
     A\x{85}\x{2005}Z
     
 /^[[:graph:]]+$/utf,ucp
+\= Expect no match
     \x{180e}
 
 /^[[:print:]]+$/utf,ucp
@@ -63,6 +64,7 @@
     \x{09}\x{0a}\x{1D}\x{20}\x{85}\x{a0}\x{61c}\x{1680}\x{180e}
 
 /^[[:^print:]]+$/utf,ucp
+\= Expect no match
     \x{180e}
 
 # End of U+180E tests.
 /.{3,5}?/IB,utf
     \x{212ab}\x{212ab}\x{212ab}\x{861}
 
-/(?<=\C)X/utf
-    Should produce an error diagnostic
-    
 /^[ab]/IB,utf
     bar
-    *** Failers
+\= Expect no match
     c
     \x{ff}
     \x{100}  
     c
     \x{ff}
     \x{100}  
-    *** Failers 
+\= Expect no match 
     aaa
   
 /\x{100}*(\d+|"(?1)")/utf
     "\x{100}1234"  
     \x{100}\x{100}12ab 
     \x{100}\x{100}"12" 
-    *** Failers 
+\= Expect no match 
     \x{100}\x{100}abcd
 
 /\x{100}*/IB,utf
 /[Ā-Ą]/utf
     \x{100}
     \x{104}
-    *** Failers
+\= Expect no match
     \x{105}
     \x{ff}    
 
     a\x{85}b   
     a\x{2028}b 
     a\x{2029}b 
-    ** Failers
+\= Expect no match
     a\n\rb    
 
 /^a\R*b/bsr=unicode,utf
     a\x{85}b   
     a\n\rb    
     a\n\r\x{85}\x0cb 
-    ** Failers
+\= Expect no match
     ab  
 
 /^a\R{1,3}b/bsr=unicode,utf
     a\r\n\r\n\r\nb 
     a\n\r\n\rb
     a\n\n\r\nb 
-    ** Failers
+\= Expect no match
     a\n\n\n\rb
     a\r
 
 /\H\h\V\v/utf
     X X\x0a
     X\x09X\x0b
-    ** Failers
+\= Expect no match
     \x{a0} X\x0a   
     
 /\H*\h+\V?\v{3,4}/utf
     \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a
     \x09\x20\x{a0}\x0a\x0b\x0c\x0d\x0a
     \x09\x20\x{a0}\x0a\x0b\x0c
-    ** Failers 
+\= Expect no match 
     \x09\x20\x{a0}\x0a\x0b
      
 /\H\h\V\v/utf
     \x{3001}\x{3000}\x{2030}\x{2028}
     X\x{180e}X\x{85}
-    ** Failers
+\= Expect no match
     \x{2009} X\x0a   
     
 /\H*\h+\V?\v{3,4}/utf
     \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x0c\x0d\x0a
     \x09\x{205f}\x{a0}\x0a\x{2029}\x0c\x{2028}\x0a
     \x09\x20\x{202f}\x0a\x0b\x0c
-    ** Failers 
+\= Expect no match 
     \x09\x{200a}\x{a0}\x{2028}\x0b
      
 /[\h]/B,utf
     a\rb
     a\nb
     a\r\nb
-    ** Failers
+\= Expect no match
     a\x{85}b
     a\x0bb     
 
     a\rb
     a\nb
     a\r\nb
-    ** Failers
+\= Expect no match
     a\x{85}b
     a\x0bb     
 
     a\r\nb
     a\x{85}b
     a\x0bb     
-    ** Failers 
  
 /.*a.*=.b.*/utf,newline=any
     QQQ\x{2029}ABCaXYZ=!bPQR
-    ** Failers
+\= Expect no match
     a\x{2029}b
     \x61\xe2\x80\xa9\x62 
 
 /a[^]b/utf,alt_bsux,allow_empty_class,match_unset_backref
     a\x{1234}b
     a\nb 
-    ** Failers
+\= Expect no match
     ab  
     
 /a[^]+b/utf,alt_bsux,allow_empty_class,match_unset_backref
     aXb
     a\nX\nX\x{1234}b 
-    ** Failers
+\= Expect no match
     ab  
 
 /(\x{de})\1/
     X\x{123}\x{123}\x{123}\x{123}\=ps
     
 /X\x{123}{2,4}b/utf
+\= Expect no match
     Xx\=ps
     X\x{123}x\=ps
     X\x{123}\x{123}x\=ps
     X\x{123}\x{123}\x{123}\x{123}x\=ps
     
 /X\x{123}{2,4}?b/utf
+\= Expect no match
     Xx\=ps
     X\x{123}x\=ps
     X\x{123}\x{123}x\=ps
     X\x{123}\x{123}\x{123}\x{123}x\=ps
     
 /X\x{123}{2,4}+b/utf
+\= Expect no match
     Xx\=ps
     X\x{123}x\=ps
     X\x{123}\x{123}x\=ps
 /(?<=\x{1234}\x{1234})\bxy/I,utf
 
 /(?<!^)ETA/utf
+\= Expect no match
     ETA
 
 /\u0100/B,utf,alt_bsux,allow_empty_class,match_unset_backref
     1234
     12-34
     12+\x{661}-34  
-    ** Failers
+\= Expect no match
     abcd  
 
 /(?:[\PPa*]*){8,}/
 
 /^\p{Cs}/utf
     \x{dfff}\=no_utf_check
-    ** Failers
+\= Expect no match
     \x{09f} 
   
 /^\p{Mn}/utf
 /^\p{Sc}+/utf
     $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6}
     \x{9f2}
-    ** Failers
+\= Expect no match
     X
     \x{2c2}
   
     \x{1680}
     \x{2000}
     \x{2001}     
-    ** Failers
+\= Expect no match
     \x{2028}
     \x{200d} 
   
       
 /\p{^Lu}/i,utf
     1234
-    ** Failers
+\= Expect no match
     ABC 
 
 /\P{Lu}/i,utf
     1234
-    ** Failers
+\= Expect no match
     ABC 
 
 /\p{Ll}/i,utf
     a
     Az
-    ** Failers
+\= Expect no match
     ABC   
 
 /\p{Lu}/i,utf
     A
     a\x{10a0}B 
-    ** Failers 
+\= Expect no match 
     a
     \x{1d00}  
 
 /\p{Lu}/i,utf
     A
     aZ
-    ** Failers
+\= Expect no match
     abc   
 
 /[\x{c0}\x{391}]/i,utf
     \x{6ca}
     \x{a6c}
     \x{10a7}   
-    ** Failers
+\= Expect no match
     _ABC   
 
 /^\p{Xan}+/utf
     ABCD1234\x{6ca}\x{a6c}\x{10a7}_
-    ** Failers
+\= Expect no match
     _ABC   
 
 /^\p{Xan}+?/utf
     \x{6ca}
     \x{a6c}
     \x{10a7}   
-    ** Failers
+\= Expect no match
     _ABC   
  
 /^[\p{Xan}]+/utf
     ABCD1234\x{6ca}\x{a6c}\x{10a7}_
-    ** Failers
+\= Expect no match
     _ABC   
 
 /^>\p{Xsp}/utf
     >\x{1680}\x{2028}\x{0b}
     >\x{a0} 
-    ** Failers
+\= Expect no match
     \x{0b} 
 
 /^>\p{Xsp}+/utf
 /^>\p{Xps}/utf
     >\x{1680}\x{2028}\x{0b}
     >\x{a0} 
-    ** Failers
+\= Expect no match
     \x{0b} 
 
 /^>\p{Xps}+/utf
     \x{a6c}
     \x{10a7}
     _ABC    
-    ** Failers
+\= Expect no match
     [] 
 
 /^\p{Xwd}+/utf
     \x{a6c}
     \x{10a7}   
     _ABC 
-    ** Failers
+\= Expect no match
     []   
  
 /^[\p{Xwd}]+/utf
 
 /\b...\B/utf
     abc_
-    ** Failers 
+\= Expect no match 
     \x{37e}abc\x{376} 
     \x{37e}\x{376}\x{371}\x{393}\x{394} 
     !\x{c0}++\x{c1}\x{c2} 
 # These behaved oddly in Perl, so they are kept in this test 
 
 /(\x{23a}\x{23a}\x{23a})?\1/i,utf
+\= Expect no match
     \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}
 
 /(ȺȺȺ)?\1/i,utf
+\= Expect no match
     ȺȺȺⱥⱥ
 
 /(\x{23a}\x{23a}\x{23a})?\1/i,utf
     ȺȺȺⱥⱥⱥ
 
 /(\x{23a}\x{23a}\x{23a})\1/i,utf
+\= Expect no match
     \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}
 
 /(ȺȺȺ)\1/i,utf
+\= Expect no match
     ȺȺȺⱥⱥ
 
 /(\x{23a}\x{23a}\x{23a})\1/i,utf
 /^[\p{Batak}]/utf
     \x{1bc0}
     \x{1bff}
-    ** Failers
+\= Expect no match
     \x{1bf4}
     
 /^[\p{Brahmi}]/utf
     \x{11000}
     \x{1106f}
-    ** Failers
+\= Expect no match
     \x{1104e}
     
 /^[\p{Mandaic}]/utf
     \x{840}
     \x{85e}
-    ** Failers
+\= Expect no match
     \x{85c}
     \x{85d}    
 
 
 /^a\X41z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     aX41z
-    *** Failers
+\= Expect no match
     aAz
 
-/(?<=ab\Cde)X/utf
-
 /\X/
     a\=ps
     a\=ph
     \x{3a3}\x{3c3}\x{3c2}\x{3a3}\x{3c3}\x{3c2}
 
 /\x{3a3}++./i,utf,aftertext
-    ** Failers
+\= Expect no match
     \x{3a3}\x{3c3}\x{3c2}\x{3a3}\x{3c3}\x{3c2}
 
 /\x{3a3}*\x{3c2}/Bi,utf
 /[^a]*\x{3c2}/Bi,utf
 
 /ist/Bi,utf
+\= Expect no match
     ikt
 
 /is+t/i,utf
     iSs\x{17f}t
+\= Expect no match
     ikt
 
 /is+?t/i,utf
+\= Expect no match
     ikt
 
 /is?t/i,utf
+\= Expect no match
     ikt
 
 /is{2}t/i,utf
+\= Expect no match
     iskt
     
 # This property is a PCRE special 
     @abc
     `abc
     \x{1234}abc
-    ** Failers
+\= Expect no match
     abc     
 
 /^\p{Xuc}+/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^\p{Xuc}+?/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^\p{Xuc}+?\*/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^\p{Xuc}++/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^\p{Xuc}{3,5}/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^\p{Xuc}{3,5}?/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^[\p{Xuc}]/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^[\p{Xuc}]+/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^\P{Xuc}/utf
     abc
-    ** Failers
+\= Expect no match
     $abc
     @abc
     `abc
 
 /^[\P{Xuc}]/utf
     abc
-    ** Failers
+\= Expect no match
     $abc
     @abc
     `abc
 
 /[\p{L}ab]{2,3}+/B,no_auto_possess
 
-/\D+\X \d+\X \S+\X \s+\X \W+\X \w+\X \C+\X \R+\X \H+\X \h+\X \V+\X \v+\X a+\X \n+\X .+\X/Bx
+/\D+\X \d+\X \S+\X \s+\X \W+\X \w+\X \R+\X \H+\X \h+\X \V+\X \v+\X a+\X \n+\X .+\X/Bx
 
 /.+\X/Bsx
 
 /\X+$/Bmx
 
-/\X+\D \X+\d \X+\S \X+\s \X+\W \X+\w \X+. \X+\C \X+\R \X+\H \X+\h \X+\V \X+\v \X+\X \X+\Z \X+\z \X+$/Bx
+/\X+\D \X+\d \X+\S \X+\s \X+\W \X+\w \X+. \X+\R \X+\H \X+\h \X+\V \X+\v \X+\X \X+\Z \X+\z \X+$/Bx
 
 /\d+\s{0,5}=\s*\S?=\w{0,4}\W*/B,utf,ucp
 
     123ábc123
 
 /(?<=abc)(|def)/g,utf,replace=<$0>
-      123abcáyzabcdef789abcሴqr
-
-/[^\xff]((?1))/utf,debug
+    123abcáyzabcdef789abcሴqr
 
 /[A-`]/iB,utf
     abcdefghijklmno
 
 /$(&.+[\p{Me}].\s\xdcC*?(?(<y>))(?<!^)$C((;*?(R))+(?(R)){0,6}?|){12\x8a\X*?\x8a\x0b\xd1^9\3*+(\xc1,\k'P'\xb4)\xcc(z\z(?JJ)(?'X'8};(\x0b\xd1^9\?'3*+(\xc1.]k+\x0b'Pm'\xb4\xcc4'\xd1'(?'X'))?-%--\x95$9*\4'|\xd1(''%\x95*$9)#(?'R')3\x07?('P\xed')\\x16:;()\x1e\x10*:(?<y>)\xd1+!~:(?)''(d'E:yD!\s(?'R'\x1e;\x10:U))|')g!\xb0*){29+))#(?'P'})*?/
 
+"(*UTF)(*UCP)(.UTF).+X(\V+;\^(\D|)!999}(?(?C{7(?C')\H*\S*/^\x5\xa\\xd3\x85n?(;\D*(?m).[^mH+((*UCP)(*U:F)})(?!^)(?'"
+
+/[\pS#moq]/
+    =
+
+/(*:a\x{12345}b\t(d\)c)xxx/utf,alt_verbnames,mark
+    cxxxz
+
+/abcd/utf,replace=x\x{824}y\o{3333}z(\Q12\$34$$\x34\E5$$),substitute_extended
+    abcd
+
+/a(\x{e0}\x{101})(\x{c0}\x{102})/utf,replace=a\u$1\U$1\E$1\l$2\L$2\Eab\U\x{e0}\x{101}\L\x{d0}\x{160}\EDone,substitute_extended
+    a\x{e0}\x{101}\x{c0}\x{102}
+
+/((?<digit>\d)|(?<letter>\p{L}))/g,substitute_extended,replace=<${digit:+digit; :not digit; }${letter:+letter:not a letter}>
+    ab12cde
+
+/[\W\p{Any}]/B
+    abc
+    123 
+
+/[\W\pL]/B
+    abc
+\= Expect no match
+    123     
+
+/(*UCP)(*UTF)[[:>:]]X/B
+
+/abc/utf,replace=xyz
+    abc\=zero_terminate
+
+/a[[:punct:]b]/ucp,bincode
+
+/a[[:punct:]b]/utf,ucp,bincode
+
+/a[b[:punct:]]/utf,ucp,bincode
+
+/[[:^ascii:]]/utf,ucp,bincode
+
+/[[:^ascii:]\w]/utf,ucp,bincode
+
+/[\w[:^ascii:]]/utf,ucp,bincode
+
+/[^[:ascii:]\W]/utf,ucp,bincode
+    \x{de}
+    \x{200}
+\= Expect no match     
+    \x{300}
+    \x{37e}
+
+/[[:^ascii:]a]/utf,ucp,bincode
+
+/L(?#(|++<!(2)?/B,utf,no_auto_possess,auto_callout
+
+/L(?#(|++<!(2)?/B,utf,ucp,auto_callout
+
+/(*UTF)C\x09((?<!'(?x)!*H? #\xcc\x9a[^$]/
+
 # End of testinput5 
index 2651c91420364965360a375ad5cac0df8dfc7c66..c24b40fa3f656a4a05d33a57a5cba723b3f3ca43 100644 (file)
@@ -4,6 +4,7 @@
     
 #forbid_utf
 #subject dfa
+#newline_default lf anycrlf any
      
 /abc/
     abc
@@ -16,7 +17,7 @@
 /ab+c/
     abc
     abbbbbbc
-    *** Failers 
+\= Expect no match 
     ac
     ab
     
     
 /^abc/
     abcdef
-    *** Failers
+\= Expect no match
     xyzabc
     xyz\nabc    
     
 /^abc/m
     abcdef
     xyz\nabc    
-    *** Failers
+\= Expect no match
     xyzabc
     
 /\Aabc/
     abcdef
-    *** Failers
+\= Expect no match
     xyzabc
     xyz\nabc    
     
 /\Aabc/m
     abcdef
-    *** Failers
+\= Expect no match
     xyzabc
     xyz\nabc    
     
 /\Gabc/
     abcdef
     xyzabc\=offset=3
-    *** Failers
+\= Expect no match
     xyzabc    
     xyzabc\=offset=2
     
 /x\dy\Dz/
     x9yzz
     x0y+z
-    *** Failers
+\= Expect no match
     xyz
     xxy0z     
     
 /x\sy\Sz/
     x yzz
     x y+z
-    *** Failers
+\= Expect no match
     xyz
     xxyyz
     
 /x\wy\Wz/
     xxy+z
-    *** Failers
+\= Expect no match
     xxy0z
     x+y+z         
     
 /x.y/
     x+y
     x-y
-    *** Failers
+\= Expect no match
     x\ny
     
 /x.y/s
     a+bc+dp+q
     a+bc\ndp+q
     x\nyp+q 
-    *** Failers 
+\= Expect no match 
     a\nbc\ndp+q
     a+bc\ndp\nq
     x\nyp\nq 
 
 /a\d\z/
     ba0
-    *** Failers
+\= Expect no match
     ba0\n
     ba0\ncd   
 
 /a\d\z/m
     ba0
-    *** Failers
+\= Expect no match
     ba0\n
     ba0\ncd   
 
 /a\d\Z/
     ba0
     ba0\n
-    *** Failers
+\= Expect no match
     ba0\ncd   
 
 /a\d\Z/m
     ba0
     ba0\n
-    *** Failers
+\= Expect no match
     ba0\ncd   
 
 /a\d$/
     ba0
     ba0\n
-    *** Failers
+\= Expect no match
     ba0\ncd   
 
 /a\d$/m
     ba0
     ba0\n
     ba0\ncd   
-    *** Failers
 
 /abc/i
     abc
     axxyz
     axxxyzq
     axxxxyzq
-    *** Failers
+\= Expect no match
     ax
     axx     
       
 /x{3}yz/
     axxxyzq
     axxxxyzq
-    *** Failers
+\= Expect no match
     ax
     axx     
     ayzq
     axxyz
     axxxyzq
     axxxxyzq
-    *** Failers
+\= Expect no match
     ax
     axx     
     ayzq
 /[^a]+/no_auto_possess
     bac
     bcdefax
-    *** Failers
+\= Expect no match
     aaaaa   
 
 /[^a]*/no_auto_possess
     bac
     bcdefax
-    *** Failers
     aaaaa   
     
 /[^a]{3,5}/no_auto_possess
     awxyza
     abcdefa
     abcdefghijk
-    *** Failers
+\= Expect no match
     axya
     axa
     aaaaa         
      
 /\d+/
     ab1234c56
-    *** Failers
+\= Expect no match
     xyz
     
 /\D+/
     ab123c56
-    *** Failers
+\= Expect no match
     789
     
 /\d?A/
     045ABC
     ABC
-    *** Failers
+\= Expect no match
     XYZ
     
 /\D?A/
     ABC
     BAC
     9ABC             
-    *** Failers
 
 /a+/
     aaaa
 /^.+xyz/
     abcdxyz
     axyz
-    *** Failers
+\= Expect no match
     xyz
     
 /^.?xyz/
 /^\d{2,3}X/
     12X
     123X
-    *** Failers
+\= Expect no match
     X
     1X
     1234X     
     b93
     c99z
     d04
-    *** Failers
+\= Expect no match
     e45
     abcd      
     abcd1234
     d04
     abcd1234
     1234  
-    *** Failers
+\= Expect no match
     e45
     abcd      
 
     c99z
     d04
     abcd1234
-    *** Failers
+\= Expect no match
     1234  
     e45
     abcd      
     c99z
     d04
     1234  
-    *** Failers
+\= Expect no match
     abcd1234
     e45
 
 /^[abcd]{2,3}\d/
     ab45
     bcd93
-    *** Failers
+\= Expect no match
     1234 
     a36 
     abcd1234
     abc45
     abcabcabc45
     42xyz 
-    *** Failers
 
 /^(abc)+\d/
     abc45
     abcabcabc45
-    *** Failers
+\= Expect no match
     42xyz 
 
 /^(abc)?\d/
     abc45
     42xyz 
-    *** Failers
+\= Expect no match
     abcabcabc45
 
 /^(abc){2,3}\d/
     abcabc45
     abcabcabc45
-    *** Failers
+\= Expect no match
     abcabcabcabc45
     abc45
     42xyz 
     abc
     a(b)c
     a(b(c))d  
-    *** Failers)
+\= Expect no match)
     a(b(c)d  
 
 /^>abc>([^()]|\((?1)*\))*<xyz<$/
 
 /^(?>a*)\d/
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876
-    *** Failers 
+\= Expect no match 
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
 /< (?: (?(R) \d++  | [^<>]*+) | (?R)) * >/x
     <abc <def> hij>
     <abc<>def> 
     <abc<>      
-    *** Failers
+\= Expect no match
     <abc
 
 /^(?(?=abc)\w{3}:|\d\d)$/
     abc:                          
     12                             
-    *** Failers                     
+\= Expect no match                     
     123                       
     xyz                        
                                 
 /^(?(?!abc)\d\d|\w{3}:)$/
     abc:                        
     12         
-    *** Failers
+\= Expect no match
     123
     xyz    
 
 /^(?=abc)\w{5}:$/
     abcde:                          
-    *** Failers                     
+\= Expect no match                     
     abc.. 
     123                       
     vwxyz                        
                                 
 /^(?!abc)\d\d$/
     12         
-    *** Failers
+\= Expect no match
     abcde:
     abc..  
     123
 /(?<=abc|xy)123/
     abc12345
     wxy123z
-    *** Failers
+\= Expect no match
     123abc
 
 /(?<!abc|xy)123/
     123abc
     mno123456 
-    *** Failers
+\= Expect no match
     abc12345
     wxy123z
 
 
 /^abc/
     abcdef
-    *** Failers
+\= Expect no match
     abcdef\=notbol
 
 /^(a*|xyz)/
     aaabcd
     xyz
     xyz\=notempty
-    *** Failers
+\= Expect no match
     bcd\=notempty
     
 /xyz$/
     xyz
     xyz\n
-    *** Failers
+\= Expect no match
     xyz\=noteol
     xyz\n\=noteol
     
     abcxyz\npqr 
     abcxyz\npqr\=noteol
     xyz\n\=noteol
-    *** Failers
+\= Expect no match
     xyz\=noteol
 
 /\Gabc/
     abcdef
     defabcxyz\=offset=3
-    *** Failers 
+\= Expect no match 
     defabcxyz
 
 /^abcdef/
     ab\=ps
     abcde\=ps
     abcdef\=ps
-    *** Failers
+\= Expect no match
     abx\=ps
 
 /^a{2,4}\d+z/
     aaaa12345\=ps
     aa0z\=ps
     aaaa4444444444444z\=ps
-    *** Failers
+\= Expect no match
     az\=ps
     aaaaa\=ps
     a56\=ps
    def\=dfa_restart
    
 /(?<=foo)bar/
-   xyzfo\=ps
    foob\=ps,offset=2
    foobar...\=ps,dfa_restart,offset=4
-   xyzfo\=ps
    foobar\=offset=2
-   *** Failers
+\= Expect no match
    xyzfo\=ps
    obar\=dfa_restart
 
 /(ab*(cd|ef))+X/
-    adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\=ps,noteol
     lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\=ps,notbol,noteol
     cdabbbbbbbb\=ps,notbol,dfa_restart,noteol
     efabbbbbbbbbbbbbbbb\=ps,notbol,dfa_restart,noteol
     bbbbbbbbbbbbcdXyasdfadf\=ps,notbol,dfa_restart,noteol
+\= Expect no match
+    adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\=ps,noteol
 
 /the quick brown fox/
     the quick brown fox
-    The quick brown FOX
     What do you know about the quick brown fox?
+\= Expect no match
+    The quick brown FOX
     What do you know about THE QUICK BROWN FOX?
 
 /The quick brown fox/i
     >>>aaabxyzpqrrrabbxyyyypqAzz
     >aaaabxyzpqrrrabbxyyyypqAzz
     >>>>abcxyzpqrrrabbxyyyypqAzz
-    *** Failers
+\= Expect no match
     abxyzpqrrabbxyyyypqAzz
     abxyzpqrrrrabbxyyyypqAzz
     abxyzpqrrrabxyyyypqAzz
 /^(abc){1,2}zz/
     abczz
     abcabczz
-    *** Failers
+\= Expect no match
     zz
     abcabcabczz
     >>abczz
     aac
     abbbbbbbbbbbc
     bbbbbbbbbbbac
-    *** Failers
+\= Expect no match
     aaac
     abbbbbbbbbbbac
 
     aac
     abbbbbbbbbbbc
     bbbbbbbbbbbac
-    *** Failers
+\= Expect no match
     aaac
     abbbbbbbbbbbac
 
     babc
     bbabc
     bababc
-    *** Failers
+\= Expect no match
     bababbc
     babababc
 
     babc
     bbabc
     bababc
-    *** Failers
+\= Expect no match
     bababbc
     babababc
 
     cthing
     dthing
     ething
-    *** Failers
+\= Expect no match
     fthing
     [thing
     \\thing
     cthing
     dthing
     ething
-    *** Failers
+\= Expect no match
     athing
     fthing
 
     fthing
     [thing
     \\thing
-    *** Failers
+\= Expect no match
     athing
     bthing
     ]thing
 /^[^]cde]/
     athing
     fthing
-    *** Failers
+\= Expect no match
     ]thing
     cthing
     dthing
     9
     10
     100
-    *** Failers
+\= Expect no match
     abc
 
 /^.*nter/
 /^xxx[0-9]+$/
     xxx0
     xxx1234
-    *** Failers
+\= Expect no match
     xxx
 
 /^.+[0-9][0-9][0-9]$/
     x123
     xx123
     123456
-    *** Failers
-    123
     x1234
+\= Expect no match
+    123
 
 /^.+?[0-9][0-9][0-9]$/
     x123
     xx123
     123456
-    *** Failers
-    123
     x1234
+\= Expect no match
+    123
 
 /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
     abc!pqr=apquxz.ixr.zzz.ac.uk
-    *** Failers
+\= Expect no match
     !pqr=apquxz.ixr.zzz.ac.uk
     abc!=apquxz.ixr.zzz.ac.uk
     abc!pqr=apquxz:ixr.zzz.ac.uk
 
 /:/
     Well, we need a colon: somewhere
-    *** Fail if we don't
+\= Expect no match
+    No match without a colon
 
 /([\da-f:]+)$/i
     0abc
     5f03:12C0::932e
     fed def
     Any old stuff
-    *** Failers
+\= Expect no match
     0zzz
     gzzz
     fed\x20
 /^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/
     .1.2.3
     A.12.123.0
-    *** Failers
+\= Expect no match
     .1.2.3333
     1.2.3
     1234.2.3
 /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
     1 IN SOA non-sp1 non-sp2(
     1    IN    SOA    non-sp1    non-sp2   (
-    *** Failers
+\= Expect no match
     1IN SOA non-sp1 non-sp2(
 
 /^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/
     ab-c.pq-r.
     sxk.zzz.ac.uk.
     x-.y-.
-    *** Failers
+\= Expect no match
     -abc.peq.
 
 /^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/
     *.b0-a
     *.c3-b.c
     *.c-a.b-c
-    *** Failers
+\= Expect no match
     *.0
     *.a-
     *.a-b.c-
     \"1234\"
     \"abcd\" ;
     \"\" ; rhubarb
-    *** Failers
+\= Expect no match
     \"1234\" : things
 
 /^$/
     \
-    *** Failers
 
 /   ^    a   (?# begins with a)  b\sc (?# then b c) $ (?# then end)/x
     ab c
-    *** Failers
+\= Expect no match
     abc
     ab cde
 
 /(?x)   ^    a   (?# begins with a)  b\sc (?# then b c) $ (?# then end)/
     ab c
-    *** Failers
+\= Expect no match
     abc
     ab cde
 
 /^   a\ b[c ]d       $/x
     a bcd
     a b d
-    *** Failers
+\= Expect no match
     abcd
     ab d
 
     1234567890
     12345678ab
     12345678__
-    *** Failers
+\= Expect no match
     1234567
 
 /^[aeiou\d]{4,5}$/
     1234
     12345
     aaaaa
-    *** Failers
+\= Expect no match
     123456
 
 /^[aeiou\d]{4,5}?/
 /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/
     From abcd  Mon Sep 01 12:33:02 1997
     From abcd  Mon Sep  1 12:33:02 1997
-    *** Failers
+\= Expect no match
     From abcd  Sep 01 12:33:02 1997
 
 /^12.34/s
 
 /^(\D*)(?=\d)(?!123)/
     abc456
-    *** Failers
+\= Expect no match
     abc123
 
 /^1234(?# test newlines
 
 /(?!^)abc/
     the abc
-    *** Failers
+\= Expect no match
     abc
 
 /(?=^)abc/
     abc
-    *** Failers
+\= Expect no match
     the abc
 
 /^[ab]{1,3}(ab*|b)/no_auto_possess
     A. Other <user.1234\@dom.ain> (a comment)
     \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
     A missing angle <user\@some.where
-    *** Failers
+\= Expect no match
     The quick brown fox
 
 /[\040\t]*                    # Nab whitespace.
     A. Other <user.1234\@dom.ain> (a comment)
     \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
     A missing angle <user\@some.where
-    *** Failers
+\= Expect no match
     The quick brown fox
 
 /abc\0def\00pqr\000xyz\0000AB/
 /A\x0{2,3}Z/
     The A\x0\x0Z
     An A\0\x0\0Z
-    *** Failers
+\= Expect no match
     A\0Z
     A\0\x0\0\x0Z
 
     \nabc
     \rabc
     \tabc
-    *** Failers
+\= Expect no match
     abc
 
 /^a    b
     abbbbc
     abbbc
     abbc
-    *** Failers
+\= Expect no match
     abc
     abbbbbc
 
 
 /^[W-c]+$/
     WXY_^abc
-    *** Failers
+\= Expect no match
     wxy
 
 /^[W-c]+$/i
 
 /^abc$/
     abc
-    *** Failers
+\= Expect no match
     qqq\nabc
     abc\nzzz
     qqq\nabc\nzzz
 /\Aabc\Z/m
     abc
     abc\n 
-    *** Failers
+\= Expect no match
     qqq\nabc
     abc\nzzz
     qqq\nabc\nzzz
     abc\ndef
 
 /\A(.)*\Z/m
-    *** Failers
+\= Expect no match
     abc\ndef
 
 /(?:b)|(?::+)/
 
 /[-az]+/
     az-
-    *** Failers
+\= Expect no match
     b
 
 /[az-]+/
     za-
-    *** Failers
+\= Expect no match
     b
 
 /[a\-z]+/
     a-z
-    *** Failers
+\= Expect no match
     b
 
 /[a-z]+/
 
 /[\d-]+/
     12-34
-    *** Failers
+\= Expect no match
     aaa
 
 /[\d-z]+/
     12-34z
-    *** Failers
+\= Expect no match
     aaa
 
 /\x5c/
 
 /\x20Z/
     the Zoo
-    *** Failers
+\= Expect no match
     Zulu
 
 /ab{3cd/
 
 /^a.b/newline=lf
     a\rb
-    *** Failers
+\= Expect no match
     a\nb
 
 /abc$/
     abc
     abc\n
-    *** Failers
+\= Expect no match
     abc\ndef
 
 /(abc)\123/
     baNOTcccd
     baNOTccd
     bacccd
-    *** Failers
+\= Expect no match
     anything
     b\bc   
     baccd
    
 /[^k]$/
     abc
-    *** Failers
+\= Expect no match
     abk   
    
 /[^k]{2,3}$/
     abc
     kbc
     kabc 
-    *** Failers
+\= Expect no match
     abk
     akb
     akk 
 /^\d{8,}\@.+[^k]$/
     12345678\@a.b.c.d
     123456789\@x.y.z
-    *** Failers
+\= Expect no match
     12345678\@x.y.uk
     1234567\@a.b.c.d       
 
 /(\.\d\d((?=0)|\d(?=\d)))/
     1.230003938      
     1.875000282
-    *** Failers 
+\= Expect no match 
     1.235 
     
 /a(?)b/
      
 /^(\D*)(?=\d)(?!123)/
     ABC445
-    *** Failers
+\= Expect no match
     ABC123
     
 /^[W-]46]/
     W46]789 
     -46]789
-    *** Failers
+\= Expect no match
     Wall
     Zebra
     42
     [abcd] 
     ]abcd[
     \\backslash 
-    *** Failers
+\= Expect no match
     -46]789
     well
     
 
 /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
   word cat dog elephant mussel cow horse canary baboon snake shark otherword
+\= Expect no match
   word cat dog elephant mussel cow horse canary baboon snake shark
 
 /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
+\= Expect no match
   word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
 
 /^(a){0,0}/
     aaaaaaaa    
 
 /^(a){1,1}/
-    bcd
     abc
     aab  
+\= Expect no match
+    bcd
 
 /^(a){1,2}/
-    bcd
     abc
     aab  
+\= Expect no match
+    bcd
 
 /^(a){1,3}/
-    bcd
     abc
     aab
     aaa   
+\= Expect no match
+    bcd
 
 /^(a){1,}/
-    bcd
     abc
     aab
     aaa
     aaaaaaaa    
+\= Expect no match
+    bcd
 
 /.*\.gif/
     borfle\nbib.gif\nno
 /(.*X|^B)/
     abcde\n1234Xyz
     BarFoo 
-    *** Failers
+\= Expect no match
     abcde\nBar  
 
 /(.*X|^B)/m
 /(.*X|^B)/s
     abcde\n1234Xyz
     BarFoo 
-    *** Failers
+\= Expect no match
     abcde\nBar  
 
 /(.*X|^B)/ms
 /(?s)(.*X|^B)/
     abcde\n1234Xyz
     BarFoo 
-    *** Failers 
+\= Expect no match 
     abcde\nBar  
 
 /(?s:.*X|^B)/
     abcde\n1234Xyz
     BarFoo 
-    *** Failers 
+\= Expect no match 
     abcde\nBar  
 
 /^.*B/
-    **** Failers
+\= Expect no match
     abc\nB
      
 /(?s)^.*B/
 
 /^[abcdefghijklmnopqrstuvwxy0123456789]/
     n
-    *** Failers 
+\= Expect no match 
     z 
 
 /abcde{0,0}/
     abcd
-    *** Failers
+\= Expect no match
     abce  
 
 /ab[cd]{0,0}e/
     abe
-    *** Failers
+\= Expect no match
     abcde 
     
 /ab(c){0,0}d/
     abd
-    *** Failers
+\= Expect no match
     abcd   
 
 /a(b*)/
     a
     ab
     abbbb
-    *** Failers
+\= Expect no match
     bbbbb    
     
 /ab\d{0}e/
     abe
-    *** Failers
+\= Expect no match
     ab1e   
     
 /"([^\\"]+|\\.)*"/
     
 /a.b/
     acb
-    *** Failers 
+\= Expect no match 
     a\nb   
     
 /a[^a]b/s
     bbbbbac 
     
 /(?!\A)x/m
-    x\nb\n
     a\bx\n  
+\= Expect no match
+    x\nb\n
     
 /\x0{ab}/
     \0{ab} 
     catfood
     arfootle
     rfoosh
-    *** Failers
+\= Expect no match
     barfoo
     towbarfoo
 
 /\w{3}(?<!bar)foo/
     catfood
-    *** Failers
+\= Expect no match
     foo
     barfoo
     towbarfoo
 
 /(?<=(foo)a)bar/
     fooabar
-    *** Failers
+\= Expect no match
     bar
     foobbar
       
 /\Aabc\z/m
     abc
-    *** Failers
+\= Expect no match
     abc\n   
     qqq\nabc
     abc\nzzz
     qqq\nabc\nzzz
 
 "(?>.*/)foo"
+\= Expect no match
     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
 
 "(?>.*/)foo"
 /(?>(\.\d\d[1-9]?))\d+/
     1.230003938
     1.875000282
-    *** Failers 
+\= Expect no match 
     1.235 
 
 /^((?>\w+)|(?>\s+))*$/
     now is the time for all good men to come to the aid of the party
-    *** Failers
+\= Expect no match
     this is not a line with only words and spaces!
     
 /(\d+)(\w)/
 
 /((?>\d+))(\w)/
     12345a
-    *** Failers
+\= Expect no match
     12345+ 
 
 /(?>a+)b/
 /\(((?>[^()]+)|\([^()]+\))+\)/
     (abc)
     (abc(def)xyz)
-    *** Failers
+\= Expect no match
     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa   
 
 /a(?-i)b/i
     ab
     Ab
-    *** Failers 
+\= Expect no match 
     aB
     AB
         
 /(a (?x)b c)d e/
     a bcd e
-    *** Failers
+\= Expect no match
     a b cd e
     abcd e   
     a bcde 
  
 /(a b(?x)c d (?-x)e f)/
     a bcde f
-    *** Failers
+\= Expect no match
     abcdef  
 
 /(a(?i)b)c/
     abc
     aBc
-    *** Failers
+\= Expect no match
     abC
     aBC  
     Abc
 /a(?i:b)c/
     abc
     aBc
-    *** Failers 
+\= Expect no match 
     ABC
     abC
     aBC
 /a(?i:b)*c/
     aBc
     aBBc
-    *** Failers 
+\= Expect no match 
     aBC
     aBBC
     
 /a(?=b(?i)c)\w\wd/
     abcd
     abCd
-    *** Failers
+\= Expect no match
     aBCd
     abcD     
     
     more than million
     more than MILLION
     more \n than Million 
-    *** Failers
+\= Expect no match
     MORE THAN MILLION    
     more \n than \n million 
 
     more than million
     more than MILLION
     more \n than Million 
-    *** Failers
+\= Expect no match
     MORE THAN MILLION    
     more \n than \n million 
     
     abc
     aBbc
     aBBc 
-    *** Failers
+\= Expect no match
     Abc
     abAb    
     abbC 
 /(?=a(?i)b)\w\wc/
     abc
     aBc
-    *** Failers
+\= Expect no match
     Ab 
     abC
     aBC     
 /(?<=a(?i)b)(\w\w)c/
     abxxc
     aBxxc
-    *** Failers
+\= Expect no match
     Abxxc
     ABxxc
     abxxC      
 /^(?(?=abc)\w{3}:|\d\d)$/
     abc:
     12
-    *** Failers
+\= Expect no match
     123
     xyz    
 
 /^(?(?!abc)\d\d|\w{3}:)$/
     abc:
     12
-    *** Failers
+\= Expect no match
     123
     xyz    
     
     cat
     fcat
     focat   
-    *** Failers
+\= Expect no match
     foocat  
 
 /(?(?<!foo)cat|bar)/
     cat
     fcat
     focat   
-    *** Failers
+\= Expect no match
     foocat  
 
 /(?>a*)*/
 /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /x
     12-sep-98
     12-09-98
-    *** Failers
+\= Expect no match
     sep-12-98
         
 /(?i:saturday|sunday)/
     aBCx
     bbx
     BBx
-    *** Failers
+\= Expect no match
     abcX
     aBCX
     bbX
     Europe 
     frog
     France
-    *** Failers
+\= Expect no match
     Africa     
 
 /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/
     xY
     zebra
     Zambesi
-    *** Failers
+\= Expect no match
     aCD  
     XY  
 
 /(?<=foo\n)^bar/m
     foo\nbar
-    *** Failers
+\= Expect no match
     bar
     baz\nbar   
 
     barbaz
     barbarbaz 
     koobarbaz 
-    *** Failers
+\= Expect no match
     baz
     foobarbaz 
 
-/The following tests are taken from the Perl 5.005 test suite; some of them/
-/are compatible with 5.004, but I'd rather not have to sort them out./
+# The following tests are taken from the Perl 5.005 test suite; some of them
+# are compatible with 5.004, but I'd rather not have to sort them out.
 
 /abc/
     abc
     xabcy
     ababc
-    *** Failers
+\= Expect no match
     xbc
     axc
     abx
 
 /ab+bc/
     abbc
-    *** Failers
+\= Expect no match
     abc
     abq
 
     abbbbc
 
 /ab{4,5}bc/
-    *** Failers
+\= Expect no match
     abq
     abbbbc
 
 
 /^abc$/
     abc
-    *** Failers
+\= Expect no match
     abbbbc
     abcc
 
 
 /abc$/
     aabc
-    *** Failers
     aabc
+\= Expect no match
     aabcd
 
 /^/
 
 /a[bc]d/
     abd
-    *** Failers
+\= Expect no match
     axyzd
     abc
 
 
 /a[^bc]d/
     aed
-    *** Failers
+\= Expect no match
     abd
     abd
 
 
 /a[^]b]c/
     adc
-    *** Failers
     a-c
+\= Expect no match
     a]c
 
 /\ba\b/
     -a-
 
 /\by\b/
-    *** Failers
+\= Expect no match
     xy
     yz
     xyz
 
 /\Ba\B/
-    *** Failers
+\= Expect no match
     a-
     -a
     -a-
 
 /\W/
     -
-    *** Failers
-    -
+\= Expect no match
     a
 
 /a\sb/
 
 /a\Sb/
     a-b
-    *** Failers
-    a-b
+\= Expect no match
     a b
 
 /\d/
 
 /\D/
     -
-    *** Failers
-    -
+\= Expect no match
     1
 
 /[\w]/
 
 /[\W]/
     -
-    *** Failers
-    -
+\= Expect no match
     a
 
 /a[\s]b/
 
 /a[\S]b/
     a-b
-    *** Failers
-    a-b
+\= Expect no match
     a b
 
 /[\d]/
 
 /[\D]/
     -
-    *** Failers
-    -
+\= Expect no match
     1
 
 /ab|cd/
     a((b
 
 /a\\b/
+    a\\b
+\= Expect no match
     a\b
 
 /((a))/
     cde
 
 /abc/
-    *** Failers
+\= Expect no match
     b
-    
 
 /a*/
-    
 
 /([abc])*d/
     abbbcd
     adcdcde
 
 /a[bcd]+dcdcde/
-    *** Failers
+\= Expect no match
     abcde
     adcdcde
 
     effgz
     ij
     reffgz
-    *** Failers
+\= Expect no match
     effg
     bcdd
 
     a
 
 /multiple words of text/
-    *** Failers
+\= Expect no match
     aa
     uh-uh
 
     ABC
     XABCY
     ABABC
-    *** Failers
+\= Expect no match
     aaxabxbaxbbx
     XBC
     AXC
     ABBC
 
 /ab+bc/i
-    *** Failers
+\= Expect no match
     ABC
     ABQ
 
     ABBBBC
 
 /ab{4,5}?bc/i
-    *** Failers
+\= Expect no match
     ABQ
     ABBBBC
 
 
 /^abc$/i
     ABC
-    *** Failers
+\= Expect no match
     ABBBBC
     ABCC
 
     AXYZC
 
 /a.*c/i
-    *** Failers
     AABC
+\= Expect no match
     AXYZD
 
 /a[bc]d/i
 
 /a[b-d]e/i
     ACE
-    *** Failers
+\= Expect no match
     ABC
     ABD
 
 
 /a[^-b]c/i
     ADC
-    *** Failers
+\= Expect no match
     ABD
     A-C
 
     DEF
 
 /$b/i
-    *** Failers
+\= Expect no match
     A]C
     B
 
     A((B
 
 /a\\b/i
+\= Expect no match
     A\=notbol
 
 /((a))/i
 /abc/i
 
 /a*/i
-    
 
 /([abc])*d/i
     ABBBCD
     HIJ
 
 /^(ab|cd)e/i
+\= Expect no match
     ABCDE
 
 /(abc|)ef/i
     EFFGZ
     IJ
     REFFGZ
-    *** Failers
+\= Expect no match
     ADCDCDE
     EFFG
     BCDD
     C
 
 /multiple words of text/i
-    *** Failers
+\= Expect no match
     AA
     UH-UH
 
 
 /(?<=a)b/
     ab
-    *** Failers
+\= Expect no match
     cb
     b
 
     Ab
 
 /(?:(?i)a)b/
-    *** Failers
+\= Expect no match
     cb
     aB
 
     Ab
 
 /(?i:a)b/
-    *** Failers
+\= Expect no match
     aB
     aB
 
     aB
 
 /(?:(?-i)a)b/i
-    *** Failers
     aB
+\= Expect no match
     Ab
 
 /((?-i)a)b/i
     aB
 
 /(?:(?-i)a)b/i
-    *** Failers
+\= Expect no match
     Ab
     AB
 
     aB
 
 /(?-i:a)b/i
-    *** Failers
+\= Expect no match
     AB
     Ab
 
     aB
 
 /(?-i:a)b/i
-    *** Failers
+\= Expect no match
     Ab
     AB
 
 /((?-i:a))b/i
 
 /((?-i:a.))b/i
-    *** Failers
+\= Expect no match
     AB
     a\nB
 
     aaac
 
 /(?<![cd])b/
-    *** Failers
+\= Expect no match
     B\nB
     dbcb
 
     cdaccb
 
 /^(?:a?b?)*$/
-    *** Failers
+\= Expect no match
     dbcb
     a--
 
 /^b/
 
 /()^b/
-    *** Failers
+\= Expect no match
     a\nb\nc\n
     a\nb\nc\n
 
     a
 
 /(?(?=a)b|a)/
-    *** Failers
+\= Expect no match
     a
     a
 
 /([\w:]+::)?(\w+)$/
     abcd
     xy:z:::abcd
-    *** Failers
+\= Expect no match
     abcd:
     abcd:
 
     ((abc(ade)ufh()()x
 
 /a\Z/
-    *** Failers
+\= Expect no match
     aaab
     a\nb\n
 
 
 /b\z/
     a\nb
-    *** Failers
     
 /(?>.*)(?<=(abcd|wxyz))/
     alphabetabcd
     endingwxyz
-    *** Failers
+\= Expect no match
     a rather long string that doesn't end with one of them
 
 /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/
     word cat dog elephant mussel cow horse canary baboon snake shark otherword
+\= Expect no match
     word cat dog elephant mussel cow horse canary baboon snake shark
   
 /word (?>[a-zA-Z0-9]+ ){0,30}otherword/
+\= Expect no match
     word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
 
 /(?<=\d{3}(?!999))foo/
     999foo
     123999foo 
-    *** Failers
+\= Expect no match
     123abcfoo
     
 /(?<=(?!...999)\d{3})foo/
     999foo
     123999foo 
-    *** Failers
+\= Expect no match
     123abcfoo
 
 /(?<=\d{3}(?!999)...)foo/
     123abcfoo
     123456foo 
-    *** Failers
+\= Expect no match
     123999foo  
     
 /(?<=\d{3}...)(?<!999)foo/
     123abcfoo   
     123456foo 
-    *** Failers
+\= Expect no match
     123999foo  
 
 /((Z)+|A)*/
     abcde
     -things
     0digit
-    *** Failers
+\= Expect no match
     bcdef    
     
 /[[:space:]]+/
   a\nxb\n
 
 /(?!^)x/m
-  a\nxb\n
+\= Expect no match
+    a\nxb\n
 
 /abc\Qabc\Eabc/
     abcabcabc
 
 /   abc\Q abc\Eabc/x
     abc abcabc
-    *** Failers
+\= Expect no match
     abcabcabc  
     
 /abc#comment
 
 /\Gabc/
     abc
-    *** Failers
+\= Expect no match
     xyzabc  
 
 /\Gabc./g
 
 /a(?x: b c )d/
     XabcdY
-    *** Failers 
+\= Expect no match 
     Xa b c d Y 
 
 /((?x)x y z | a b c)/
 
 /(?i)AB(?-i)C/
     XabCY
-    *** Failers
+\= Expect no match
     XabcY  
 
 /((?i)AB(?-i)C|D)E/
     abCE
     DE
-    *** Failers
+\= Expect no match
     abcE
     abCe  
     dE
     -
     d
     ] 
-    *** Failers
+\= Expect no match
     b     
 
 /(a+)*b/
+\= Expect no match
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
     
 /(?i)reg(?:ul(?:[aä]|ae)r|ex)/
 
 /line\nbreak/firstline
     this is a line\nbreak
-    ** Failers 
+\= Expect no match 
     line one\nthis is a line\nbreak in the second line 
 
 /line\nbreak/m,firstline
     this is a line\nbreak
-    ** Failers 
+\= Expect no match 
     line one\nthis is a line\nbreak in the second line 
 
 /1234/
     123\=ps
+\= Expect no match 
     a4\=ps,dfa_restart
 
 /1234/
 /^abc/Im,newline=lf
     xyz\nabc
     xyz\r\nabc
-    ** Failers
+\= Expect no match
     xyz\rabc
     xyzabc\r
     xyzabc\rpqr
 
 /^abc/Im,newline=crlf
     xyz\r\nabclf>
-    ** Failers
+\= Expect no match
     xyz\nabclf
     xyz\rabclf
     
 /^abc/Im,newline=cr
     xyz\rabc
-    ** Failers
+\= Expect no match
     xyz\nabc
     xyz\r\nabc
 
     aaaa
 
 /(a|)*\d/
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
+\= Expect no match
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
 /(?>a|)*\d/
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
+\= Expect no match
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
 /(?:a|)*\d/
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
+\= Expect no match
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
 /^a.b/newline=lf
     a\rb
-    ** Failers
+\= Expect no match
     a\nb
 
 /^a.b/newline=cr
     a\nb
-    ** Failers
+\= Expect no match
     a\rb
 
 /^a.b/newline=anycrlf
     a\x85b
-    ** Failers
+\= Expect no match
     a\rb
 
 /^a.b/newline=any
-    ** Failers
+\= Expect no match
     a\nb
     a\rb
     a\x85b
     a\x0bb
     a\x0cb
     a\x85b   
-    ** Failers
+\= Expect no match
     a\n\rb    
 
 /^a\R*b/bsr=unicode
     a\x85b   
     a\n\rb    
     a\n\r\x85\x0cb 
-    ** Failers
+\= Expect no match
     ab  
     
 /^a\R{1,3}b/bsr=unicode
     a\r\n\r\n\r\nb 
     a\n\r\n\rb
     a\n\n\r\nb 
-    ** Failers
+\= Expect no match
     a\n\n\n\rb
     a\r
 
 /.+foo/
     afoo
-    ** Failers 
+\= Expect no match 
     \r\nfoo 
     \nfoo 
 
 /.+foo/newline=crlf
     afoo
     \nfoo 
-    ** Failers 
+\= Expect no match 
     \r\nfoo 
 
 /.+foo/newline=any
     afoo
-    ** Failers 
+\= Expect no match 
     \nfoo 
     \r\nfoo 
 
 /^$/gm,newline=any
     abc\r\rxyz
     abc\n\rxyz  
-    ** Failers 
+\= Expect no match 
     abc\r\nxyz
 
 /^X/m
     XABC
-    ** Failers 
+\= Expect no match 
     XABC\=notbol
 
 /(?m)^$/g,newline=any,aftertext
 /(?|(abc)|(xyz))(?1)/
     abcabc
     xyzabc 
-    ** Failers 
+\= Expect no match 
     xyzxyz 
  
 /\H\h\V\v/
     X X\x0a
     X\x09X\x0b
-    ** Failers
+\= Expect no match
     \xa0 X\x0a   
     
 /\H*\h+\V?\v{3,4}/
     \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a
     \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a
     \x09\x20\xa0\x0a\x0b\x0c
-    ** Failers 
+\= Expect no match 
     \x09\x20\xa0\x0a\x0b
      
 /\H{3,4}/
 /\h*X\h?\H+Y\H?Z/
     >XNNNYZ
     >  X NYQZ
-    ** Failers
+\= Expect no match
     >XYZ   
     >  X NY Z
 
     >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
 
 /.+A/newline=crlf
+\= Expect no match
     \r\nA
     
 /\nA/newline=crlf
     a\rb
     a\nb
     a\r\nb
-    ** Failers
+\= Expect no match
     a\x85b
     a\x0bb     
 
     a\rb
     a\nb
     a\r\nb
-    ** Failers
+\= Expect no match
     a\x85b
     a\x0bb     
 
     a\r\n\nb
     a\n\r\rb
     a\r\n\r\n\r\n\r\nb
-    ** Failers
+\= Expect no match
+    a\x0b\x0bb     
     a\x85\x85b
-    a\x0b\0bb     
 
 /a\R{2,4}b/I,bsr=unicode
     a\r\rb
     a\n\n\nb
     a\r\n\n\r\rb
     a\x85\x85b
-    a\x0b\0bb     
-    ** Failers 
+    a\x0b\x0bb     
+\= Expect no match 
     a\r\r\r\r\rb 
     
 /a(?!)|\wbc/
     abc 
 
 /a[]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
-    ** Failers
+\= Expect no match
     ab
 
 /a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
-    ** Failers
+\= Expect no match
     ab 
 
 /a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
-    ** Failers
+\= Expect no match
     ab 
 
 /a[^]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     aXb
     a\nb 
-    ** Failers
+\= Expect no match
     ab  
     
 /a[^]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     aXb
     a\nX\nXb 
-    ** Failers
+\= Expect no match
     ab  
 
 /X$/dollar_endonly
     X
-    ** Failers 
+\= Expect no match 
     X\n 
 
 /X$/
 /xyz/auto_callout
   xyz 
   abcxyz 
-  ** Failers 
+\= Expect no match 
   abc
   abcxypqr  
 
 /xyz/auto_callout,no_start_optimize
   abcxyz 
-  ** Failers 
+\= Expect no match 
   abc
   abcxypqr  
 
     ++++123999Y\=ps
 
 /Z(*F)/
+\= Expect no match 
     Z\=ps
     ZA\=ps
     
 /Z(?!)/
+\= Expect no match 
     Z\=ps
     ZA\=ps
 
 
 /Z(*F)Q|ZXY/
     Z\=ps
+\= Expect no match 
     ZA\=ps
     X\=ps
 
 /(abc|def|xyz)/I
     terhjk;abcdaadsfe
     the quick xyz brown fox 
-    ** Failers
+\= Expect no match
     thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd
 
 /(abc|def|xyz)/I,no_start_optimize
     terhjk;abcdaadsfe
     the quick xyz brown fox
-    ** Failers
+\= Expect no match
     thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd
 
 /abcd*/aftertext
 /(?:(?1)|B)(A(*F)|C)/
     ABCD
     CCD
-    ** Failers
+\= Expect no match
     CAD   
 
 /^(?:(?1)|B)(A(*F)|C)/
     CCD
     BCD 
-    ** Failers
+\= Expect no match
     ABCD
     CAD
     BAD    
     ac
     
 /^(?=a(*SKIP)b|ac)/
-    ** Failers
     ac
     
 /^(?=a(*THEN)b|ac)/
     
 /^(?=a(*PRUNE)b)/
     ab  
-    ** Failers 
-    ac
 
 /^(?(?!a(*SKIP)b))/
     ac
     abc\=ph
 
 /abc\B/
-    abc
     abc\=ps
     abc\=ph
+\= Expect no match 
+    abc
 
 /.+/
     abc\=offset=0
     abc\=offset=1
     abc\=offset=2
-    abc\=offset=3
+\= Bad offsets
     abc\=offset=4
     abc\=offset=-4 
+\= Expect no match 
+    abc\=offset=3
 
 /^(?:a)++\w/
      aaaab
-     ** Failers 
+\= Expect no match 
      aaaa 
      bbb 
 
 /^(?:aa|(?:a)++\w)/
      aaaab
      aaaa 
-     ** Failers 
+\= Expect no match 
      bbb 
 
 /^(?:a)*+\w/
      aaaab
      bbb 
-     ** Failers 
+\= Expect no match 
      aaaa 
 
 /^(a)++\w/
      aaaab
-     ** Failers 
+\= Expect no match 
      aaaa 
      bbb 
 
 /^(a|)++\w/
      aaaab
-     ** Failers 
+\= Expect no match 
      aaaa 
      bbb 
 
 /(?=abc){3}abc/aftertext
     abcabcabc
-    ** Failers
+\= Expect no match
     xyz  
     
 /(?=abc)+abc/aftertext
     abcabcabc
-    ** Failers
+\= Expect no match
     xyz  
     
 /(?=abc)++abc/aftertext
     abcabcabc
-    ** Failers
+\= Expect no match
     xyz  
     
 /(?=abc){0}xyz/
     xyz 
 
 /(?=abc){1}xyz/
-    ** Failers
+\= Expect no match
     xyz 
     
 /(?=(a))?./
     aaaa\=ovector=3
     aaaa\=ovector=4
 
-/ab\Cde/
-    abXde
-    
-/(?<=ab\Cde)X/
-    abZdeX
-
 /^\R/
     \r\=ps
     \r\=ph
 
 /(?(?!)a|b)/
     bbb
+\= Expect no match
     aaa 
 
 /^/gm
 /^/gm,alt_circumflex
     \n\n\n
 
+/abc/use_offset_limit
+    1234abcde\=offset_limit=100
+    1234abcde\=offset_limit=9
+    1234abcde\=offset_limit=4
+    1234abcde\=offset_limit=4,offset=4
+\= Expect no match
+    1234abcde\=offset_limit=4,offset=5
+    1234abcde\=offset_limit=3
+
+/(?<=abc)/use_offset_limit
+    1234abc\=offset_limit=7
+\= Expect no match
+    1234abc\=offset_limit=6
+
+/abcd/null_context
+    abcd\=null_context
+
 # End of testinput6
index 879a414cfb9941a7d4b8c9fbae3e816ac53af92f..ef3022358d5e2ba0c0d392c7f4f1627180b16ff6 100644 (file)
@@ -3,6 +3,7 @@
 # used to force DFA matching for all tests.
 
 #subject dfa
+#newline_default LF any anyCRLF
 
 /\x{100}ab/utf
   \x{100}ab
 /a\x{100}+b/utf
     a\x{100}b  
     a\x{100}\x{100}b  
-    *** Failers 
+\= Expect no match 
     ab
      
 /\bX/utf
     Xoanon
     +Xoanon
     \x{300}Xoanon 
-    *** Failers 
+\= Expect no match 
     YXoanon  
     
 /\BX/utf
     YXoanon
-    *** Failers
+\= Expect no match
     Xoanon
     +Xoanon    
     \x{300}Xoanon 
     X+oanon
     ZX\x{300}oanon 
     FAX 
-    *** Failers 
+\= Expect no match 
     Xoanon  
     
 /X\B/utf
     Xoanon  
-    *** Failers
+\= Expect no match
     X+oanon
     ZX\x{300}oanon 
     FAX 
@@ -54,7 +55,7 @@
     ab99
     \x{123}\x{123}45
     \x{400}\x{401}\x{402}6  
-    *** Failers
+\= Expect no match
     d99
     \x{123}\x{122}4   
     \x{400}\x{403}6  
     acb
     a\x7fb
     a\x{100}b 
-    *** Failers
+\= Expect no match
     a\nb  
 
 /a(.{3})b/utf
     a\x{4000}xyb 
     a\x{4000}\x7fyb 
     a\x{4000}\x{100}yb 
-    *** Failers
+\= Expect no match
     a\x{4000}b 
     ac\ncb 
 
     a\x{1234}xyb 
     a\x{1234}\x{4321}yb 
     a\x{1234}\x{4321}\x{3412}b 
-    *** Failers
+\= Expect no match
     a\x{1234}b 
     ac\ncb 
 
     a\x{1234}\x{4321}\x{3412}b 
     axxxxbcdefghijb 
     a\x{1234}\x{4321}\x{3412}\x{3421}b 
-    *** Failers
+\= Expect no match
     a\x{1234}b 
 
 /a(.{3,}?)b/utf
     a\x{1234}\x{4321}\x{3412}b 
     axxxxbcdefghijb 
     a\x{1234}\x{4321}\x{3412}\x{3421}b 
-    *** Failers
+\= Expect no match
     a\x{1234}b 
 
 /a(.{3,5})b/utf
     a\x{1234}\x{4321}\x{3412}\x{3421}b 
     axbxxbcdefghijb 
     axxxxxbcdefghijb 
-    *** Failers
+\= Expect no match
     a\x{1234}b 
     axxxxxxbcdefghijb 
 
     a\x{1234}\x{4321}\x{3412}\x{3421}b 
     axbxxbcdefghijb 
     axxxxxbcdefghijb 
-    *** Failers
+\= Expect no match
     a\x{1234}b 
     axxxxxxbcdefghijb 
 
 /^[a\x{c0}]/utf
-    *** Failers
+\= Expect no match
     \x{100}
 
 /(?<=aXb)cd/utf
     
 /(?:\x{100}){3}b/utf
     \x{100}\x{100}\x{100}b
-    *** Failers 
+\= Expect no match 
     \x{100}\x{100}b
 
 /\x{ab}/utf
     \x{ab} 
     \xc2\xab
-    *** Failers 
+\= Expect no match 
     \x00{ab}
 
 /(?<=(.))X/utf
     WXYZ
     \x{256}XYZ 
-    *** Failers
+\= Expect no match
     XYZ 
 
 /[^a]+/g,utf
     
 /\D+/utf
     12abcd34
-    *** Failers
+\= Expect no match
     1234  
 
 /\D{2,3}/utf
     12abcd34
     12ab34
-    *** Failers  
+\= Expect no match  
     1234
     12a34  
 
 /\D{2,3}?/utf
     12abcd34
     12ab34
-    *** Failers  
+\= Expect no match  
     1234
     12a34  
 
 /\d+/utf
     12abcd34
-    *** Failers
 
 /\d{2,3}/utf
     12abcd34
     1234abcd
-    *** Failers  
+\= Expect no match  
     1.4 
 
 /\d{2,3}?/utf
     12abcd34
     1234abcd
-    *** Failers  
+\= Expect no match  
     1.4 
 
 /\S+/utf
     12abcd34
-    *** Failers
+\= Expect no match
     \    \ 
 
 /\S{2,3}/utf
     12abcd34
     1234abcd
-    *** Failers
+\= Expect no match
     \     \  
 
 /\S{2,3}?/utf
     12abcd34
     1234abcd
-    *** Failers
+\= Expect no match
     \     \  
 
 />\s+</utf
     12>      <34
-    *** Failers
 
 />\s{2,3}</utf
     ab>  <cd
     ab>   <ce
-    *** Failers
+\= Expect no match
     ab>    <cd 
 
 />\s{2,3}?</utf
     ab>  <cd
     ab>   <ce
-    *** Failers
+\= Expect no match
     ab>    <cd 
 
 /\w+/utf
     12      34
-    *** Failers
+\= Expect no match
     +++=*! 
 
 /\w{2,3}/utf
     ab  cd
     abcd ce
-    *** Failers
+\= Expect no match
     a.b.c
 
 /\w{2,3}?/utf
     ab  cd
     abcd ce
-    *** Failers
+\= Expect no match
     a.b.c
 
 /\W+/utf
     12====34
-    *** Failers
+\= Expect no match
     abcd 
 
 /\W{2,3}/utf
     ab====cd
     ab==cd
-    *** Failers
+\= Expect no match
     a.b.c
 
 /\W{2,3}?/utf
     ab====cd
     ab==cd
-    *** Failers
+\= Expect no match
     a.b.c
 
 /[\x{100}]/utf
     \x{100}
     Z\x{100}
     \x{100}Z
-    *** Failers 
 
 /[Z\x{100}]/utf
     Z\x{100}
     \x{100}
     \x{100}Z
-    *** Failers 
 
 /[\x{100}\x{200}]/utf
    ab\x{100}cd
    ab\x{200}cd
-   *** Failers  
 
 /[\x{100}-\x{200}]/utf
    ab\x{100}cd
    ab\x{200}cd
    ab\x{111}cd 
-   *** Failers  
 
 /[z-\x{200}]/utf
    ab\x{100}cd
    ab\x{111}cd 
    abzcd
    ab|cd  
-   *** Failers  
 
 /[Q\x{100}\x{200}]/utf
    ab\x{100}cd
    ab\x{200}cd
    Q? 
-   *** Failers  
 
 /[Q\x{100}-\x{200}]/utf
    ab\x{100}cd
    ab\x{200}cd
    ab\x{111}cd 
    Q? 
-   *** Failers  
 
 /[Qz-\x{200}]/utf
    ab\x{100}cd
    abzcd
    ab|cd  
    Q? 
-   *** Failers  
 
 /[\x{100}\x{200}]{1,3}/utf
    ab\x{100}cd
    ab\x{200}cd
    ab\x{200}\x{100}\x{200}\x{100}cd
-   *** Failers  
 
 /[\x{100}\x{200}]{1,3}?/utf
    ab\x{100}cd
    ab\x{200}cd
    ab\x{200}\x{100}\x{200}\x{100}cd
-   *** Failers  
 
 /[Q\x{100}\x{200}]{1,3}/utf
    ab\x{100}cd
    ab\x{200}cd
    ab\x{200}\x{100}\x{200}\x{100}cd
-   *** Failers  
 
 /[Q\x{100}\x{200}]{1,3}?/utf
    ab\x{100}cd
    ab\x{200}cd
    ab\x{200}\x{100}\x{200}\x{100}cd
-   *** Failers  
 
 /(?<=[\x{100}\x{200}])X/utf
     abc\x{200}X
     abc\x{100}X 
-    *** Failers
+\= Expect no match
     X  
 
 /(?<=[Q\x{100}\x{200}])X/utf
     abc\x{200}X
     abc\x{100}X 
     abQX 
-    *** Failers
+\= Expect no match
     X  
 
 /(?<=[\x{100}\x{200}]{3})X/utf
     abc\x{100}\x{200}\x{100}X
-    *** Failers
+\= Expect no match
     abc\x{200}X
     X  
 
     AX
     \x{150}X
     \x{500}X 
-    *** Failers
+\= Expect no match
     \x{100}X
     \x{200}X   
 
     AX
     \x{150}X
     \x{500}X 
-    *** Failers
+\= Expect no match
     \x{100}X
     \x{200}X   
     QX 
 /[^\x{100}-\x{200}]X/utf
     AX
     \x{500}X 
-    *** Failers
+\= Expect no match
     \x{100}X
     \x{150}X
     \x{200}X   
     z
     Z 
     \x{100}
-    *** Failers
+\= Expect no match
     \x{102}
     y    
 
     \x{123} 
 
 /^[ac]*b/utf
-  xb
+\= Expect no match
+    xb
 
 /^[ac\x{100}]*b/utf
-  xb
+\= Expect no match
+    xb
 
 /^[^x]*b/i,utf
-  xb
+\= Expect no match
+    xb
 
 /^[^x]*b/utf
-  xb
+\= Expect no match
+    xb
   
 /^\d*b/utf
-  xb 
+\= Expect no match
+    xb 
 
 /(|a)/g,utf
     catac
     a\x{85}b   
     a\x{2028}b 
     a\x{2029}b 
-    ** Failers
+\= Expect no match
     a\n\rb    
 
 /^a\R*b/bsr=unicode,utf
     a\x{85}b   
     a\n\rb    
     a\n\r\x{85}\x0cb 
-    ** Failers
+\= Expect no match
     ab  
 
 /^a\R{1,3}b/bsr=unicode,utf
     a\r\n\r\n\r\nb 
     a\n\r\n\rb
     a\n\n\r\nb 
-    ** Failers
+\= Expect no match
     a\n\n\n\rb
     a\r
 
 /\H\h\V\v/utf
     X X\x0a
     X\x09X\x0b
-    ** Failers
+\= Expect no match
     \x{a0} X\x0a   
     
 /\H*\h+\V?\v{3,4}/utf,no_auto_possess
     \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a
     \x09\x20\x{a0}\x0a\x0b\x0c\x0d\x0a
     \x09\x20\x{a0}\x0a\x0b\x0c
-    ** Failers 
+\= Expect no match 
     \x09\x20\x{a0}\x0a\x0b
      
 /\H\h\V\v/utf
     \x{3001}\x{3000}\x{2030}\x{2028}
     X\x{180e}X\x{85}
-    ** Failers
+\= Expect no match
     \x{2009} X\x0a   
     
 /\H*\h+\V?\v{3,4}/utf,no_auto_possess
     \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x0c\x0d\x0a
     \x09\x{205f}\x{a0}\x0a\x{2029}\x0c\x{2028}\x0a
     \x09\x20\x{202f}\x0a\x0b\x0c
-    ** Failers 
+\= Expect no match 
     \x09\x{200a}\x{a0}\x{2028}\x0b
      
 /a\Rb/I,bsr=anycrlf,utf
     a\rb
     a\nb
     a\r\nb
-    ** Failers
+\= Expect no match
     a\x{85}b
     a\x0bb     
 
     a\rb
     a\nb
     a\r\nb
-    ** Failers
+\= Expect no match
     a\x{85}b
     a\x0bb     
 
     the cat\=ps
     the cat\=ph
 
-/ab\Cde/utf
-    abXde
-
-/(?<=ab\Cde)X/utf
-
 /./newline=crlf,utf
     \r\=ps
     \r\=ph
 
 /\pL\P{Nd}/utf
     AB
-    *** Failers
+\= Expect no match
     A0
     00
 
     AB
     A\x{300}BC
     A\x{300}\x{301}\x{302}BC
-    *** Failers
+\= Expect no match
     \x{300}
 
 /\X\X/utf
     ABC
     A\x{300}B\x{300}\x{301}C
     A\x{300}\x{301}\x{302}BC
-    *** Failers
+\= Expect no match
     \x{300}
 
 /^\pL+/utf
     abcd
     a
-    *** Failers
 
 /^\PL+/utf
     1234
     =
-    *** Failers
+\= Expect no match
     abcd
 
 /^\X+/utf
     A\x{300}\x{301}\x{302}
     A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}
     a
-    *** Failers
     \x{300}\x{301}\x{302}
 
 /\X?abc/utf
     A\x{300}abc
     A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz
     \x{300}abc
-    *** Failers
 
 /^\X?abc/utf
     abc
     A\x{300}abc
-    *** Failers
-    A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz
     \x{300}abc
+\= Expect no match
+    A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz
 
 /\X*abc/utf
     abc
     A\x{300}abc
     A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz
     \x{300}abc
-    *** Failers
 
 /^\X*abc/utf
     abc
     A\x{300}abc
     A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz
-    *** Failers
     \x{300}abc
 
 /^\pL?=./utf
     A=b
     =c
-    *** Failers
+\= Expect no match
     1=2
     AAAA=b
 
 /^\pL*=./utf
     AAAA=b
     =c
-    *** Failers
+\= Expect no match
     1=2
 
 /^\X{2,3}X/utf
     A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X
     A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X
-    *** Failers
+\= Expect no match
     X
     A\x{300}\x{301}\x{302}X
     A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X
 /^\pC\pL\pM\pN\pP\pS\pZ</utf
     \x7f\x{c0}\x{30f}\x{660}\x{66c}\x{f01}\x{1680}<
     \np\x{300}9!\$ <
-    ** Failers
+\= Expect no match
     ap\x{300}9!\$ <
   
 /^\PC/utf
     X
-    ** Failers
+\= Expect no match
     \x7f
   
 /^\PL/utf
     9
-    ** Failers
+\= Expect no match
     \x{c0}
   
 /^\PM/utf
     X
-    ** Failers
+\= Expect no match
     \x{30f}
   
 /^\PN/utf
     X
-    ** Failers
+\= Expect no match
     \x{660}
   
 /^\PP/utf
     X
-    ** Failers
+\= Expect no match
     \x{66c}
   
 /^\PS/utf
     X
-    ** Failers
+\= Expect no match
     \x{f01}
   
 /^\PZ/utf
     X
-    ** Failers
+\= Expect no match
     \x{1680}
     
 /^\p{Cc}/utf
     \x{017}
     \x{09f}
-    ** Failers
+\= Expect no match
     \x{0600}
   
 /^\p{Cf}/utf
     \x{2067}
     \x{2068}
     \x{2069}
-    ** Failers
+\= Expect no match
     \x{09f}
   
 /^\p{Cn}/utf
-    ** Failers
+\= Expect no match
     \x{09f}
   
 /^\p{Co}/utf
     \x{f8ff}
-    ** Failers
+\= Expect no match
     \x{09f}
   
 /^\p{Cs}/utf
     \x{dfff}\=no_utf_check
-    ** Failers
+\= Expect no match
     \x{09f}
   
 /^\p{Ll}/utf
     a
-    ** Failers
+\= Expect no match
     Z
     \x{e000}
   
 /^\p{Lm}/utf
     \x{2b0}
-    ** Failers
+\= Expect no match
     a
   
 /^\p{Lo}/utf
     \x{1bb}
-    ** Failers
+\= Expect no match
     a
     \x{2b0}
   
 /^\p{Lt}/utf
     \x{1c5}
-    ** Failers
+\= Expect no match
     a
     \x{2b0}
   
 /^\p{Lu}/utf
     A
-    ** Failers
+\= Expect no match
     \x{2b0}
   
 /^\p{Mc}/utf
     \x{903}
-    ** Failers
+\= Expect no match
     X
     \x{300}
        
 /^\p{Me}/utf
     \x{488}
-    ** Failers
+\= Expect no match
     X
     \x{903}
     \x{300}
 /^\p{Mn}/utf
     \x{300}
     \x{1a1b}
-    ** Failers
+\= Expect no match
     X
     \x{903}
   
     0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665}\x{666}\x{667}\x{668}\x{669}\x{66a}
     \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6}\x{6f7}\x{6f8}\x{6f9}\x{6fa}
     \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d}\x{96e}\x{96f}\x{970}
-    ** Failers
+\= Expect no match
     X
   
 /^\p{Nl}/utf
     \x{16ee}
-    ** Failers
+\= Expect no match
     X
     \x{966}
   
 /^\p{No}/utf
     \x{b2}
     \x{b3}
-    ** Failers
+\= Expect no match
     X
     \x{16ee}
   
 /^\p{Pc}/utf
     \x5f
     \x{203f}
-    ** Failers
+\= Expect no match
     X
     -
     \x{58a}
 /^\p{Pd}/utf
     -
     \x{58a}
-    ** Failers
+\= Expect no match
     X
     \x{203f}
   
     \x{f3b}
     \x{2309}
     \x{230b}
-    ** Failers
+\= Expect no match
     X
     \x{203f}
     (
 /^\p{Pf}/utf
     \x{bb}
     \x{2019}
-    ** Failers
+\= Expect no match
     X
     \x{203f}
   
 /^\p{Pi}/utf
     \x{ab}
     \x{2018}
-    ** Failers
+\= Expect no match
     X
     \x{203f}
   
 /^\p{Po}/utf
     !
     \x{37e}
-    ** Failers
+\= Expect no match
     X
     \x{203f}
   
     \x{f3c}
     \x{2308}
     \x{230a}
-    ** Failers
+\= Expect no match
     X
     )
     ]
 /^\p{Sc}+/utf
     $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6}
     \x{9f2}
-    ** Failers
+\= Expect no match
     X
     \x{2c2}
   
 /^\p{Sk}/utf
     \x{2c2}
-    ** Failers
+\= Expect no match
     X
     \x{9f2}
   
 /^\p{Sm}+/utf
     +<|~\x{ac}\x{2044}
-    ** Failers
+\= Expect no match
     X
     \x{9f2}
   
 /^\p{So}/utf
     \x{a6}
     \x{482}
-    ** Failers
+\= Expect no match
     X
     \x{9f2}
   
 /^\p{Zl}/utf
     \x{2028}
-    ** Failers
+\= Expect no match
     X
     \x{2029}
   
 /^\p{Zp}/utf
     \x{2029}
-    ** Failers
+\= Expect no match
     X
     \x{2028}
   
     \x{1680}
     \x{2000}
     \x{2001}
-    ** Failers
+\= Expect no match
     \x{2028}
     \x{200d}
   
       \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}*+(....)/utf
-      ** Failers
+\= Expect no match
       \x{660}\x{661}\x{662}ABC
   
 /\p{Lu}/i,utf
     A
     a\x{10a0}B
-    ** Failers
+\= Expect no match
     a
     \x{1d00}
 
 /\p{^Lu}/i,utf
     1234
-    ** Failers
+\= Expect no match
     ABC
 
 /\P{Lu}/i,utf
     1234
-    ** Failers
+\= Expect no match
     ABC
 
 /(?<=A\p{Nd})XYZ/utf
     A2XYZ
     123A5XYZPQR
     ABA\x{660}XYZpqr
-    ** Failers
+\= Expect no match
     AXYZ
     XYZ
     
     1XYZ
     AB=XYZ..
     XYZ
-    ** Failers
+\= Expect no match
     WXYZ
 
 /[\p{Nd}]/utf
     1234
     12-34
     12+\x{661}-34
-    ** Failers
+\= Expect no match
     abcd
 
 /[\P{Nd}]+/utf
     abcd
-    ** Failers
+\= Expect no match
     1234
 
 /\D+/utf,no_auto_possess
-    11111111111111111111111111111111111111111111111111111111111111111111111
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+    11111111111111111111111111111111111111111111111111111111111111111111111
      
 /\P{Nd}+/utf,no_auto_possess
-    11111111111111111111111111111111111111111111111111111111111111111111111
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+    11111111111111111111111111111111111111111111111111111111111111111111111
 
 /[\D]+/utf,no_auto_possess
-    11111111111111111111111111111111111111111111111111111111111111111111111
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+    11111111111111111111111111111111111111111111111111111111111111111111111
 
 /[\P{Nd}]+/utf,no_auto_possess
-    11111111111111111111111111111111111111111111111111111111111111111111111
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+    11111111111111111111111111111111111111111111111111111111111111111111111
 
 /[\D\P{Nd}]+/utf,no_auto_possess
-    11111111111111111111111111111111111111111111111111111111111111111111111
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+    11111111111111111111111111111111111111111111111111111111111111111111111
 
 /\pL/utf
     a
 /\p{Lu}/utf
     A
     aZ
-    ** Failers
+\= Expect no match
     abc
 
 /\p{Lu}/i,utf
     A
     aZ
-    ** Failers
+\= Expect no match
     abc
 
 /\p{Ll}/utf
     a
     Az
-    ** Failers
+\= Expect no match
     ABC
 
 /\p{Ll}/i,utf
     a
     Az
-    ** Failers
+\= Expect no match
     ABC
 
 /^\x{c0}$/i,utf
 
 /A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
-    ** Failers
+\= Expect no match
     a\x{391}\x{10427}\x{ff3a}\x{1fb0}
     A\x{3b1}\x{10427}\x{ff3a}\x{1fb0}
     A\x{391}\x{1044F}\x{ff3a}\x{1fb0}
     \x{104}
     \x{105}
     \x{109}
-    ** Failers
+\= Expect no match
     \x{100}
     \x{10a}
     
     \x{ff}
     \x{100}
     \x{101}
-    ** Failers
+\= Expect no match
     \x{102}
     Y
     y
     A
     A\x{300}BC
     A\x{300}\x{301}\x{302}BC
-    *** Failers
     \x{300}
 
 /^(\X*)C/utf
     A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C
 
 /^\X(.)/utf
-    *** Failers
+\= Expect no match
     A\x{300}\x{301}\x{302}
 
 /^\X{2,3}(.)/utf
 /^\pN{2,3}X/
     12X
     123X
-    *** Failers
+\= Expect no match
     X
     1X
     1234X
     
 /^\p{Han}+/utf
     \x{2e81}\x{3007}\x{2f804}\x{31a0}
-    ** Failers
+\= Expect no match
     \x{2e7f}
 
 /^\P{Katakana}+/utf
     \x{3105}
-    ** Failers
+\= Expect no match
     \x{30ff}
 
 /^[\p{Arabic}]/utf
     \x{06e9}
     \x{060b}
-    ** Failers
+\= Expect no match
     X\x{06e9}
 
 /^[\P{Yi}]/utf
     \x{2f800}
-    ** Failers
+\= Expect no match
     \x{a014}
     \x{a4c6}
 
 /^\p{Any}X/utf
     AXYZ
     \x{1234}XYZ
-    ** Failers
+\= Expect no match
     X
     
 /^\P{Any}X/utf
-    ** Failers
+\= Expect no match
     AX
     
 /^\p{Any}?X/utf
     XYZ
     AXYZ
     \x{1234}XYZ
-    ** Failers
+\= Expect no match
     ABXYZ
 
 /^\P{Any}?X/utf
     XYZ
-    ** Failers
+\= Expect no match
     AXYZ
     \x{1234}XYZ
     ABXYZ
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
-    ** Failers
+\= Expect no match
     XYZ
 
 /^\P{Any}+X/utf
-    ** Failers
+\= Expect no match
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
-    ** Failers
 
 /^\P{Any}*X/utf
     XYZ
-    ** Failers
+\= Expect no match
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
 /^[\p{Any}]X/utf
     AXYZ
     \x{1234}XYZ
-    ** Failers
+\= Expect no match
     X
     
 /^[\P{Any}]X/utf
-    ** Failers
+\= Expect no match
     AX
     
 /^[\p{Any}]?X/utf
     XYZ
     AXYZ
     \x{1234}XYZ
-    ** Failers
+\= Expect no match
     ABXYZ
 
 /^[\P{Any}]?X/utf
     XYZ
-    ** Failers
+\= Expect no match
     AXYZ
     \x{1234}XYZ
     ABXYZ
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
-    ** Failers
+\= Expect no match
     XYZ
 
 /^[\P{Any}]+X/utf
-    ** Failers
+\= Expect no match
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
-    ** Failers
 
 /^[\P{Any}]*X/utf
     XYZ
-    ** Failers
+\= Expect no match
     AXYZ
     \x{1234}XYZ
     A\x{1234}XYZ
     \x{1234}\n\r\x{3456}xyz
 
 /^\P{Any}{3,5}?/utf
-    ** Failers
+\= Expect no match
     abcdefgh
     \x{1234}\n\r\x{3456}xyz
 
      AXY
      aXY
      \x{1c5}XY
-     ** Failers
+\= Expect no match
      \x{1bb}XY
      \x{2b0}XY
      !XY
      AXY
      aXY
      \x{1c5}XY
-     ** Failers
+\= Expect no match
      \x{1bb}XY
      \x{2b0}XY
      !XY
      AbcdeXyz
      \x{1c5}AbXY
      abcDEXypqreXlmn
-     ** Failers
+\= Expect no match
      \x{1bb}XY
      \x{2b0}XY
      !XY
      AbcdeXyz
      \x{1c5}AbXY
      abcDEXypqreXlmn
-     ** Failers
+\= Expect no match
      \x{1bb}XY
      \x{2b0}XY
      !XY
      AbcdeXyz
      \x{1c5}AbXY
      abcDEXypqreXlmn
-     ** Failers
+\= Expect no match
      \x{1bb}XY
      \x{2b0}XY
      !XY
      AbcdeXyz
      \x{1c5}AbXY
      abcDEXypqreXlmn
-     ** Failers
+\= Expect no match
      \x{1bb}XY
      \x{2b0}XY
      !XY
      !XY
      \x{1bb}XY
      \x{2b0}XY
-     ** Failers
+\= Expect no match
      \x{1c5}XY
      AXY
 
      !XY
      \x{1bb}XY
      \x{2b0}XY
-     ** Failers
+\= Expect no match
      \x{1c5}XY
      AXY
 
 /[\x{c0}\x{116}]+/i,utf
     \x{c0}\x{e0}\x{116}\x{117}
 
-/Check property support in non-UTF-8 mode/
+# Check property support in non-UTF-8 mode
  
 /\p{L}{4}/
     123abcdefg
 
 /\x{a77d}\x{1d79}/utf
     \x{a77d}\x{1d79}
-    ** Failers
+\= Expect no match
     \x{1d79}\x{a77d}
 
 /^\p{Xan}/utf
     \x{6ca}
     \x{a6c}
     \x{10a7}
-    ** Failers
+\= Expect no match
     _ABC
 
 /^\p{Xan}+/utf
     ABCD1234\x{6ca}\x{a6c}\x{10a7}_
-    ** Failers
+\= Expect no match
     _ABC
 
 /^\p{Xan}*/utf
     \x{6ca}
     \x{a6c}
     \x{10a7}
-    ** Failers
+\= Expect no match
     _ABC
  
 /^[\p{Xan}]+/utf
     ABCD1234\x{6ca}\x{a6c}\x{10a7}_
-    ** Failers
+\= Expect no match
     _ABC
 
 /^>\p{Xsp}/utf
     >\x{1680}\x{2028}\x{0b}
-    ** Failers
+\= Expect no match
     \x{0b}
 
 /^>\p{Xsp}+/utf,no_auto_possess
 /^>\p{Xps}/utf
     >\x{1680}\x{2028}\x{0b}
     >\x{a0}
-    ** Failers
+\= Expect no match
     \x{0b}
 
 /^>\p{Xps}+/utf
     \x{a6c}
     \x{10a7}
     _ABC
-    ** Failers
+\= Expect no match
     []
 
 /^\p{Xwd}+/utf
     \x{a6c}
     \x{10a7}
     _ABC
-    ** Failers
+\= Expect no match
     []
  
 /^[\p{Xwd}]+/utf
 
 /\b...\B/utf
     abc_
-    ** Failers
+\= Expect no match
     \x{37e}abc\x{376}
     \x{37e}\x{376}\x{371}\x{393}\x{394}
     !\x{c0}++\x{c1}\x{c2}
     \x{1100}X
     \x{1100}\x{34e}X
     \x{1b04}\x{1b04}X
-    *These match up to the roman letters
+\= These match up to the roman letters
     \x{1111}\x{1111}L,L
     \x{1111}\x{1111}\x{1169}L,L,V
     \x{1111}\x{ae4c}L, LV
     \x{1111}\x{ad89}\x{11fe}L, LVT, T
     \x{1111}\x{ad89}\x{11fe}\x{11fe}L, LVT, T, T
     \x{ad89}\x{11fe}\x{11fe}LVT, T, T
-    *These match just the first codepoint (invalid sequence)
+\= These match just the first codepoint (invalid sequence)
     \x{1111}\x{11fe}L, T
     \x{ae4c}\x{1111}LV, L
     \x{ae4c}\x{ae4c}LV, LV
     \x{11fe}\x{1169}T, V
     \x{11fe}\x{ae4c}T, LV
     \x{11fe}\x{ad89}T, LVT
-    *Test extend and spacing mark
+\= Test extend and spacing mark
     \x{1111}\x{ae4c}\x{0711}L, LV, extend
     \x{1111}\x{ae4c}\x{1b04}L, LV, spacing mark
     \x{1111}\x{ae4c}\x{1b04}\x{0711}\x{1b04}L, LV, spacing mark, extend, spacing mark
-    *Test CR, LF, and control
+\= Test CR, LF, and control
     \x0d\x{0711}CR, extend
     \x0d\x{1b04}CR, spacingmark
     \x0a\x{0711}LF, extend
     \x0a\x{1b04}LF, spacingmark
     \x0b\x{0711}Control, extend
     \x09\x{1b04}Control, spacingmark
-    *There are no Prepend characters, so we can't test Prepend, CR
+\= There are no Prepend characters, so we can't test Prepend, CR
     
 /^(?>\X{2})X/utf,aftertext
     \x{1111}\x{ae4c}\x{1111}\x{ae4c}X
 /\x{212b}+/i,utf
     \x{00c5}\x{00e5}\x{212b}
 
-
 /\x{01c4}+/i,utf
     \x{01c4}\x{01c5}\x{01c6}
 
 /\x{01c6}+/i,utf
     \x{01c4}\x{01c5}\x{01c6}
 
-
 /\x{01c7}+/i,utf
     \x{01c7}\x{01c8}\x{01c9}
 
 /\x{01cc}+/i,utf
     \x{01ca}\x{01cb}\x{01cc}
 
-
 /\x{01f1}+/i,utf
     \x{01f1}\x{01f2}\x{01f3}
 
 /\x{01f3}+/i,utf
     \x{01f1}\x{01f2}\x{01f3}
 
-
 /\x{0345}+/i,utf
     \x{0345}\x{0399}\x{03b9}\x{1fbe}
 
 /\x{1fbe}+/i,utf
     \x{0345}\x{0399}\x{03b9}\x{1fbe}
 
-
 /\x{0392}+/i,utf
     \x{0392}\x{03b2}\x{03d0}
 
 /\x{03f5}+/i,utf
     \x{0395}\x{03b5}\x{03f5}
 
-
 /\x{0398}+/i,utf
     \x{0398}\x{03b8}\x{03d1}\x{03f4}
 
 
 /\x{03f4}+/i,utf
     \x{0398}\x{03b8}\x{03d1}\x{03f4}
-    
 
 /\x{039a}+/i,utf
     \x{039a}\x{03ba}\x{03f0}
 /\x{03f0}+/i,utf
     \x{039a}\x{03ba}\x{03f0}
     
-
 /\x{03a0}+/i,utf
     \x{03a0}\x{03c0}\x{03d6}
 
 /\x{03d6}+/i,utf
     \x{03a0}\x{03c0}\x{03d6}
 
-
 /\x{03a1}+/i,utf
     \x{03a1}\x{03c1}\x{03f1}
 
 /\x{03f1}+/i,utf
     \x{03a1}\x{03c1}\x{03f1}
 
-
 /\x{03a3}+/i,utf
     \x{03A3}\x{03C2}\x{03C3}
 
 
 /\x{03c3}+/i,utf
     \x{03A3}\x{03C2}\x{03C3}
-    
 
 /\x{03a6}+/i,utf
     \x{03a6}\x{03c6}\x{03d5}
 /\x{03d5}+/i,utf
     \x{03a6}\x{03c6}\x{03d5}
 
-
 /\x{03c9}+/i,utf
     \x{03c9}\x{03a9}\x{2126}
 
 /\x{2126}+/i,utf
     \x{03c9}\x{03a9}\x{2126}
     
-
 /\x{1e60}+/i,utf
     \x{1e60}\x{1e61}\x{1e9b}
 
 /\x{1e9b}+/i,utf
     \x{1e60}\x{1e61}\x{1e9b}
     
-
 /\x{1e9e}+/i,utf
     \x{1e9e}\x{00df}
 
 /\x{00df}+/i,utf
     \x{1e9e}\x{00df}
     
-
 /\x{1f88}+/i,utf
     \x{1f88}\x{1f80}
 
 /\x{212a}+/i,utf
     \x{004b}\x{006b}\x{212a}
 
-
 /\x{0053}+/i,utf
     \x{0053}\x{0073}\x{017f}
 
     \x{0053}\x{0073}\x{017f}
 
 /ist/i,utf
+\= Expect no match
     ikt
 
 /is+t/i,utf
     iSs\x{17f}t
+\= Expect no match
     ikt
 
 /is+?t/i,utf
+\= Expect no match
     ikt
 
 /is?t/i,utf
+\= Expect no match
     ikt
 
 /is{2}t/i,utf
+\= Expect no match
     iskt
 
 /^\p{Xuc}/utf
     @abc
     `abc
     \x{1234}abc
-    ** Failers
+\= Expect no match
     abc
 
 /^\p{Xuc}+/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^\p{Xuc}+?/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^\p{Xuc}+?\*/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^\p{Xuc}++/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^\p{Xuc}{3,5}/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^\p{Xuc}{3,5}?/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^[\p{Xuc}]/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^[\p{Xuc}]+/utf
     $@`\x{a0}\x{1234}\x{e000}**
-    ** Failers
+\= Expect no match
     \x{9f}
 
 /^\P{Xuc}/utf
     abc
-    ** Failers
+\= Expect no match
     $abc
     @abc
     `abc
 
 /^[\P{Xuc}]/utf
     abc
-    ** Failers
+\= Expect no match
     $abc
     @abc
     `abc
index 545e751c950a1a163beaedcafac77ec5e64730b9..ca3b1b98aa6e4dc9faf19ccba45c95cc3e98c40d 100644 (file)
@@ -1,8 +1,11 @@
-# These are a few representative patterns whose lengths and offsets are to be
-# shown when the link size is 2. This is just a doublecheck test to ensure the
-# sizes don't go horribly wrong when something is changed. The pattern contents
-# are all themselves checked in other tests. Unicode, including property
-# support, is required for these tests.
+# There are two sorts of patterns in this test. A number of them are
+# representative patterns whose lengths and offsets are checked. This is just a
+# doublecheck test to ensure the sizes don't go horribly wrong when something
+# is changed. The operation of these patterns is checked in other tests.
+#
+# This file also contains tests whose output varies with code unit size and/or
+# link size. Unicode support is required for these tests. There are separate
+# output files for each code unit size and link size.
 
 #pattern fullbincode,memory
 
@@ -67,7 +70,7 @@
 /\xff/utf
 
 /\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
-    
+
 /\x{D55c}\x{ad6d}\x{C5B4}/I,utf
 
 /\x{65e5}\x{672c}\x{8a9e}/I,utf
 
 # Check the absolute limit on nesting (?| etc. This varies with code unit
 # width because the workspace is a different number of bytes. It will fail
-# in 8-bit and 16-bit but not in 32-bit.
-    
+# with link size 2 in 8-bit and 16-bit but not in 32-bit.
+
 /(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
 )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 /parens_nest_limit=1000,-fullbincode
 
+# Use "expand" to create some very long patterns with nested parentheses, in
+# order to test workspace overflow. Again, this varies with code unit width,
+# and even with it fails in two modes, the error offset differs. It also varies
+# with link size - hence multiple tests with different values.
+
+/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{159}*THEN:\[A]{255}\[)]{160}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{199}*THEN:\[A]{255}\[)]{200}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{299}*THEN:\[A]{255}\[)]{300}/expand,-fullbincode
+
+/(?(1)(?1)){8,}+()/debug
+    abcd
+
+/(?(1)|a(?1)b){2,}+()/debug
+    abcde
+
+/((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug
+
 # End of testinput8
index eeb5edbbed395ab1e405171e20a52fbcab1607c5..9a26f5fcc50d14c50b4f9d0cc374b639dbe6a6c6 100644 (file)
@@ -2,11 +2,10 @@
 # UTF-8 or Unicode property support. */
     
 #forbid_utf
+#newline_default lf any anycrlf
 
-/a\Cb/
-    aXb
-    a\nb
-    ** Failers (too big char)
+/ab/
+\= Expect error message (too big char) and no match
     A\x{123}B
     A\o{443}B
   
 /(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF)XX/mark
     XX
      
+/(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF)XX/mark,alt_verbnames
+    XX
+     
 /(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE)XX/mark
     XX
 
+/(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE)XX/mark,alt_verbnames
+    XX
+
 /\u0100/alt_bsux,allow_empty_class,match_unset_backref,dupnames
 
 /[\u0100-\u0200]/alt_bsux,allow_empty_class,match_unset_backref,dupnames
 
 /[^\s]*\s* [^\W]+\W+ [^\d]*?\d0 [^\d\w]{4,6}?\w*A/B
 
+/(*MARK:a\x{100}b)z/alt_verbnames 
+
 # End of testinput9
index 942dc7d8508316878201e394d276211d4086a916..d28bf916617a80b49a42771a12c67a943746c686 100644 (file)
@@ -3,15 +3,17 @@
 # 32-bit PCRE libraries, and also using the perltest.pl script.
     
 #forbid_utf
+#newline_default lf any anycrlf
 #perltest
 
 /the quick brown fox/
     the quick brown fox
  0: the quick brown fox
-    The quick brown FOX
-No match
     What do you know about the quick brown fox?
  0: the quick brown fox
+\= Expect no match
+    The quick brown FOX
+No match
     What do you know about THE QUICK BROWN FOX?
 No match
 
@@ -90,8 +92,7 @@ No match
  0: aaaabxyzpqrrrabbxyyyypqAzz
     >>>>abcxyzpqrrrabbxyyyypqAzz
  0: abcxyzpqrrrabbxyyyypqAzz
-    *** Failers
-No match
+\= Expect no match
     abxyzpqrrabbxyyyypqAzz
 No match
     abxyzpqrrrrabbxyyyypqAzz
@@ -112,8 +113,7 @@ No match
     abcabczz
  0: abcabczz
  1: abc
-    *** Failers
-No match
+\= Expect no match
     zz
 No match
     abcabcabczz
@@ -146,8 +146,7 @@ No match
     bbbbbbbbbbbac
  0: bbbbbbbbbbbac
  1: a
-    *** Failers
-No match
+\= Expect no match
     aaac
 No match
     abbbbbbbbbbbac
@@ -178,8 +177,7 @@ No match
     bbbbbbbbbbbac
  0: bbbbbbbbbbbac
  1: a
-    *** Failers
-No match
+\= Expect no match
     aaac
 No match
     abbbbbbbbbbbac
@@ -200,8 +198,7 @@ No match
     bababc
  0: bababc
  1: ba
-    *** Failers
-No match
+\= Expect no match
     bababbc
 No match
     babababc
@@ -217,8 +214,7 @@ No match
     bababc
  0: bababc
  1: ba
-    *** Failers
-No match
+\= Expect no match
     bababbc
 No match
     babababc
@@ -241,8 +237,7 @@ No match
  0: d
     ething
  0: e
-    *** Failers
-No match
+\= Expect no match
     fthing
 No match
     [thing
@@ -259,8 +254,7 @@ No match
  0: d
     ething
  0: e
-    *** Failers
-No match
+\= Expect no match
     athing
 No match
     fthing
@@ -273,8 +267,7 @@ No match
  0: [
     \\thing
  0: \
-    *** Failers
- 0: *
+\= Expect no match
     athing
 No match
     bthing
@@ -293,8 +286,7 @@ No match
  0: a
     fthing
  0: f
-    *** Failers
- 0: *
+\= Expect no match
     ]thing
 No match
     cthing
@@ -337,8 +329,7 @@ No match
  0: 10
     100
  0: 100
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
 
@@ -355,46 +346,42 @@ No match
  0: xxx0
     xxx1234
  0: xxx1234
-    *** Failers
-No match
+\= Expect no match
     xxx
 No match
 
 /^.+[0-9][0-9][0-9]$/
     x123
  0: x123
+    x1234
+ 0: x1234
     xx123
  0: xx123
     123456
  0: 123456
-    *** Failers
-No match
+\= Expect no match
     123
 No match
-    x1234
- 0: x1234
 
 /^.+?[0-9][0-9][0-9]$/
     x123
  0: x123
+    x1234
+ 0: x1234
     xx123
  0: xx123
     123456
  0: 123456
-    *** Failers
-No match
+\= Expect no match
     123
 No match
-    x1234
- 0: x1234
 
 /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
     abc!pqr=apquxz.ixr.zzz.ac.uk
  0: abc!pqr=apquxz.ixr.zzz.ac.uk
  1: abc
  2: pqr
-    *** Failers
-No match
+\= Expect no match
     !pqr=apquxz.ixr.zzz.ac.uk
 No match
     abc!=apquxz.ixr.zzz.ac.uk
@@ -407,7 +394,8 @@ No match
 /:/
     Well, we need a colon: somewhere
  0: :
-    *** Fail if we don't
+\= Expect no match
+    Fail without a colon
 No match
 
 /([\da-f:]+)$/i
@@ -435,8 +423,7 @@ No match
     Any old stuff
  0: ff
  1: ff
-    *** Failers
-No match
+\= Expect no match
     0zzz
 No match
     gzzz
@@ -457,8 +444,7 @@ No match
  1: 12
  2: 123
  3: 0
-    *** Failers
-No match
+\= Expect no match
     .1.2.3333
 No match
     1.2.3
@@ -477,8 +463,7 @@ No match
  1: 1
  2: non-sp1
  3: non-sp2
-    *** Failers
-No match
+\= Expect no match
     1IN SOA non-sp1 non-sp2(
 No match
 
@@ -498,8 +483,7 @@ No match
     x-.y-.
  0: x-.y-.
  1: .y-
-    *** Failers
-No match
+\= Expect no match
     -abc.peq.
 No match
 
@@ -518,8 +502,7 @@ No match
  1: -a
  2: .b-c
  3: -c
-    *** Failers
-No match
+\= Expect no match
     *.0
 No match
     *.a-
@@ -570,22 +553,21 @@ No match
     \"\" ; rhubarb
  0: "" ; rhubarb
  1: ; rhubarb
-    *** Failers
-No match
+\= Expect no match
     \"1234\" : things
 No match
 
 /^$/
     \
  0: 
-    *** Failers
+\= Expect no match
+    A non-empty line
 No match
 
 /   ^    a   (?# begins with a)  b\sc (?# then b c) $ (?# then end)/x
     ab c
  0: ab c
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
     ab cde
@@ -594,8 +576,7 @@ No match
 /(?x)   ^    a   (?# begins with a)  b\sc (?# then b c) $ (?# then end)/
     ab c
  0: ab c
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
     ab cde
@@ -606,8 +587,7 @@ No match
  0: a bcd
     a b d
  0: a b d
-    *** Failers
-No match
+\= Expect no match
     abcd
 No match
     ab d
@@ -716,8 +696,7 @@ No match
  0: 12345678ab
     12345678__
  0: 12345678__
-    *** Failers
-No match
+\= Expect no match
     1234567
 No match
 
@@ -730,8 +709,7 @@ No match
  0: 12345
     aaaaa
  0: aaaaa
-    *** Failers
-No match
+\= Expect no match
     123456
 No match
 
@@ -756,8 +734,7 @@ No match
  0: def=defdefdef
  1: def
  2: def
-    *** Failers
-No match
+\= Expect no match
     abc=defdef
 No match
 
@@ -827,8 +804,7 @@ No match
     From abcd  Mon Sep  1 12:33:02 1997
  0: From abcd  Mon Sep  1 12:33
  1: Sep  
-    *** Failers
-No match
+\= Expect no match
     From abcd  Sep 01 12:33:02 1997
 No match
 
@@ -865,8 +841,7 @@ No match
     abc456
  0: abc
  1: abc
-    *** Failers
-No match
+\= Expect no match
     abc123
 No match
 
@@ -910,16 +885,14 @@ No match
 /(?!^)abc/
     the abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
 
 /(?=^)abc/
     abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     the abc
 No match
 
@@ -1151,8 +1124,7 @@ No match
  0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay
     A missing angle <user\@some.where
  0: user@some.where
-    *** Failers
-No match
+\= Expect no match
     The quick brown fox
 No match
 
@@ -1752,8 +1724,7 @@ No match
  0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay
     A missing angle <user\@some.where
  0: user@some.where
-    *** Failers
-No match
+\= Expect no match
     The quick brown fox
 No match
 
@@ -1786,8 +1757,7 @@ No match
  0: A\x00\x00Z
     An A\0\x0\0Z
  0: A\x00\x00\x00Z
-    *** Failers
-No match
+\= Expect no match
     A\0Z
 No match
     A\0\x0\0\x0Z
@@ -1802,8 +1772,7 @@ No match
  0: bell
  1: 
  2: bell
-    *** Failers
-No match
+\= Expect no match
     cowbell
 No match
 
@@ -1818,8 +1787,7 @@ No match
  0: \x0d
     \tabc
  0: \x09
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
 
@@ -1838,8 +1806,7 @@ No match
     b
  0: b
  1: 
-    *** Failers
-No match
+\= Expect no match
     acb
 No match
 
@@ -1853,8 +1820,7 @@ No match
     b
  0: b
  1: 
-    *** Failers
-No match
+\= Expect no match
     ab
 No match
 
@@ -1868,8 +1834,7 @@ No match
     b
  0: b
  1: 
-    *** Failers
-No match
+\= Expect no match
     acb
 No match
 
@@ -1880,8 +1845,7 @@ No match
     b
  0: b
  1: 
-    *** Failers
-No match
+\= Expect no match
     ab
 No match
     aab
@@ -1899,8 +1863,7 @@ No match
     b
  0: b
  1: 
-    *** Failers
-No match
+\= Expect no match
     ab
 No match
     aab
@@ -1915,8 +1878,7 @@ No match
  0: abbbc
     abbc
  0: abbc
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
     abbbbbc
@@ -1946,8 +1908,7 @@ No match
 /^[W-c]+$/
     WXY_^abc
  0: WXY_^abc
-    *** Failers
-No match
+\= Expect no match
     wxy
 No match
 
@@ -1976,8 +1937,7 @@ No match
 /^abc$/
     abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     qqq\nabc
 No match
     abc\nzzz
@@ -1990,8 +1950,7 @@ No match
  0: abc
     abc\n 
  0: abc
-    *** Failers
-No match
+\= Expect no match
     qqq\nabc
 No match
     abc\nzzz
@@ -2005,9 +1964,7 @@ No match
  1: f
 
 /\A(.)*\Z/m
-    *** Failers
- 0: *** Failers
- 1: s
+\= Expect no match
     abc\ndef
 No match
 
@@ -2020,24 +1977,21 @@ No match
 /[-az]+/
     az-
  0: az-
-    *** Failers
- 0: a
+\= Expect no match
     b
 No match
 
 /[az-]+/
     za-
  0: za-
-    *** Failers
- 0: a
+\= Expect no match
     b
 No match
 
 /[a\-z]+/
     a-z
  0: a-z
-    *** Failers
- 0: a
+\= Expect no match
     b
 No match
 
@@ -2048,16 +2002,14 @@ No match
 /[\d-]+/
     12-34
  0: 12-34
-    *** Failers
-No match
+\= Expect no match
     aaa
 No match
 
 /[\d-z]+/
     12-34z
  0: 12-34z
-    *** Failers
-No match
+\= Expect no match
     aaa
 No match
 
@@ -2068,8 +2020,7 @@ No match
 /\x20Z/
     the Zoo
  0:  Z
-    *** Failers
-No match
+\= Expect no match
     Zulu
 No match
 
@@ -2084,29 +2035,12 @@ No match
  0: abcABC
  1: abc
 
-/ab{3cd/
-    ab{3cd
- 0: ab{3cd
-
-/ab{3,cd/
-    ab{3,cd
- 0: ab{3,cd
-
-/ab{3,4a}cd/
-    ab{3,4a}cd
- 0: ab{3,4a}cd
-
-/{4,5a}bc/
-    {4,5a}bc
- 0: {4,5a}bc
-
 /abc$/
     abc
  0: abc
     abc\n
  0: abc
-    *** Failers
-No match
+\= Expect no match
     abc\ndef
 No match
 
@@ -2169,8 +2103,7 @@ No match
 /^[A\8B\9C]+$/
     A8B9C
  0: A8B9C
-    *** Failers 
-No match
+\= Expect no match 
     A8B9C\x00
 No match
 
@@ -2255,12 +2188,7 @@ No match
  2: a
  3: 
  4: ccc
-    *** Failers
- 0: *** Failers
- 1: *
- 2: *
- 3: * Fail
- 4: ers
+\= Expect no match
     anything
 No match
     b\bc   
@@ -2291,8 +2219,7 @@ No match
 /[^k]$/
     abc
  0: c
-    *** Failers
- 0: s
+\= Expect no match
     abk   
 No match
    
@@ -2303,8 +2230,7 @@ No match
  0: bc
     kabc 
  0: abc
-    *** Failers
- 0: ers
+\= Expect no match
     abk
 No match
     akb
@@ -2317,8 +2243,7 @@ No match
  0: 12345678@a.b.c.d
     123456789\@x.y.z
  0: 123456789@x.y.z
-    *** Failers
-No match
+\= Expect no match
     12345678\@x.y.uk
 No match
     1234567\@a.b.c.d       
@@ -2331,8 +2256,7 @@ No match
     aaaaaaaaaa
  0: aaaaaaaaaa
  1: a
-    *** Failers
-No match
+\= Expect no match
     aaaaaaa   
 No match
 
@@ -2392,8 +2316,7 @@ No match
  0: .875
  1: .875
  2: 5
-    *** Failers 
-No match
+\= Expect no match 
     1.235 
 No match
     
@@ -2473,8 +2396,7 @@ No match
     ABC445
  0: ABC
  1: ABC
-    *** Failers
-No match
+\= Expect no match
     ABC123
 No match
     
@@ -2483,8 +2405,7 @@ No match
  0: W46]
     -46]789
  0: -46]
-    *** Failers
-No match
+\= Expect no match
     Wall
 No match
     Zebra
@@ -2513,8 +2434,7 @@ No match
  0: ]
     \\backslash 
  0: \
-    *** Failers
-No match
+\= Expect no match
     -46]789
 No match
     well
@@ -2525,13 +2445,15 @@ No match
  0: 01/01/2000
 
 /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
-  word cat dog elephant mussel cow horse canary baboon snake shark otherword
+    word cat dog elephant mussel cow horse canary baboon snake shark otherword
  0: word cat dog elephant mussel cow horse canary baboon snake shark otherword
-  word cat dog elephant mussel cow horse canary baboon snake shark
+\= Expect no match
+    word cat dog elephant mussel cow horse canary baboon snake shark
 No match
 
 /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
-  word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
+\= Expect no match
+    word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
 No match
 
 /^(a){0,0}/
@@ -2592,28 +2514,28 @@ No match
  1: a
 
 /^(a){1,1}/
-    bcd
-No match
     abc
  0: a
  1: a
     aab  
  0: a
  1: a
-
-/^(a){1,2}/
+\= Expect no match
     bcd
 No match
+
+/^(a){1,2}/
     abc
  0: a
  1: a
     aab  
  0: aa
  1: a
-
-/^(a){1,3}/
+\= Expect no match
     bcd
 No match
+
+/^(a){1,3}/
     abc
  0: a
  1: a
@@ -2623,10 +2545,11 @@ No match
     aaa   
  0: aaa
  1: a
-
-/^(a){1,}/
+\= Expect no match
     bcd
 No match
+
+/^(a){1,}/
     abc
  0: a
  1: a
@@ -2639,6 +2562,9 @@ No match
     aaaaaaaa    
  0: aaaaaaaa
  1: a
+\= Expect no match
+    bcd
+No match
 
 /.*\.gif/
     borfle\nbib.gif\nno
@@ -2699,8 +2625,7 @@ No match
     BarFoo 
  0: B
  1: B
-    *** Failers
-No match
+\= Expect no match
     abcde\nBar  
 No match
 
@@ -2722,8 +2647,7 @@ No match
     BarFoo 
  0: B
  1: B
-    *** Failers
-No match
+\= Expect no match
     abcde\nBar  
 No match
 
@@ -2745,8 +2669,7 @@ No match
     BarFoo 
  0: B
  1: B
-    *** Failers 
-No match
+\= Expect no match 
     abcde\nBar  
 No match
 
@@ -2755,14 +2678,12 @@ No match
  0: abcde\x0a1234X
     BarFoo 
  0: B
-    *** Failers 
-No match
+\= Expect no match 
     abcde\nBar  
 No match
 
 /^.*B/
-    **** Failers
-No match
+\= Expect no match
     abc\nB
 No match
      
@@ -2814,32 +2735,28 @@ No match
 /^[abcdefghijklmnopqrstuvwxy0123456789]/
     n
  0: n
-    *** Failers 
-No match
+\= Expect no match 
     z 
 No match
 
 /abcde{0,0}/
     abcd
  0: abcd
-    *** Failers
-No match
+\= Expect no match
     abce  
 No match
 
 /ab[cd]{0,0}e/
     abe
  0: abe
-    *** Failers
-No match
+\= Expect no match
     abcde 
 No match
     
 /ab(c){0,0}d/
     abd
  0: abd
-    *** Failers
-No match
+\= Expect no match
     abcd   
 No match
 
@@ -2853,17 +2770,14 @@ No match
     abbbb
  0: abbbb
  1: bbbb
-    *** Failers
- 0: a
- 1: 
+\= Expect no match
     bbbbb    
 No match
     
 /ab\d{0}e/
     abe
  0: abe
-    *** Failers
-No match
+\= Expect no match
     ab1e   
 No match
     
@@ -2937,8 +2851,7 @@ No match
 /a.b/
     acb
  0: acb
-    *** Failers 
-No match
+\= Expect no match 
     a\nb   
 No match
     
@@ -2989,15 +2902,14 @@ No match
  1: a
     
 /(?!\A)x/m
+    a\bx\n
+ 0: x
+    a\nx\n
+ 0: x
+\= Expect no match     
     x\nb\n
 No match
-    a\bx\n  
- 0: x
     
-/\x0{ab}/
-    \0{ab} 
- 0: \x00{ab}
-
 /(A|B)*?CD/
     CD 
  0: CD
@@ -3025,8 +2937,7 @@ No match
  0: foo
     rfoosh
  0: foo
-    *** Failers
-No match
+\= Expect no match
     barfoo
 No match
     towbarfoo
@@ -3035,8 +2946,7 @@ No match
 /\w{3}(?<!bar)foo/
     catfood
  0: catfoo
-    *** Failers
-No match
+\= Expect no match
     foo
 No match
     barfoo
@@ -3048,8 +2958,7 @@ No match
     fooabar
  0: bar
  1: foo
-    *** Failers
-No match
+\= Expect no match
     bar
 No match
     foobbar
@@ -3058,8 +2967,7 @@ No match
 /\Aabc\z/m
     abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     abc\n   
 No match
     qqq\nabc
@@ -3069,13 +2977,12 @@ No match
     qqq\nabc\nzzz
 No match
 
-"(?>.*/)foo"
-    /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
-No match
-
 "(?>.*/)foo"
     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
  0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
+\= Expect no match     
+    /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
+No match
 
 /(?>(\.\d\d[1-9]?))\d+/
     1.230003938
@@ -3084,8 +2991,7 @@ No match
     1.875000282
  0: .875000282
  1: .875
-    *** Failers 
-No match
+\= Expect no match 
     1.235 
 No match
 
@@ -3093,8 +2999,7 @@ No match
     now is the time for all good men to come to the aid of the party
  0: now is the time for all good men to come to the aid of the party
  1: party
-    *** Failers
-No match
+\= Expect no match
     this is not a line with only words and spaces!
 No match
     
@@ -3113,8 +3018,7 @@ No match
  0: 12345a
  1: 12345
  2: a
-    *** Failers
-No match
+\= Expect no match
     12345+ 
 No match
 
@@ -3152,8 +3056,7 @@ No match
     (abc(def)xyz)
  0: (abc(def)xyz)
  1: xyz
-    *** Failers
-No match
+\= Expect no match
     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa   
 No match
 
@@ -3162,8 +3065,7 @@ No match
  0: ab
     Ab
  0: Ab
-    *** Failers 
-No match
+\= Expect no match 
     aB
 No match
     AB
@@ -3173,8 +3075,7 @@ No match
     a bcd e
  0: a bcd e
  1: a bc
-    *** Failers
-No match
+\= Expect no match
     a b cd e
 No match
     abcd e   
@@ -3186,8 +3087,7 @@ No match
     a bcde f
  0: a bcde f
  1: a bcde f
-    *** Failers
-No match
+\= Expect no match
     abcdef  
 No match
 
@@ -3198,8 +3098,7 @@ No match
     aBc
  0: aBc
  1: aB
-    *** Failers
-No match
+\= Expect no match
     abC
 No match
     aBC  
@@ -3218,8 +3117,7 @@ No match
  0: abc
     aBc
  0: aBc
-    *** Failers 
-No match
+\= Expect no match 
     ABC
 No match
     abC
@@ -3232,8 +3130,7 @@ No match
  0: aBc
     aBBc
  0: aBBc
-    *** Failers 
-No match
+\= Expect no match 
     aBC
 No match
     aBBC
@@ -3244,8 +3141,7 @@ No match
  0: abcd
     abCd
  0: abCd
-    *** Failers
-No match
+\= Expect no match
     aBCd
 No match
     abcD     
@@ -3258,8 +3154,7 @@ No match
  0: more than MILLION
     more \n than Million 
  0: more \x0a than Million
-    *** Failers
-No match
+\= Expect no match
     MORE THAN MILLION    
 No match
     more \n than \n million 
@@ -3272,8 +3167,7 @@ No match
  0: more than MILLION
     more \n than Million 
  0: more \x0a than Million
-    *** Failers
-No match
+\= Expect no match
     MORE THAN MILLION    
 No match
     more \n than \n million 
@@ -3286,8 +3180,7 @@ No match
  0: aBbc
     aBBc 
  0: aBBc
-    *** Failers
-No match
+\= Expect no match
     Abc
 No match
     abAb    
@@ -3300,8 +3193,7 @@ No match
  0: abc
     aBc
  0: aBc
-    *** Failers
-No match
+\= Expect no match
     Ab 
 No match
     abC
@@ -3316,8 +3208,7 @@ No match
     aBxxc
  0: xxc
  1: xx
-    *** Failers
-No match
+\= Expect no match
     Abxxc
 No match
     ABxxc
@@ -3331,8 +3222,7 @@ No match
  1: a
     bB
  0: bB
-    *** Failers
-No match
+\= Expect no match
     aB
 No match
     bA    
@@ -3346,8 +3236,7 @@ No match
  0: b
     bb  
  0: bb
-    *** Failers
-No match
+\= Expect no match
     ab   
 No match
     
@@ -3361,8 +3250,7 @@ No match
  0: 12
     123
  0: 12
-    *** Failers
-No match
+\= Expect no match
     xyz    
 No match
 
@@ -3371,8 +3259,7 @@ No match
  0: abc:
     12
  0: 12
-    *** Failers
-No match
+\= Expect no match
     123
 No match
     xyz    
@@ -3387,8 +3274,7 @@ No match
  0: cat
     focat   
  0: cat
-    *** Failers
-No match
+\= Expect no match
     foocat  
 No match
 
@@ -3401,8 +3287,7 @@ No match
  0: cat
     focat   
  0: cat
-    *** Failers
-No match
+\= Expect no match
     foocat  
 No match
 
@@ -3441,8 +3326,7 @@ No match
  0: 12aa
  1: 1
  2: 2
-    *** Failers
-No match
+\= Expect no match
     1234    
 No match
 
@@ -3459,8 +3343,7 @@ No match
     blaH blaH
  0: blaH blaH
  1: blaH
-    *** Failers
-No match
+\= Expect no match
     blah BLAH
 No match
     Blah blah      
@@ -3628,8 +3511,7 @@ No match
  0: 12-sep-98
     12-09-98
  0: 12-09-98
-    *** Failers
-No match
+\= Expect no match
     sep-12-98
 No match
         
@@ -3640,8 +3522,7 @@ No match
     foobarfootling 
  0: barfoo
  1: foo
-    *** Failers
-No match
+\= Expect no match
     foobar
 No match
     barfoo   
@@ -3676,8 +3557,7 @@ No match
     BBx
  0: BBx
  1: BB
-    *** Failers
-No match
+\= Expect no match
     abcX
 No match
     aBCX
@@ -3709,8 +3589,7 @@ No match
     France
  0: F
  1: F
-    *** Failers
-No match
+\= Expect no match
     Africa     
 No match
 
@@ -3733,8 +3612,7 @@ No match
     Zambesi
  0: Z
  1: Z
-    *** Failers
-No match
+\= Expect no match
     aCD  
 No match
     XY  
@@ -3743,8 +3621,7 @@ No match
 /(?<=foo\n)^bar/m
     foo\nbar
  0: bar
-    *** Failers
-No match
+\= Expect no match
     bar
 No match
     baz\nbar   
@@ -3757,39 +3634,37 @@ No match
  0: baz
     koobarbaz 
  0: baz
-    *** Failers
-No match
+\= Expect no match
     baz
 No match
     foobarbaz 
 No match
 
-/The cases of aaaa and aaaaaa are missed out below because Perl does things/
-/differently. We know that odd, and maybe incorrect, things happen with/
-No match
-/recursive references in Perl, as far as 5.11.3 - see some stuff in test #2./
-No match
+# The cases of aaaa and aaaaaa are missed out below because Perl does things
+# differently. We know that odd, and maybe incorrect, things happen with
+# recursive references in Perl, as far as 5.11.3 - see some stuff in test #2.
 
 /^(a\1?){4}$/
-    a
-No match
-    aa
-No match
-    aaa
-No match
     aaaaa
  0: aaaaa
  1: a
     aaaaaaa
  0: aaaaaaa
  1: a
+    aaaaaaaaaa
+ 0: aaaaaaaaaa
+ 1: aaaa
+\= Expect no match
+    a
+No match
+    aa
+No match
+    aaa
+No match
     aaaaaaaa
 No match
     aaaaaaaaa
 No match
-    aaaaaaaaaa
- 0: aaaaaaaaaa
- 1: aaaa
     aaaaaaaaaaa
 No match
     aaaaaaaaaaaa
@@ -3800,16 +3675,10 @@ No match
 No match
     aaaaaaaaaaaaaaa
 No match
-    aaaaaaaaaaaaaaaa               
+    aaaaaaaaaaaaaaaa
 No match
 
 /^(a\1?)(a\1?)(a\2?)(a\3?)$/
-    a
-No match
-    aa
-No match
-    aaa
-No match
     aaaa
  0: aaaa
  1: a
@@ -3834,16 +3703,23 @@ No match
  2: aa
  3: aaa
  4: a
-    aaaaaaaa
-No match
-    aaaaaaaaa
-No match
     aaaaaaaaaa
  0: aaaaaaaaaa
  1: a
  2: aa
  3: aaa
  4: aaaa
+\= Expect no match
+    a
+No match
+    aa
+No match
+    aaa
+No match
+    aaaaaaaa
+No match
+    aaaaaaaaa
+No match
     aaaaaaaaaaa
 No match
     aaaaaaaaaaaa
@@ -3857,9 +3733,8 @@ No match
     aaaaaaaaaaaaaaaa               
 No match
 
-/The following tests are taken from the Perl 5.005 test suite; some of them/
-/are compatible with 5.004, but I'd rather not have to sort them out./
-No match
+# The following tests are taken from the Perl 5.005 test suite; some of them
+# are compatible with 5.004, but I'd rather not have to sort them out.
 
 /abc/
     abc
@@ -3868,8 +3743,7 @@ No match
  0: abc
     ababc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     xbc
 No match
     axc
@@ -3904,8 +3778,7 @@ No match
 /ab+bc/
     abbc
  0: abbc
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
     abq
@@ -3930,8 +3803,7 @@ No match
  0: abbbbc
 
 /ab{4,5}bc/
-    *** Failers
-No match
+\= Expect no match
     abq
 No match
     abbbbc
@@ -3960,8 +3832,7 @@ No match
 /^abc$/
     abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     abbbbc
 No match
     abcc
@@ -3976,10 +3847,7 @@ No match
 /abc$/
     aabc
  0: abc
-    *** Failers
-No match
-    aabc
- 0: abc
+\= Expect no match
     aabcd
 No match
 
@@ -4004,8 +3872,7 @@ No match
 /a[bc]d/
     abd
  0: abd
-    *** Failers
-No match
+\= Expect no match
     axyzd
 No match
     abc
@@ -4038,8 +3905,7 @@ No match
 /a[^bc]d/
     aed
  0: aed
-    *** Failers
-No match
+\= Expect no match
     abd
 No match
     abd
@@ -4052,10 +3918,9 @@ No match
 /a[^]b]c/
     adc
  0: adc
-    *** Failers
-No match
     a-c
  0: a-c
+\= Expect no match
     a]c
 No match
 
@@ -4068,8 +3933,7 @@ No match
  0: a
 
 /\by\b/
-    *** Failers
-No match
+\= Expect no match
     xy
 No match
     yz
@@ -4078,8 +3942,7 @@ No match
 No match
 
 /\Ba\B/
-    *** Failers
- 0: a
+\= Expect no match
     a-
 No match
     -a
@@ -4106,10 +3969,7 @@ No match
 /\W/
     -
  0: -
-    *** Failers
- 0: *
-    -
- 0: -
+\= Expect no match
     a
 No match
 
@@ -4120,10 +3980,7 @@ No match
 /a\Sb/
     a-b
  0: a-b
-    *** Failers
-No match
-    a-b
- 0: a-b
+\= Expect no match
     a b
 No match
 
@@ -4134,10 +3991,7 @@ No match
 /\D/
     -
  0: -
-    *** Failers
- 0: *
-    -
- 0: -
+\= Expect no match
     1
 No match
 
@@ -4148,10 +4002,7 @@ No match
 /[\W]/
     -
  0: -
-    *** Failers
- 0: *
-    -
- 0: -
+\= Expect no match
     a
 No match
 
@@ -4162,10 +4013,7 @@ No match
 /a[\S]b/
     a-b
  0: a-b
-    *** Failers
-No match
-    a-b
- 0: a-b
+\= Expect no match
     a b
 No match
 
@@ -4176,10 +4024,7 @@ No match
 /[\D]/
     -
  0: -
-    *** Failers
- 0: *
-    -
- 0: -
+\= Expect no match
     1
 No match
 
@@ -4269,14 +4114,13 @@ No match
  0: cde
 
 /abc/
-    *** Failers
-No match
+\= Expect no match
     b
 No match
-    
 
 /a*/
-    
+    \
+ 0: 
 
 /([abc])*d/
     abbbcd
@@ -4361,8 +4205,7 @@ No match
  0: adcdcde
 
 /a[bcd]+dcdcde/
-    *** Failers
-No match
+\= Expect no match
     abcde
 No match
     adcdcde
@@ -4400,8 +4243,7 @@ No match
     reffgz
  0: effgz
  1: effgz
-    *** Failers
-No match
+\= Expect no match
     effg
 No match
     bcdd
@@ -4449,8 +4291,7 @@ No match
  9: a
 
 /multiple words of text/
-    *** Failers
-No match
+\= Expect no match
     aa
 No match
     uh-uh
@@ -4500,13 +4341,11 @@ No match
 /(a)|\1/
     a
  0: a
- 1: a
-    *** Failers
- 0: a
  1: a
     ab
  0: a
  1: a
+\= Expect no match
     x
 No match
 
@@ -4543,8 +4382,7 @@ No match
  0: ABC
     ABABC
  0: ABC
-    *** Failers
-No match
+\= Expect no match
     aaxabxbaxbbx
 No match
     XBC
@@ -4577,8 +4415,7 @@ No match
  0: ABBC
 
 /ab+bc/i
-    *** Failers
-No match
+\= Expect no match
     ABC
 No match
     ABQ
@@ -4603,8 +4440,7 @@ No match
  0: ABBBBC
 
 /ab{4,5}?bc/i
-    *** Failers
-No match
+\= Expect no match
     ABQ
 No match
     ABBBBC
@@ -4633,8 +4469,7 @@ No match
 /^abc$/i
     ABC
  0: ABC
-    *** Failers
-No match
+\= Expect no match
     ABBBBC
 No match
     ABCC
@@ -4669,10 +4504,9 @@ No match
  0: AXYZC
 
 /a.*c/i
-    *** Failers
-No match
     AABC
  0: AABC
+\= Expect no match
     AXYZD
 No match
 
@@ -4683,8 +4517,7 @@ No match
 /a[b-d]e/i
     ACE
  0: ACE
-    *** Failers
-No match
+\= Expect no match
     ABC
 No match
     ABD
@@ -4717,8 +4550,7 @@ No match
 /a[^-b]c/i
     ADC
  0: ADC
-    *** Failers
-No match
+\= Expect no match
     ABD
 No match
     A-C
@@ -4740,8 +4572,7 @@ No match
  1: 
 
 /$b/i
-    *** Failers
-No match
+\= Expect no match
     A]C
 No match
     B
@@ -4833,11 +4664,6 @@ No match
     CDE
  0: CDE
 
-/abc/i
-
-/a*/i
-    
-
 /([abc])*d/i
     ABBBCD
  0: ABBBCD
@@ -4877,6 +4703,7 @@ No match
  0: HIJ
 
 /^(ab|cd)e/i
+\= Expect no match
     ABCDE
 No match
 
@@ -4956,8 +4783,7 @@ No match
     REFFGZ
  0: EFFGZ
  1: EFFGZ
-    *** Failers
-No match
+\= Expect no match
     ADCDCDE
 No match
     EFFG
@@ -5017,8 +4843,7 @@ No match
  1: C
 
 /multiple words of text/i
-    *** Failers
-No match
+\= Expect no match
     AA
 No match
     UH-UH
@@ -5176,8 +5001,7 @@ No match
     aaaaaaaaaa
  0: aaaaaaaaaa
  1: aaaa
-    *** Failers
-No match
+\= Expect no match
     AB
 No match
     aaaaaaaaa
@@ -5189,8 +5013,7 @@ No match
     aaaaaaaaaa
  0: aaaaaaaaaa
  1: aaaa
-    *** Failers
-No match
+\= Expect no match
     aaaaaaaaa
 No match
     aaaaaaaaaaa
@@ -5209,8 +5032,7 @@ No match
 /(?<=a)b/
     ab
  0: b
-    *** Failers
-No match
+\= Expect no match
     cb
 No match
     b
@@ -5286,8 +5108,7 @@ No match
  1: A
 
 /(?:(?i)a)b/
-    *** Failers
-No match
+\= Expect no match
     cb
 No match
     aB
@@ -5314,8 +5135,7 @@ No match
  1: A
 
 /(?i:a)b/
-    *** Failers
-No match
+\= Expect no match
     aB
 No match
     aB
@@ -5342,34 +5162,14 @@ No match
  1: a
 
 /(?:(?-i)a)b/i
-    *** Failers
-No match
     aB
  0: aB
-    Ab
-No match
-
-/((?-i)a)b/i
-
-/(?:(?-i)a)b/i
-    aB
- 0: aB
-
-/((?-i)a)b/i
-    aB
- 0: aB
- 1: a
-
-/(?:(?-i)a)b/i
-    *** Failers
-No match
+\= Expect no match
     Ab
 No match
     AB
 No match
 
-/((?-i)a)b/i
-
 /(?-i:a)b/i
     ab
  0: ab
@@ -5389,8 +5189,7 @@ No match
  1: a
 
 /(?-i:a)b/i
-    *** Failers
-No match
+\= Expect no match
     AB
 No match
     Ab
@@ -5408,8 +5207,7 @@ No match
  1: a
 
 /(?-i:a)b/i
-    *** Failers
-No match
+\= Expect no match
     Ab
 No match
     AB
@@ -5418,8 +5216,7 @@ No match
 /((?-i:a))b/i
 
 /((?-i:a.))b/i
-    *** Failers
-No match
+\= Expect no match
     AB
 No match
     a\nB
@@ -5464,8 +5261,7 @@ No match
  0: aaac
 
 /(?<![cd])b/
-    *** Failers
-No match
+\= Expect no match
     B\nB
 No match
     dbcb
@@ -5494,8 +5290,7 @@ No match
  0: ab
     aaa   
  0: aaa
-    *** Failers
-No match
+\= Expect no match
     dbcb
 No match
     a--
@@ -5553,8 +5348,7 @@ No match
 /^b/
 
 /()^b/
-    *** Failers
-No match
+\= Expect no match
     a\nb\nc\n
 No match
     a\nb\nc\n
@@ -5566,8 +5360,7 @@ No match
  1: b
 
 /(x)?(?(1)a|b)/
-    *** Failers
-No match
+\= Expect no match
     a
 No match
     a
@@ -5595,8 +5388,7 @@ No match
  2: )
     blah
  0: blah
-    *** Failers
-No match
+\= Expect no match
     a
 No match
     blah)
@@ -5611,8 +5403,7 @@ No match
  2: )
     blah
  0: blah
-    *** Failers
-No match
+\= Expect no match
     blah)
 No match
     (blah
@@ -5625,8 +5416,7 @@ No match
  0: a
 
 /(?(?=a)b|a)/
-    *** Failers
-No match
+\= Expect no match
     a
 No match
     a
@@ -5661,8 +5451,7 @@ No match
  2: aab
 
 /^(?=(a+?))\1ab/
-    *** Failers
-No match
+\= Expect no match
     aaab
 No match
     aaab
@@ -5697,10 +5486,7 @@ No match
  0: xy:z:::abcd
  1: xy:z:::
  2: abcd
-    *** Failers
- 0: Failers
- 1: <unset>
- 2: Failers
+\= Expect no match
     abcd:
 No match
     abcd:
@@ -5748,8 +5534,7 @@ No match
  1: x
 
 /a\Z/
-    *** Failers
-No match
+\= Expect no match
     aaab
 No match
     a\nb\n
@@ -5768,8 +5553,6 @@ No match
 /b\z/
     a\nb
  0: b
-    *** Failers
-No match
     
 /^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/
     a
@@ -5799,8 +5582,7 @@ No match
     12-ab.1245 
  0: 12-ab.1245
  1: 
-    *** Failers
-No match
+\= Expect no match
     \
 No match
     .a
@@ -5835,18 +5617,19 @@ No match
     endingwxyz
  0: endingwxyz
  1: wxyz
-    *** Failers
-No match
+\= Expect no match
     a rather long string that doesn't end with one of them
 No match
 
 /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/
     word cat dog elephant mussel cow horse canary baboon snake shark otherword
  0: word cat dog elephant mussel cow horse canary baboon snake shark otherword
+\= Expect no match
     word cat dog elephant mussel cow horse canary baboon snake shark
 No match
   
 /word (?>[a-zA-Z0-9]+ ){0,30}otherword/
+\= Expect no match
     word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
 No match
 
@@ -5855,8 +5638,7 @@ No match
  0: foo
     123999foo 
  0: foo
-    *** Failers
-No match
+\= Expect no match
     123abcfoo
 No match
     
@@ -5865,8 +5647,7 @@ No match
  0: foo
     123999foo 
  0: foo
-    *** Failers
-No match
+\= Expect no match
     123abcfoo
 No match
 
@@ -5875,8 +5656,7 @@ No match
  0: foo
     123456foo 
  0: foo
-    *** Failers
-No match
+\= Expect no match
     123999foo  
 No match
     
@@ -5885,8 +5665,7 @@ No match
  0: foo
     123456foo 
  0: foo
-    *** Failers
-No match
+\= Expect no match
     123999foo  
 No match
 
@@ -5992,8 +5771,7 @@ No match
  0: -
     0digit
  0: 0
-    *** Failers
-No match
+\= Expect no match
     bcdef    
 No match
     
@@ -6018,11 +5796,12 @@ No match
  0: ab
 
 /(?!\A)x/m
-  a\nxb\n
+    a\nxb\n
  0: x
 
 /(?!^)x/m
-  a\nxb\n
+\= Expect no match
+    a\nxb\n
 No match
 
 /abc\Qabc\Eabc/
@@ -6036,8 +5815,7 @@ No match
 /   abc\Q abc\Eabc/x
     abc abcabc
  0: abc abcabc
-    *** Failers
-No match
+\= Expect no match
     abcabcabc  
 No match
     
@@ -6077,8 +5855,7 @@ No match
 /\Gabc/
     abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     xyzabc  
 No match
 
@@ -6096,8 +5873,7 @@ No match
 /a(?x: b c )d/
     XabcdY
  0: abcd
-    *** Failers 
-No match
+\= Expect no match 
     Xa b c d Y 
 No match
 
@@ -6112,8 +5888,7 @@ No match
 /(?i)AB(?-i)C/
     XabCY
  0: abC
-    *** Failers
-No match
+\= Expect no match
     XabcY  
 No match
 
@@ -6124,8 +5899,7 @@ No match
     DE
  0: DE
  1: D
-    *** Failers
-No match
+\= Expect no match
     abcE
 No match
     abCe  
@@ -6192,8 +5966,7 @@ No match
     a123:ddde:9999:b342::324e:dcba:abcd
  0: a123:ddde:9999:b342::324e:dcba:abcd
  1: 
-    *** Failers
-No match
+\= Expect no match
     1:2:3:4:5:6:7:8
 No match
     a123:bce:ddde:9999:b342::324e:dcba:abcd
@@ -6222,12 +5995,12 @@ No match
  0: d
     ] 
  0: ]
-    *** Failers
- 0: a
+\= Expect no match
     b     
 No match
 
 /(a+)*b/
+\= Expect no match
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
 No match
     
@@ -6262,8 +6035,7 @@ No match
 /ab cd(?x) de fg/
     ab cddefg
  0: ab cddefg
-    ** Failers 
-No match
+\= Expect no match 
     abcddefg
 No match
 
@@ -6271,24 +6043,21 @@ No match
     foobarX 
  0: bar
  1: bar
-    ** Failers 
-No match
+\= Expect no match 
     boobarX
 No match
 
 /(?<![^f])X/
     offX
  0: X
-    ** Failers
-No match
+\= Expect no match
     onyX  
 No match
 
 /(?<=[^f])X/
     onyX
  0: X
-    ** Failers
-No match
+\= Expect no match
     offX 
 No match
 
@@ -6346,16 +6115,14 @@ No match
 "(?x)(?-x: \s*#\s*)"
     A # B
  0:  # 
-    ** Failers
-No match
+\= Expect no match
     #  
 No match
 
 "(?x-is)(?:(?-ixs) \s*#\s*) include"
     A #include
  0:  #include
-    ** Failers
-No match
+\= Expect no match
     A#include  
 No match
     A #Include
@@ -6433,16 +6200,14 @@ No match
 /^[\Eabc]/
     a
  0: a
-    ** Failers 
-No match
+\= Expect no match 
     E 
 No match
     
 /^[a-\Ec]/
     b
  0: b
-    ** Failers
-No match
+\= Expect no match
     -
 No match
     E    
@@ -6451,8 +6216,7 @@ No match
 /^[a\E\E-\Ec]/
     b
  0: b
-    ** Failers
-No match
+\= Expect no match
     -
 No match
     E    
@@ -6461,8 +6225,7 @@ No match
 /^[\E\Qa\E-\Qz\E]+/
     b
  0: b
-    ** Failers
-No match
+\= Expect no match
     -  
 No match
     
@@ -6514,23 +6277,26 @@ No match
  2: 
 
 /(a|)*\d/
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-No match
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  1: 
-
-/(?>a|)*\d/
+\= Expect no match
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 No match
+
+/(?>a|)*\d/
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
-
-/(?:a|)*\d/
+\= Expect no match
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 No match
+
+/(?:a|)*\d/
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
+\= Expect no match
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+No match
 
 /\Z/g
   abc\n
@@ -6540,18 +6306,21 @@ No match
 /^(?s)(?>.*)(?<!\n)/
   abc
  0: abc
+\= Expect no match
   abc\n  
 No match
 
 /^(?![^\n]*\n\z)/
   abc
  0: 
+\= Expect no match
   abc\n 
 No match
   
 /\z(?<!\n)/
   abc
  0: 
+\= Expect no match
   abc\n  
 No match
 
@@ -6596,6 +6365,7 @@ No match
  0: p
 
 /.*[op][xyz]/
+\= Expect no match
     fooabcfoo
 No match
 
@@ -6608,6 +6378,7 @@ No match
 /(?(?=^.*b)b|^)/
    adc
  0: 
+\= Expect no match
    abc 
 No match
 
@@ -6643,8 +6414,7 @@ No match
  0: Ab
     CcC 
  0: c
-    ** Failers
-No match
+\= Expect no match
     XABX   
 No match
 
@@ -6653,10 +6423,12 @@ No match
  0: \x0a\x0b\x0c\x0d
 
 /(abc)\1/i
+\= Expect no match
    abc
 No match
 
 /(abc)\1/
+\= Expect no match
    abc
 No match
 
@@ -6673,16 +6445,14 @@ No match
  0: 12
 
 /[^a]*?X/i
-    ** Failers
-No match
+\= Expect no match
     12abc
 No match
     12ABC
 No match
     
 /[^a]+?X/i
-    ** Failers
-No match
+\= Expect no match
     12abc
 No match
     12ABC
@@ -6807,10 +6577,12 @@ No match
  3: aabab
 
 /(?>a+|ab)+?c/
+\= Expect no match
     aabc
 No match
 
 /(?>a+|ab)+c/
+\= Expect no match
     aabc
 No match
 
@@ -6830,10 +6602,12 @@ No match
  2: b
 
 /^(?:a|ab)++c/
+\= Expect no match
     aaaabc
 No match
 
 /^(?>a|ab)++c/
+\= Expect no match
     aaaabc
 No match
 
@@ -6845,8 +6619,7 @@ No match
     abcabcabc
  0: abc
  0+ abcabc
-    ** Failers
-No match
+\= Expect no match
     xyz  
 No match
     
@@ -6854,8 +6627,7 @@ No match
     abcabcabc
  0: abc
  0+ abcabc
-    ** Failers
-No match
+\= Expect no match
     xyz  
 No match
     
@@ -6863,8 +6635,7 @@ No match
     abcabcabc
  0: abc
  0+ abcabc
-    ** Failers
-No match
+\= Expect no match
     xyz  
 No match
     
@@ -6873,8 +6644,7 @@ No match
  0: xyz
 
 /(?=abc){1}xyz/
-    ** Failers
-No match
+\= Expect no match
     xyz 
 No match
     
@@ -6913,8 +6683,7 @@ No match
 /^[\g<a>]+/
     ggg<<<aaa>>>
  0: ggg<<<aaa>>>
-    ** Failers
-No match
+\= Expect no match
     \\ga  
 No match
     
@@ -6937,16 +6706,14 @@ No match
 /(?<=a{2})b/i
     xaabc
  0: b
-    ** Failers
-No match
+\= Expect no match
     xabc  
 No match
 
 /(?<!a{2})b/i
     xabc
  0: b
-    ** Failers
-No match
+\= Expect no match
     xaabc  
 No match
 
@@ -6959,16 +6726,14 @@ No match
  0: b
     aAAbc 
  0: b
-    ** Failers
-No match
+\= Expect no match
     xaabc    
 No match
 
 /(?<=[^a]{2})b/i
     axxbc  
  0: b
-    ** Failers
-No match
+\= Expect no match
     aAAbc 
 No match
     xaabc    
@@ -6998,40 +6763,28 @@ No match
     aaaaaaa
  0: aaaaaaa
  1: aaa
-    ** Failers
-No match
+\= Expect no match
     aaaaaa
 No match
     aaaaaaaaa 
 No match
 
 /^(a{2,3})++a/
-    ** Failers
-No match
+\= Expect no match
     aaaaaa
 No match
 
 /^(a{2,3})*+a/
-    ** Failers
-No match
+\= Expect no match
     aaaaaa
 No match
 
-/ab\Cde/
-    abXde
- 0: abXde
-    
-/(?<=ab\Cde)X/
-    abZdeX
- 0: X
-
 /\H\h\V\v/
     X X\x0a
  0: X X\x0a
     X\x09X\x0b
  0: X\x09X\x0b
-    ** Failers
-No match
+\= Expect no match
     \xa0 X\x0a   
 No match
     
@@ -7042,8 +6795,7 @@ No match
  0: \x09 \xa0\x0a\x0b\x0c\x0d
     \x09\x20\xa0\x0a\x0b\x0c
  0: \x09 \xa0\x0a\x0b\x0c
-    ** Failers 
-No match
+\= Expect no match 
     \x09\x20\xa0\x0a\x0b
 No match
      
@@ -7062,8 +6814,7 @@ No match
  0: XNNNYZ
     >  X NYQZ
  0:   X NYQZ
-    ** Failers
-No match
+\= Expect no match
     >XYZ   
 No match
     >  X NY Z
@@ -7120,12 +6871,11 @@ No match
     abcdef
  0: 
  0+ def
-    ** Failers
-No match
+\= Expect no match
     defabcxyz   
 No match
 
-/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
+/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-2}Z/
     ababababbbabZXXXX
  0: ababababbbabZ
  1: ab
@@ -7140,6 +6890,7 @@ No match
  1: bon
     
 /(^(a|b\g{-1}))/
+\= Expect no match
     bacxxx
 No match
 
@@ -7150,8 +6901,7 @@ No match
     xyzxyz 
  0: xyzxyz
  1: xyz
-    ** Failers
-No match
+\= Expect no match
     abcxyz
 No match
     xyzabc   
@@ -7164,8 +6914,7 @@ No match
     xyzabc 
  0: xyzabc
  1: xyz
-    ** Failers 
-No match
+\= Expect no match 
     xyzxyz 
 No match
  
@@ -7207,8 +6956,7 @@ No match
     ab:ababxyz
  0: ab:abab
  1: ab
-    ** Failers
-No match
+\= Expect no match
     a:axyz
 No match
     ab:abxyz
@@ -7221,8 +6969,7 @@ No match
     ab:ababxyz
  0: ab:abab
  1: ab
-    ** Failers
-No match
+\= Expect no match
     a:axyz
 No match
     ab:abxyz
@@ -7272,8 +7019,7 @@ No match
  0: 10.0.0.0
  1: <unset>
  2: .0
-    ** Failers
-No match
+\= Expect no match
     10.6
 No match
     455.3.4.5
@@ -7289,8 +7035,7 @@ No match
     10.0.0.0
  0: 10.0.0.0
  1: .0
-    ** Failers
-No match
+\= Expect no match
     10.6
 No match
     455.3.4.5
@@ -7300,8 +7045,7 @@ No match
     now is the time for all good men to come to the aid of the party
  0: now is the time for all good men to come to the aid of the party
  1: party
-    *** Failers
-No match
+\= Expect no match
     this is not a line with only words and spaces!
 No match
 
@@ -7310,8 +7054,7 @@ No match
  0: 12345a
  1: 12345
  2: a
-    *** Failers
-No match
+\= Expect no match
     12345+
 No match
 
@@ -7341,8 +7084,7 @@ No match
     (abc(def)xyz)
  0: (abc(def)xyz)
  1: xyz
-    *** Failers
-No match
+\= Expect no match
     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 No match
 
@@ -7356,8 +7098,7 @@ No match
     a(b(c))d
  0: a(b(c))d
  1: d
-    *** Failers)
-No match
+\= Expect no match)
     a(b(c)d
 No match
 
@@ -7395,8 +7136,7 @@ No match
  2: <unset>
  3: AblewasIereIsawElba
  4: A
-    *** Failers
-No match
+\= Expect no match
     Thequickbrownfox
 No match
 
@@ -7411,8 +7151,7 @@ No match
     -12
  0: -12
  1: -12
-    *** Failers
-No match
+\= Expect no match
     ((2+2)*-3)-7)
 No match
 
@@ -7425,8 +7164,7 @@ No match
  0: xxyzxyzz
  1: xxyzxyzz
  2: xyzxyz
-    *** Failers
-No match
+\= Expect no match
     xxyzz
 No match
     xxyzxyzxyzz
@@ -7457,28 +7195,32 @@ No match
  0: <>
  1: <>
  2: <>
-    *** Failers
-No match
+\= Expect no match
     <abc
 No match
 
 /^a+(*FAIL)/
+\= Expect no match
     aaaaaa
 No match
     
 /a+b?c+(*FAIL)/
+\= Expect no match
     aaabccc
 No match
 
 /a+b?(*PRUNE)c+(*FAIL)/
+\= Expect no match
     aaabccc
 No match
 
 /a+b?(*COMMIT)c+(*FAIL)/
+\= Expect no match
     aaabccc
 No match
     
 /a+b?(*SKIP)c+(*FAIL)/
+\= Expect no match
     aaabcccaaabccc
 No match
 
@@ -7522,6 +7264,7 @@ No match
  1: ddd
 
 /a+b?(*THEN)c+(*FAIL)/
+\= Expect no match
     aaabccc
 No match
 
@@ -7544,8 +7287,7 @@ No match
  1: ACD
  2: C
  3: E
-    ** Failers
-No match
+\= Expect no match
     AD 
 No match
         
@@ -7572,8 +7314,7 @@ No match
  2: <unset>
  3: Able was I ere I saw Elba
  4: A
-    *** Failers
-No match
+\= Expect no match
     The quick brown fox
 No match
 
@@ -7601,6 +7342,7 @@ No match
  0: ablewasiereisawelba
  1: ablewasiereisawelba
  2: a
+\= Expect no match     
     rhubarb
 No match
     the quick brown fox  
@@ -7610,8 +7352,7 @@ No match
     baz
  0: a
  1: a
-    ** Failers
-No match
+\= Expect no match
     caz  
 No match
     
@@ -7619,8 +7360,7 @@ No match
     zbaaz
  0: a
  1: a
-    ** Failers
-No match
+\= Expect no match
     aaa  
 No match
     
@@ -7636,8 +7376,7 @@ No match
     defdef 
  0: defdef
  1: def
-    ** Failers
-No match
+\= Expect no match
     abcdef
 No match
     defabc   
@@ -7650,8 +7389,7 @@ No match
     defabc
  0: defabc
  1: def
-    ** Failers
-No match
+\= Expect no match
     defdef
 No match
     abcdef    
@@ -7671,8 +7409,7 @@ No match
  4: "
  5: <unset>
  6: "
-    ** Failers 
-No match
+\= Expect no match 
     b\"11111
 No match
 
@@ -7683,8 +7420,7 @@ No match
     CCD
  0: CC
  1: C
-    ** Failers
-No match
+\= Expect no match
     CAD   
 No match
 
@@ -7695,8 +7431,7 @@ No match
     BCD 
  0: BC
  1: C
-    ** Failers
-No match
+\= Expect no match
     ABCD
 No match
     CAD
@@ -7720,8 +7455,7 @@ No match
     BAX  
  0: BA
  1: A
-    ** Failers
-No match
+\= Expect no match
     ACX
 No match
     ABC   
@@ -7742,16 +7476,14 @@ No match
  2: ef
 
 /^(?=a(*SKIP)b|ac)/
-    ** Failers
-No match
+\= Expect no match
     ac
 No match
     
 /^(?=a(*PRUNE)b)/
     ab  
  0: 
-    ** Failers 
-No match
+\= Expect no match 
     ac
 No match
 
@@ -7825,14 +7557,14 @@ No match
 # I think is a Perl bug.
 
 /A(*COMMIT)(B|D)/
+\= Expect no match
     ACABX
 No match
 
 # Check the use of names for failure
 
 /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/mark
-    ** Failers
-No match
+\= Expect no match
     AC
 No match, mark = A
     CB    
@@ -7843,20 +7575,22 @@ No match, mark = B
  0: C
  1: C
 MK: A
+\= Expect no match
     D
 No match, mark = A
      
 /^(A(*THEN:A)B|C(*THEN:B)D)/mark
-    ** Failers
-No match
+\= Expect no match
     CB    
 No match, mark = B
 
 /^(?:A(*THEN:A)B|C(*THEN:B)D)/mark
+\= Expect no match
     CB    
 No match, mark = B
     
 /^(?>A(*THEN:A)B|C(*THEN:B)D)/mark
+\= Expect no match
     CB    
 No match, mark = B
     
@@ -7882,6 +7616,7 @@ No match, mark = B
  0: AC
 
 /(*:A)A+(*SKIP:A)(B|Z)/mark
+\= Expect no match
     AAAC
 No match, mark = A
 
@@ -7905,8 +7640,7 @@ MK: B
  1: A
  2: B
  3: C
-    ** Failers
-No match
+\= Expect no match
     DEFGABC  
 No match
 
@@ -7918,6 +7652,7 @@ No match
  1: a
 
 /(\w+)b(*COMMIT)\w{2}/
+\= Expect no match
     abbb
 No match
 
@@ -7930,10 +7665,12 @@ No match
 # COMMIT should override THEN.
 
 /(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/
+\= Expect no match
   yes
 No match
 
 /(?>(*COMMIT)(yes|no)(*THEN)(*F))?/
+\= Expect no match
   yes
 No match
 
@@ -7944,10 +7681,12 @@ No match
  0: bc
    
 /(*SKIP)bc/
+\= Expect no match
     a
 No match
 
 /(*SKIP)b/
+\= Expect no match
     a 
 No match
 
@@ -7963,9 +7702,7 @@ No match
     aA     
  0: aA
  1: a
-    ** Failers
- 0: **
- 1: *
+\= Expect no match
     ab
 No match
     aB
@@ -7978,8 +7715,7 @@ No match
 /^(?&t)*+(?(DEFINE)(?<t>a))\w$/
     aaaaaaX
  0: aaaaaaX
-    ** Failers 
-No match
+\= Expect no match 
     aaaaaa 
 No match
 
@@ -7998,8 +7734,7 @@ No match
  0: Y
  1: <unset>
  2: Y
-    ** Failers 
-No match
+\= Expect no match 
     aaaa
 No match
 
@@ -8010,8 +7745,7 @@ No match
     YZ 
  0: Y
  1: Y
-    ** Failers 
-No match
+\= Expect no match 
     aaaa
 No match
 
@@ -8020,8 +7754,7 @@ No match
  0: aaaaX
  1: a
  2: X
-    ** Failers 
-No match
+\= Expect no match 
     aaaa
 No match
     YZ 
@@ -8031,8 +7764,7 @@ No match
     aaaaX
  0: aaaaX
  1: X
-    ** Failers 
-No match
+\= Expect no match 
     aaaa
 No match
     YZ 
@@ -8061,8 +7793,7 @@ No match
  0: aaaaX
  1: a
  2: X
-    ** Failers
-No match
+\= Expect no match
     aaa
 No match
     YZ 
@@ -8072,8 +7803,7 @@ No match
     aaaaX
  0: aaaaX
  1: X
-    ** Failers
-No match
+\= Expect no match
     aaa
 No match
     YZ 
@@ -8091,16 +7821,14 @@ No match
  1: 
 
 /(a)++(?1)b/
-    ** Failers
-No match
+\= Expect no match
     ab 
 No match
     aab
 No match
 
 /(a)*+(?1)b/
-    ** Failers
-No match
+\= Expect no match
     ab
 No match
     aab  
@@ -8157,6 +7885,7 @@ No match
  1: a
     
 /^(a)(?1)++ab/
+\= Expect no match
     aaaab
 No match
 
@@ -8229,6 +7958,7 @@ MK: any \x0aname
 # Capture
 
 /^.*? (a(*THEN)b) c/x
+\= Expect no match
     aabc
 No match
 
@@ -8244,12 +7974,14 @@ No match
  2: ab
 
 /^.*? ( (a(*THEN)b) ) c/x
+\= Expect no match
     aabc
 No match
 
 # Non-capture
 
 /^.*? (?:a(*THEN)b) c/x
+\= Expect no match
     aabc
 No match
 
@@ -8262,12 +7994,14 @@ No match
  0: aabc
 
 /^.*? (?: (?:a(*THEN)b) ) c/x
+\= Expect no match
     aabc
 No match
 
 # Atomic
 
 /^.*? (?>a(*THEN)b) c/x
+\= Expect no match
     aabc
 No match
 
@@ -8280,12 +8014,14 @@ No match
  0: aabc
 
 /^.*? (?> (?>a(*THEN)b) ) c/x
+\= Expect no match
     aabc
 No match
 
 # Possessive capture
 
 /^.*? (a(*THEN)b)++ c/x
+\= Expect no match
     aabc
 No match
 
@@ -8301,12 +8037,14 @@ No match
  2: ab
 
 /^.*? ( (a(*THEN)b)++ )++ c/x
+\= Expect no match
     aabc
 No match
 
 # Possessive non-capture
 
 /^.*? (?:a(*THEN)b)++ c/x
+\= Expect no match
     aabc
 No match
 
@@ -8319,6 +8057,7 @@ No match
  0: aabc
 
 /^.*? (?: (?:a(*THEN)b)++ )++ c/x
+\= Expect no match
     aabc
 No match
     
@@ -8331,6 +8070,7 @@ No match
 # Condition
 
 /^.*?(?(?=a)a|b(*THEN)c)/
+\= Expect no match
     ba
 No match
 
@@ -8339,6 +8079,7 @@ No match
  0: ba
 
 /^.*?(?(?=a)a(*THEN)b|c)/
+\= Expect no match
     ac
 No match
 
@@ -8374,8 +8115,7 @@ MK: m
     xabcd
  0: c
  1: ab
-    ** Failers 
-No match
+\= Expect no match 
     xacd
 No match
     
@@ -8413,6 +8153,7 @@ MK: N
  0: C
  1: C
 MK: B
+\= Expect no match
     D 
 No match, mark = B
 
@@ -8421,6 +8162,7 @@ No match, mark = B
  0: C
  1: C
 MK: B
+\= Expect no match
     D 
 No match, mark = B
 
@@ -8429,6 +8171,7 @@ No match, mark = B
  0: C
  1: C
 MK: B
+\= Expect no match
     D 
 No match, mark = B
 
@@ -8437,6 +8180,7 @@ No match, mark = B
  0: C
  1: C
 MK: B
+\= Expect no match
     D 
 No match, mark = B
 
@@ -8445,28 +8189,33 @@ No match, mark = B
  0: C
  1: C
 MK: B
+\= Expect no match
     D 
 No match, mark = B
 
 # This should fail, as the skip causes a bump to offset 3 (the skip).
 
 /A(*MARK:A)A+(*SKIP)(B|Z) | AC/x,mark
+\= Expect no match
     AAAC
 No match, mark = A
 
 # Same 
 
 /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/x,mark
+\= Expect no match
     AAAC
 No match, mark = B
 
 /A(*:A)A+(*SKIP)(B|Z) | AC/x,mark
+\= Expect no match
     AAAC
 No match, mark = A
 
 # This should fail, as a null name is the same as no name.
 
 /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/x,mark
+\= Expect no match
     AAAC
 No match, mark = A
 
@@ -8482,8 +8231,7 @@ MK: A
     XXYZ 
  0: XXY
 MK: B
-    ** Failers
-No match
+\= Expect no match
     XAQQ  
 No match, mark = A
     XAQQXZZ  
@@ -8502,8 +8250,7 @@ MK: A
  0: CD
  1: CD
 MK: B
-    ** Failers
-No match
+\= Expect no match
     AC
 No match, mark = A
     CB    
@@ -8518,8 +8265,7 @@ MK: A
  0: CD
  1: CD
 MK: B
-    ** Failers
-No match
+\= Expect no match
     AC
 No match, mark = A
     CB    
@@ -8558,16 +8304,14 @@ MK: A
     aw 
  0: aw
 MK: n
-    ** Failers 
-No match, mark = n
+\= Expect no match 
     abc
 No match, mark = m
 
 /b(*:m)f|aw/mark
     abaw
  0: aw
-    ** Failers 
-No match
+\= Expect no match 
     abc
 No match, mark = m
     abax 
@@ -8578,14 +8322,12 @@ No match, mark = m
  0: AAC
 
 /a(*PRUNE:X)bc|qq/mark,no_start_optimize
-    ** Failers
-No match, mark = X
+\= Expect no match
     axy
 No match, mark = X
 
 /a(*THEN:X)bc|qq/mark,no_start_optimize
-    ** Failers
-No match, mark = X
+\= Expect no match
     axy
 No match, mark = X
 
@@ -8593,8 +8335,7 @@ No match, mark = X
     abxy
  0: abx
 MK: A
-    ** Failers
-No match
+\= Expect no match
     abpq  
 No match
 
@@ -8602,8 +8343,7 @@ No match
     abxy
  0: abx
 MK: Y
-    ** Failers
-No match
+\= Expect no match
     abpq  
 No match
 
@@ -8611,8 +8351,7 @@ No match
     abxy
  0: abx
 MK: A
-    ** Failers
-No match
+\= Expect no match
     abpq  
 No match
 
@@ -8620,8 +8359,7 @@ No match
     abxy
  0: abx
 MK: Y
-    ** Failers
-No match
+\= Expect no match
     abpq  
 No match
 
@@ -8629,8 +8367,7 @@ No match
     abxy
  0: abx
 MK: A
-    ** Failers
-No match
+\= Expect no match
     abpq  
 No match
 
@@ -8638,8 +8375,7 @@ No match
     abxy
  0: abx
 MK: Y
-    ** Failers
-No match
+\= Expect no match
     abpq  
 No match
 
@@ -8650,6 +8386,7 @@ No match
  2: 
 
 /(another)?(\1+)test/
+\= Expect no match
     hello world test
 No match
 
@@ -8675,22 +8412,6 @@ No match
     aba
  0: aba
 
-/.*?a(*PRUNE)b/
-    aab
- 0: ab
-
-/.*?a(*PRUNE)b/s
-    aab
- 0: ab
-
-/^a(*PRUNE)b/s
-    aab
-No match
-
-/.*?a(*SKIP)b/
-    aab
- 0: ab
-
 /(?>.*?a)b/s
     aab
  0: ab
@@ -8700,6 +8421,7 @@ No match
  0: ab
 
 /(?>^a)b/s
+\= Expect no match
     aab
 No match
 
@@ -8722,6 +8444,7 @@ No match
  2: wxyz
 
 "(?>.*)foo"
+\= Expect no match
     abcdfooxyz
 No match
     
@@ -8738,6 +8461,7 @@ No match
  0: ac
 
 /(?<=(*SKIP)ac)a/
+\= Expect no match
     aa
 No match
 
@@ -8827,6 +8551,7 @@ MK: n
 # This gives "no match", as expected. 
 
 /aaaaa(*COMMIT)b|a+c/
+\= Expect no match
     aaaaaac
 No match
 
@@ -8903,6 +8628,7 @@ No match
     abc
  0: abc
  1: ab
+\= Expect no match
     abd
 No match
 
@@ -8919,10 +8645,11 @@ No match
  0: abd
 
 /a(?=b(*COMMIT)c)[^d]|abd/
+    abc
+ 0: ab
+\= Expect no match
     abd
 No match
-    abc 
- 0: ab
 
 /a(?=bc).|abd/
     abd
@@ -8931,6 +8658,7 @@ No match
  0: ab
     
 /a(?>b(*COMMIT)c)d|abd/
+\= Expect no match
     abceabd 
 No match
 
@@ -8943,6 +8671,7 @@ No match
  0: abd
 
 /(?>a(*COMMIT)c)d|abd/
+\= Expect no match
     abd
 No match
 
@@ -8956,8 +8685,7 @@ No match
 # made them compatible. 
     
 /^(a)?(?(1)a|b)+$/
-    *** Failers
-No match
+\= Expect no match
     a
 No match
 
@@ -8977,8 +8705,8 @@ No match
     abcd
  0: abcd
 
-
 /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/x,mark
+\= Expect no match
     AAAC
 No match, mark = A
 
@@ -8986,68 +8714,82 @@ No match, mark = A
     abcd
  0: abcd
  1: abcd
-    *** Failers 
-No match
+\= Expect no match 
     abcxy 
 No match
     
 /^((yes|no)(*THEN)(*F))?/
+\= Expect no match
     yes
 No match
 
 /(A (.*)   C? (*THEN)  | A D) (*FAIL)/x
+\= Expect no match
     AbcdCBefgBhiBqz
 No match
 
 /(A (.*)   C? (*THEN)  | A D) z/x
+\= Expect no match
     AbcdCBefgBhiBqz
 No match
 
 /(A (.*)   C? (*THEN)  | A D) \s* (*FAIL)/x
+\= Expect no match
     AbcdCBefgBhiBqz
 No match
 
 /(A (.*)   C? (*THEN)  | A D) \s* z/x
+\= Expect no match
     AbcdCBefgBhiBqz
 No match
 
 /(A (.*)   (?:C|) (*THEN)  | A D) (*FAIL)/x
+\= Expect no match
     AbcdCBefgBhiBqz
 No match
 
 /(A (.*)   (?:C|) (*THEN)  | A D) z/x
+\= Expect no match
     AbcdCBefgBhiBqz
 No match
 
 /(A (.*)   C{0,6} (*THEN)  | A D) (*FAIL)/x
+\= Expect no match
     AbcdCBefgBhiBqz
 No match
 
 /(A (.*)   C{0,6} (*THEN)  | A D) z/x
+\= Expect no match
     AbcdCBefgBhiBqz
 No match
 
 /(A (.*)   (CE){0,6} (*THEN)  | A D) (*FAIL)/x
+\= Expect no match
     AbcdCEBefgBhiBqz
 No match
 
 /(A (.*)   (CE){0,6} (*THEN)  | A D) z/x
+\= Expect no match
     AbcdCEBefgBhiBqz
 No match
 
 /(A (.*)   (CE*){0,6} (*THEN)  | A D) (*FAIL)/x
+\= Expect no match
     AbcdCBefgBhiBqz
 No match
 
 /(A (.*)   (CE*){0,6} (*THEN)  | A D) z/x
+\= Expect no match
     AbcdCBefgBhiBqz
 No match
 
 /(?=a(*COMMIT)b|ac)ac|ac/
+\= Expect no match
     ac
 No match
 
 /(?=a(*COMMIT)b|(ac)) ac | (a)c/x
+\= Expect no match
     ac
 No match
 
@@ -9082,6 +8824,7 @@ No match
  0: bn
 
 /(?=b(*SKIP)a)bn|bnn/
+\= Expect no match
     bnn
 No match
 
@@ -9148,30 +8891,35 @@ MK: m(m
 /^\d*\w{4}/
     1234
  0: 1234
+\= Expect no match
     123 
 No match
 
 /^[^b]*\w{4}/
     aaaa
  0: aaaa
+\= Expect no match
     aaa     
 No match
 
 /^[^b]*\w{4}/i
     aaaa
  0: aaaa
+\= Expect no match
     aaa     
 No match
 
 /^a*\w{4}/
     aaaa
  0: aaaa
+\= Expect no match
     aaa     
 No match
 
 /^a*\w{4}/i
     aaaa
  0: aaaa
+\= Expect no match
     aaa     
 No match
 
@@ -9194,8 +8942,7 @@ No match
  1: A
  2: <unset>
  3: bar
-    ** Failers 
-No match
+\= Expect no match 
     Afoofoo
 No match
     Abarbar
@@ -9278,6 +9025,7 @@ No match
  1: ab
 
 /(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc/
+\= Expect no match
     acb
 No match
 
@@ -9337,6 +9085,7 @@ No match
  2: b
 
 /(?:(?P=same)?(?:(?P=same)(?P<same>a)(?P=same)|(?P=same)?(?P<same>b)(?P=same)){2}(?P=same)(?P<same>c)(?P=same)){2}(?P<same>z)?/g,dupnames
+\= Expect no match
     bbbaaaccccaaabbbcc
 No match
 
@@ -9463,4 +9212,49 @@ No match
  0: 
  1: 
 
+/(?|(aaa)|(b))\g{1}/
+    aaaaaa
+ 0: aaaaaa
+ 1: aaa
+    bb 
+ 0: bb
+ 1: b
+
+/(?|(aaa)|(b))(?1)/
+    aaaaaa
+ 0: aaaaaa
+ 1: aaa
+    baaa 
+ 0: baaa
+ 1: b
+\= Expect no match 
+    bb 
+No match
+
+/(?|(aaa)|(b))/
+    xaaa
+ 0: aaa
+ 1: aaa
+    xbc 
+ 0: b
+ 1: b
+
+/(?|(?'a'aaa)|(?'a'b))\k'a'/
+    aaaaaa
+ 0: aaaaaa
+ 1: aaa
+    bb 
+ 0: bb
+ 1: b
+
+/(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/dupnames
+    aaaccccaaa
+ 0: aaaccccaaa
+ 1: aaa
+ 2: cccc
+    bccccb 
+ 0: bccccb
+ 1: b
+ 2: cccc
+
 # End of testinput1 
index ef248db8f79f2d8a30ed0e66672b79ad88b58c10..9761f0f5c6b3aab54d31ab4151ec9cba1a155119 100644 (file)
@@ -1,70 +1,10 @@
 # This set of tests is for UTF-8 support and Unicode property support, with
 # relevance only for the 8-bit library.
 
-/X(\C{3})/utf
-    X\x{1234}
- 0: X\x{1234}
- 1: \x{1234}
-
-/X(\C{4})/utf
-    X\x{1234}YZ
- 0: X\x{1234}Y
- 1: \x{1234}Y
-
-/X\C*/utf
-    XYZabcdce
- 0: XYZabcdce
-
-/X\C*?/utf
-    XYZabcde
- 0: X
-
-/X\C{3,5}/utf
-    Xabcdefg
- 0: Xabcde
-    X\x{1234}
- 0: X\x{1234}
-    X\x{1234}YZ
- 0: X\x{1234}YZ
-    X\x{1234}\x{512}
- 0: X\x{1234}\x{512}
-    X\x{1234}\x{512}YZ
- 0: X\x{1234}\x{512}
-
-/X\C{3,5}?/utf
-    Xabcdefg
- 0: Xabc
-    X\x{1234}
- 0: X\x{1234}
-    X\x{1234}YZ
- 0: X\x{1234}
-    X\x{1234}\x{512}
- 0: X\x{1234}
-
-/a\Cb/utf
-    aXb
- 0: aXb
-    a\nb
- 0: a\x{0a}b
-
-/a\C\Cb/utf
-    a\x{100}b
- 0: a\x{100}b
-
-/ab\Cde/utf
-    abXde
- 0: abXde
-
-/a\C\Cb/utf
-    a\x{100}b
- 0: a\x{100}b
-    ** Failers
-No match
-    a\x{12257}b
-No match
+# The next 4 patterns have UTF-8 errors
 
 /[Ã]/utf
-Failed: error -8 at offset 0: UTF-8 error: byte 2 top bits not 0x80
+Failed: error -8 at offset 1: UTF-8 error: byte 2 top bits not 0x80
 
 /Ã/utf
 Failed: error -3 at offset 0: UTF-8 error: 1 byte missing at end
@@ -72,7 +12,13 @@ Failed: error -3 at offset 0: UTF-8 error: 1 byte missing at end
 /ÃÃÃxxx/utf
 Failed: error -8 at offset 0: UTF-8 error: byte 2 top bits not 0x80
 
+/Ã\82\82\82\82\82\82\82\82Ã/utf
+Failed: error -22 at offset 2: UTF-8 error: isolated byte with 0x80 bit set
+
+# Now test subjects
+
 /badutf/utf
+\= Expect UTF-8 errors
     X\xdf
 Failed: error -3: UTF-8 error: 1 byte missing at end at offset 1
     XX\xef
@@ -146,13 +92,14 @@ Failed: error -20: UTF-8 error: overlong 5-byte sequence at offset 0
     \xfc\x80\x80\x80\x80\x8f
 Failed: error -21: UTF-8 error: overlong 6-byte sequence at offset 0
     \x80
-Failed: error -22: UTF-8 error: isolated 0x80 byte at offset 0
+Failed: error -22: UTF-8 error: isolated byte with 0x80 bit set at offset 0
     \xfe
 Failed: error -23: UTF-8 error: illegal byte (0xfe or 0xff) at offset 0
     \xff
 Failed: error -23: UTF-8 error: illegal byte (0xfe or 0xff) at offset 0
 
 /badutf/utf
+\= Expect UTF-8 errors
     XX\xfb\x80\x80\x80\x80
 Failed: error -13: UTF-8 error: 5-byte character is not allowed (RFC 3629) at offset 2
     XX\xfd\x80\x80\x80\x80\x80
@@ -161,6 +108,7 @@ Failed: error -14: UTF-8 error: 6-byte character is not allowed (RFC 3629) at of
 Failed: error -15: UTF-8 error: code points greater than 0x10ffff are not defined at offset 2
 
 /shortutf/utf
+\= Expect UTF-8 errors
     XX\xdf\=ph
 Failed: error -3: UTF-8 error: 1 byte missing at end at offset 2
     XX\xef\=ph
@@ -193,6 +141,7 @@ Failed: error -4: UTF-8 error: 2 bytes missing at end at offset 0
 Failed: error -3: UTF-8 error: 1 byte missing at end at offset 0
 
 /anything/utf
+\= Expect UTF-8 errors
     X\xc0\x80
 Failed: error -17: UTF-8 error: overlong 2-byte sequence at offset 1
     XX\xc1\x8f
@@ -209,6 +158,15 @@ Failed: error -21: UTF-8 error: overlong 6-byte sequence at offset 0
 Failed: error -23: UTF-8 error: illegal byte (0xfe or 0xff) at offset 0
     \xff\x80\x80\x80\x80\x80
 Failed: error -23: UTF-8 error: illegal byte (0xfe or 0xff) at offset 0
+    \xf8\x88\x80\x80\x80
+Failed: error -13: UTF-8 error: 5-byte character is not allowed (RFC 3629) at offset 0
+    \xf9\x87\x80\x80\x80
+Failed: error -13: UTF-8 error: 5-byte character is not allowed (RFC 3629) at offset 0
+    \xfc\x84\x80\x80\x80\x80
+Failed: error -14: UTF-8 error: 6-byte character is not allowed (RFC 3629) at offset 0
+    \xfd\x83\x80\x80\x80\x80
+Failed: error -14: UTF-8 error: 6-byte character is not allowed (RFC 3629) at offset 0
+\= Expect no match
     \xc3\x8f
 No match
     \xe0\xaf\x80
@@ -219,14 +177,6 @@ No match
 No match
     \xf1\x8f\x80\x80
 No match
-    \xf8\x88\x80\x80\x80
-Failed: error -13: UTF-8 error: 5-byte character is not allowed (RFC 3629) at offset 0
-    \xf9\x87\x80\x80\x80
-Failed: error -13: UTF-8 error: 5-byte character is not allowed (RFC 3629) at offset 0
-    \xfc\x84\x80\x80\x80\x80
-Failed: error -14: UTF-8 error: 6-byte character is not allowed (RFC 3629) at offset 0
-    \xfd\x83\x80\x80\x80\x80
-Failed: error -14: UTF-8 error: 6-byte character is not allowed (RFC 3629) at offset 0
     \xf8\x88\x80\x80\x80\=no_utf_check
 No match
     \xf9\x87\x80\x80\x80\=no_utf_check
@@ -235,7 +185,62 @@ No match
 No match
     \xfd\x83\x80\x80\x80\x80\=no_utf_check
 No match
+    
+# Similar tests with offsets
 
+/badutf/utf
+\= Expect UTF-8 errors
+    X\xdfabcd
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+    X\xdfabcd\=offset=1
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+\= Expect no match
+    X\xdfabcd\=offset=2
+No match
+
+/(?<=x)badutf/utf
+\= Expect UTF-8 errors
+    X\xdfabcd
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+    X\xdfabcd\=offset=1
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+    X\xdfabcd\=offset=2
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+    X\xdfabcd\xdf\=offset=3
+Failed: error -3: UTF-8 error: 1 byte missing at end at offset 6
+\= Expect no match
+    X\xdfabcd\=offset=3
+No match
+
+/(?<=xx)badutf/utf
+\= Expect UTF-8 errors
+    X\xdfabcd
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+    X\xdfabcd\=offset=1
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+    X\xdfabcd\=offset=2
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+    X\xdfabcd\=offset=3
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+
+/(?<=xxxx)badutf/utf
+\= Expect UTF-8 errors
+    X\xdfabcd
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+    X\xdfabcd\=offset=1
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+    X\xdfabcd\=offset=2
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+    X\xdfabcd\=offset=3
+Failed: error -8: UTF-8 error: byte 2 top bits not 0x80 at offset 1
+    X\xdfabc\xdf\=offset=6
+Failed: error -3: UTF-8 error: 1 byte missing at end at offset 5
+    X\xdfabc\xdf\=offset=7
+Failed: error -33: bad offset value
+\= Expect no match
+    X\xdfabcd\=offset=6
+No match
 /\x{100}/IB,utf
 ------------------------------------------------------------------
         Bra
@@ -448,29 +453,6 @@ First code unit = \xf0
 Last code unit = \xab
 Subject length lower bound = 1
 
-# This one is here not because it's different to Perl, but because the way
-# the captured single-byte is displayed. (In Perl it becomes a character, and you
-# can't tell the difference.)
-
-/X(\C)(.*)/utf
-    X\x{1234}
- 0: X\x{1234}
- 1: \x{e1}
- 2: \x{88}\x{b4}
-    X\nabc
- 0: X\x{0a}abc
- 1: \x{0a}
- 2: abc
-
-# This one is here because Perl gives out a grumbly error message (quite
-# correctly, but that messes up comparisons).
-
-/a\Cb/utf
-    *** Failers
-No match
-    a\x{100}b
-No match
-
 /[^ab\xC0-\xF0]/IB,utf
 ------------------------------------------------------------------
         Bra
@@ -499,8 +481,7 @@ Subject length lower bound = 1
  0: \x{100}
     \x{1000}
  0: \x{1000}
-    *** Failers
- 0: *
+\= Expect no match
     \x{c0}
 No match
     \x{f0}
@@ -659,8 +640,6 @@ Subject length lower bound = 1
  0: \x{100}
     \x{100}Z
  0: \x{100}
-    *** Failers
-No match
 
 /[\xff]/IB,utf
 ------------------------------------------------------------------
@@ -750,33 +729,35 @@ Failed: error 106 at offset 15: missing terminating ] for character class
 # This tests the stricter UTF-8 check according to RFC 3629.
 
 /X/utf
+\= Expect UTF-8 errors
     \x{d800}
 Failed: error -16: UTF-8 error: code points 0xd800-0xdfff are not defined at offset 0
-    \x{d800}\=no_utf_check
-No match
     \x{da00}
 Failed: error -16: UTF-8 error: code points 0xd800-0xdfff are not defined at offset 0
-    \x{da00}\=no_utf_check
-No match
     \x{dfff}
 Failed: error -16: UTF-8 error: code points 0xd800-0xdfff are not defined at offset 0
-    \x{dfff}\=no_utf_check
-No match
     \x{110000}
 Failed: error -15: UTF-8 error: code points greater than 0x10ffff are not defined at offset 0
-    \x{110000}\=no_utf_check
-No match
     \x{2000000}
 Failed: error -13: UTF-8 error: 5-byte character is not allowed (RFC 3629) at offset 0
-    \x{2000000}\=no_utf_check
-No match
     \x{7fffffff}
 Failed: error -14: UTF-8 error: 6-byte character is not allowed (RFC 3629) at offset 0
+\= Expect no match
+    \x{d800}\=no_utf_check
+No match
+    \x{da00}\=no_utf_check
+No match
+    \x{dfff}\=no_utf_check
+No match
+    \x{110000}\=no_utf_check
+No match
+    \x{2000000}\=no_utf_check
+No match
     \x{7fffffff}\=no_utf_check
 No match
 
 /(*UTF8)\x{1234}/
-  abcd\x{1234}pqr
+    abcd\x{1234}pqr
  0: \x{1234}
 
 /(*CRLF)(*UTF)(*BSR_UNICODE)a\Rb/I
@@ -887,16 +868,19 @@ Subject length lower bound = 3
 /a+/utf
     a\x{123}aa\=offset=1
  0: aa
-    a\x{123}aa\=offset=2
-Error -36 (bad UTF-8 offset)
     a\x{123}aa\=offset=3
  0: aa
     a\x{123}aa\=offset=4
  0: a
-    a\x{123}aa\=offset=5
-No match
+\= Expect bad offset value
     a\x{123}aa\=offset=6
 Failed: error -33: bad offset value
+\= Expect bad UTF-8 offset     
+    a\x{123}aa\=offset=2
+Error -36 (bad UTF-8 offset)
+\= Expect no match
+    a\x{123}aa\=offset=5
+No match
 
 /\x{1234}+/Ii,utf
 Capturing subpattern count = 0
@@ -1281,8 +1265,6 @@ Subject length lower bound = 1
  0: \x{100}
     \x{100}Z
  0: \x{100}
-    *** Failers 
-No match
 
 /[z-\x{100}]/IB,utf
 ------------------------------------------------------------------
@@ -1467,8 +1449,7 @@ Subject length lower bound = 1
  0: \x{105}
     \x{109}  
  0: \x{109}
-    ** Failers
-No match
+\= Expect no match
     \x{100}
 No match
     \x{10a} 
@@ -1507,8 +1488,7 @@ Subject length lower bound = 1
  0: \x{100}
     \x{101} 
  0: \x{101}
-    ** Failers
-No match
+\= Expect no match
     \x{102}
 No match
     Y
@@ -1547,7 +1527,16 @@ Last code unit = 'B' (caseless)
 Subject length lower bound = 2
 
 /abc/utf,replace=Ã
-   abc
+    abc
 Failed: error -3: UTF-8 error: 1 byte missing at end
 
+/(?<=(a)(?-1))x/I,utf
+Capturing subpattern count = 1
+Max lookbehind = 2
+Options: utf
+First code unit = 'x'
+Subject length lower bound = 1
+    a\x80zx\=offset=3
+Failed: error -22: UTF-8 error: isolated byte with 0x80 bit set at offset 1
+
 # End of testinput10
index eda8938dce84351e0cffbbfb7e93a57a15e474d0..03e04bcf055c01e7d2856388f1c7e410d4bbde8f 100644 (file)
@@ -4,13 +4,8 @@
 # different, so they have separate output files.
     
 #forbid_utf
+#newline_default LF ANY ANYCRLF
 
-/a\Cb/
-    aXb
- 0: aXb
-    a\nb
- 0: a\x0ab
-  
 /[^\x{c4}]/IB
 ------------------------------------------------------------------
         Bra
@@ -581,7 +576,7 @@ Failed: error 134 at offset 11: character code point value in \x{} or \o{} is to
 
 # Non-UTF characters 
 
-/\C{2,3}/
+/.{2,3}/
     \x{400000}\x{400001}\x{400002}\x{400003}
 ** Character \x{400000} is greater than 0xffff and UTF-16 mode is not enabled.
 ** Truncation will probably give the wrong result.
@@ -646,4 +641,6 @@ Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0e
   \xfc \xfd \xfe \xff 
 Subject length lower bound = 1
 
+/(*THEN:\[A]{65501})/expand
+
 # End of testinput11
index f048785282e8b5d5631d1ca05cf45ff6626f20a2..390ebe0c481795aa6ceca7274cc0c357c839eceb 100644 (file)
@@ -4,13 +4,8 @@
 # different, so they have separate output files.
     
 #forbid_utf
+#newline_default LF ANY ANYCRLF
 
-/a\Cb/
-    aXb
- 0: aXb
-    a\nb
- 0: a\x0ab
-  
 /[^\x{c4}]/IB
 ------------------------------------------------------------------
         Bra
@@ -582,7 +577,7 @@ Subject length lower bound = 2
 
 # Non-UTF characters 
 
-/\C{2,3}/
+/.{2,3}/
     \x{400000}\x{400001}\x{400002}\x{400003}
  0: \x{400000}\x{400001}\x{400002}
 
@@ -649,4 +644,6 @@ Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0e
   \xfc \xfd \xfe \xff 
 Subject length lower bound = 1
 
+/(*THEN:\[A]{65501})/expand
+
 # End of testinput11
index 81584dd89bec7c4c8c8fd3c05eea68e49f48d8d8..383a032fa4a57ce61995bfda4d73ff557d84d31c 100644 (file)
@@ -9,78 +9,6 @@
     Ã]
 ** Failed: invalid UTF-8 string cannot be used as input in UTF mode
 
-/X(\C{3})/utf
-    X\x{11234}Y
- 0: X\x{11234}Y
- 1: \x{11234}Y
-    X\x{11234}YZ
- 0: X\x{11234}Y
- 1: \x{11234}Y
-
-/X(\C{4})/utf
-    X\x{11234}YZ
- 0: X\x{11234}YZ
- 1: \x{11234}YZ
-    X\x{11234}YZW
- 0: X\x{11234}YZ
- 1: \x{11234}YZ
-
-/X\C*/utf
-    XYZabcdce
- 0: XYZabcdce
-
-/X\C*?/utf
-    XYZabcde
- 0: X
-
-/X\C{3,5}/utf
-    Xabcdefg
- 0: Xabcde
-    X\x{11234}Y
- 0: X\x{11234}Y
-    X\x{11234}YZ
- 0: X\x{11234}YZ
-    X\x{11234}\x{512}
- 0: X\x{11234}\x{512}
-    X\x{11234}\x{512}YZ
- 0: X\x{11234}\x{512}YZ
-    X\x{11234}\x{512}\x{11234}Z
- 0: X\x{11234}\x{512}\x{11234}
-
-/X\C{3,5}?/utf
-    Xabcdefg
- 0: Xabc
-    X\x{11234}Y
- 0: X\x{11234}Y
-    X\x{11234}YZ
- 0: X\x{11234}Y
-    X\x{11234}\x{512}YZ
- 0: X\x{11234}\x{512}
-    *** Failers
-No match
-    X\x{11234}
-No match
-
-/a\Cb/utf
-    aXb
- 0: aXb
-    a\nb
- 0: a\x{0a}b
-
-/a\C\Cb/utf
-    a\x{12257}b
- 0: a\x{12257}b
-    a\x{12257}\x{11234}b
-No match
-    ** Failers
-No match
-    a\x{100}b
-No match
-
-/ab\Cde/utf
-    abXde
- 0: abXde
-
 # Check maximum character size 
 
 /\x{ffff}/IB,utf
@@ -310,29 +238,6 @@ First code unit = \x{d844}
 Last code unit = \x{deab}
 Subject length lower bound = 1
 
-# This one is here not because it's different to Perl, but because the way
-# the captured single-byte is displayed. (In Perl it becomes a character, and you
-# can't tell the difference.) 
-
-/X(\C)(.*)/utf
-    X\x{1234}
- 0: X\x{1234}
- 1: \x{1234}
- 2: 
-    X\nabc
- 0: X\x{0a}abc
- 1: \x{0a}
- 2: abc
-
-# This one is here because Perl gives out a grumbly error message (quite
-# correctly, but that messes up comparisons). 
-
-/a\Cb/utf
-    *** Failers
-No match
-    a\x{100}b
- 0: a\x{100}b
-
 /[^ab\xC0-\xF0]/IB,utf
 ------------------------------------------------------------------
         Bra
@@ -362,8 +267,7 @@ Subject length lower bound = 1
  0: \x{100}
     \x{1000}
  0: \x{1000}
-    *** Failers
- 0: *
+\= Expect no match
     \x{c0}
 No match
     \x{f0}
@@ -520,8 +424,6 @@ Subject length lower bound = 1
  0: \x{100}
     \x{100}Z
  0: \x{100}
-    *** Failers
-No match
 
 /[\xff]/IB,utf
 ------------------------------------------------------------------
@@ -607,30 +509,38 @@ Subject length lower bound = 2
 Failed: error 106 at offset 13: missing terminating ] for character class
 
 /X/utf
-    XX\x{d800}
-Failed: error -24: UTF-16 error: missing low surrogate at end at offset 2
     XX\x{d800}\=no_utf_check
  0: X
-    XX\x{da00}
-Failed: error -24: UTF-16 error: missing low surrogate at end at offset 2
     XX\x{da00}\=no_utf_check
  0: X
-    XX\x{dc00}
-Failed: error -26: UTF-16 error: isolated low surrogate at offset 2
     XX\x{dc00}\=no_utf_check
  0: X
-    XX\x{de00}
-Failed: error -26: UTF-16 error: isolated low surrogate at offset 2
     XX\x{de00}\=no_utf_check
  0: X
-    XX\x{dfff}
-Failed: error -26: UTF-16 error: isolated low surrogate at offset 2
     XX\x{dfff}\=no_utf_check
  0: X
+\= Expect UTF error
+    XX\x{d800}
+Failed: error -24: UTF-16 error: missing low surrogate at end at offset 2
+    XX\x{da00}
+Failed: error -24: UTF-16 error: missing low surrogate at end at offset 2
+    XX\x{dc00}
+Failed: error -26: UTF-16 error: isolated low surrogate at offset 2
+    XX\x{de00}
+Failed: error -26: UTF-16 error: isolated low surrogate at offset 2
+    XX\x{dfff}
+Failed: error -26: UTF-16 error: isolated low surrogate at offset 2
     XX\x{110000}
 ** Failed: character \x{110000} is greater than 0x10ffff and so cannot be converted to UTF-16
     XX\x{d800}\x{1234}
 Failed: error -25: UTF-16 error: invalid low surrogate at offset 3
+\= Expect no match
+    XX\x{d800}\=offset=3
+No match
+    
+/(?<=.)X/utf
+    XX\x{d800}\=offset=3
+Failed: error -24: UTF-16 error: missing low surrogate at end at offset 2
 
 /(*UTF16)\x{11234}/
   abcd\x{11234}pqr
@@ -788,8 +698,10 @@ Subject length lower bound = 3
  0: aa
     a\x{123}aa\=offset=3
  0: a
+\= Expect no match
     a\x{123}aa\=offset=4
 No match
+\= Expect bad offset error     
     a\x{123}aa\=offset=5
 Failed: error -33: bad offset value
     a\x{123}aa\=offset=6
@@ -854,16 +766,21 @@ Subject length lower bound = 1
 # Check bad offset 
 
 /a/utf
+\= Expect bad UTF-16 offset, or no match in 32-bit
     \x{10000}\=offset=1
 Error -36 (bad UTF-16 offset)
     \x{10000}ab\=offset=1
 Error -36 (bad UTF-16 offset)
+\= Expect 16-bit match, 32-bit no match
     \x{10000}ab\=offset=2
  0: a
+\= Expect no match     
     \x{10000}ab\=offset=3
 No match
+\= Expect no match in 16-bit, bad offset in 32-bit    
     \x{10000}ab\=offset=4
 No match
+\= Expect bad offset     
     \x{10000}ab\=offset=5
 Failed: error -33: bad offset value
 
@@ -1123,10 +1040,6 @@ Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too
 /\o{4200000}/utf
 Failed: error 134 at offset 10: character code point value in \x{} or \o{} is too large
 
-/\C/utf
-    \x{110000}
-** Failed: character \x{110000} is greater than 0x10ffff and so cannot be converted to UTF-16
-
 /\x{100}*A/IB,utf
 ------------------------------------------------------------------
         Bra
@@ -1174,8 +1087,6 @@ Subject length lower bound = 1
  0: \x{100}
     \x{100}Z
  0: \x{100}
-    *** Failers 
-No match
 
 /[z-\x{100}]/IB,utf
 ------------------------------------------------------------------
@@ -1365,8 +1276,7 @@ Subject length lower bound = 1
  0: \x{105}
     \x{109}  
  0: \x{109}
-    ** Failers
-No match
+\= Expect no match
     \x{100}
 No match
     \x{10a} 
@@ -1410,8 +1320,7 @@ Subject length lower bound = 1
  0: \x{100}
     \x{101} 
  0: \x{101}
-    ** Failers
-No match
+\= Expect no match
     \x{102}
 No match
     Y
@@ -1454,4 +1363,8 @@ Starting code units: \xff
 Last code unit = 'B' (caseless)
 Subject length lower bound = 2
 
+/./utf
+    \x{110000}
+** Failed: character \x{110000} is greater than 0x10ffff and so cannot be converted to UTF-16
+
 # End of testinput12
index 89ac70a6f936fe782e8841bc0ecb3c775b27ad79..95f1834049bd1807b97be97e34a5b333a0aed8e2 100644 (file)
@@ -9,76 +9,6 @@
     Ã]
 ** Failed: invalid UTF-8 string cannot be used as input in UTF mode
 
-/X(\C{3})/utf
-    X\x{11234}Y
-No match
-    X\x{11234}YZ
- 0: X\x{11234}YZ
- 1: \x{11234}YZ
-
-/X(\C{4})/utf
-    X\x{11234}YZ
-No match
-    X\x{11234}YZW
- 0: X\x{11234}YZW
- 1: \x{11234}YZW
-
-/X\C*/utf
-    XYZabcdce
- 0: XYZabcdce
-
-/X\C*?/utf
-    XYZabcde
- 0: X
-
-/X\C{3,5}/utf
-    Xabcdefg
- 0: Xabcde
-    X\x{11234}Y
-No match
-    X\x{11234}YZ
- 0: X\x{11234}YZ
-    X\x{11234}\x{512}
-No match
-    X\x{11234}\x{512}YZ
- 0: X\x{11234}\x{512}YZ
-    X\x{11234}\x{512}\x{11234}Z
- 0: X\x{11234}\x{512}\x{11234}Z
-
-/X\C{3,5}?/utf
-    Xabcdefg
- 0: Xabc
-    X\x{11234}Y
-No match
-    X\x{11234}YZ
- 0: X\x{11234}YZ
-    X\x{11234}\x{512}YZ
- 0: X\x{11234}\x{512}Y
-    *** Failers
-No match
-    X\x{11234}
-No match
-
-/a\Cb/utf
-    aXb
- 0: aXb
-    a\nb
- 0: a\x{0a}b
-
-/a\C\Cb/utf
-    a\x{12257}b
-No match
-    a\x{12257}\x{11234}b
- 0: a\x{12257}\x{11234}b
-    ** Failers
-No match
-    a\x{100}b
-No match
-
-/ab\Cde/utf
-    abXde
- 0: abXde
-
 # Check maximum character size 
 
 /\x{ffff}/IB,utf
@@ -303,29 +233,6 @@ Options: utf
 First code unit = \x{212ab}
 Subject length lower bound = 1
 
-# This one is here not because it's different to Perl, but because the way
-# the captured single-byte is displayed. (In Perl it becomes a character, and you
-# can't tell the difference.) 
-
-/X(\C)(.*)/utf
-    X\x{1234}
- 0: X\x{1234}
- 1: \x{1234}
- 2: 
-    X\nabc
- 0: X\x{0a}abc
- 1: \x{0a}
- 2: abc
-
-# This one is here because Perl gives out a grumbly error message (quite
-# correctly, but that messes up comparisons). 
-
-/a\Cb/utf
-    *** Failers
-No match
-    a\x{100}b
- 0: a\x{100}b
-
 /[^ab\xC0-\xF0]/IB,utf
 ------------------------------------------------------------------
         Bra
@@ -355,8 +262,7 @@ Subject length lower bound = 1
  0: \x{100}
     \x{1000}
  0: \x{1000}
-    *** Failers
- 0: *
+\= Expect no match
     \x{c0}
 No match
     \x{f0}
@@ -513,8 +419,6 @@ Subject length lower bound = 1
  0: \x{100}
     \x{100}Z
  0: \x{100}
-    *** Failers
-No match
 
 /[\xff]/IB,utf
 ------------------------------------------------------------------
@@ -600,30 +504,38 @@ Subject length lower bound = 2
 Failed: error 106 at offset 13: missing terminating ] for character class
 
 /X/utf
-    XX\x{d800}
-Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
     XX\x{d800}\=no_utf_check
  0: X
-    XX\x{da00}
-Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
     XX\x{da00}\=no_utf_check
  0: X
-    XX\x{dc00}
-Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
     XX\x{dc00}\=no_utf_check
  0: X
-    XX\x{de00}
-Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
     XX\x{de00}\=no_utf_check
  0: X
-    XX\x{dfff}
-Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
     XX\x{dfff}\=no_utf_check
  0: X
+\= Expect UTF error
+    XX\x{d800}
+Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{da00}
+Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{dc00}
+Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{de00}
+Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{dfff}
+Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
     XX\x{110000}
 Failed: error -28: UTF-32 error: code points greater than 0x10ffff are not defined at offset 2
     XX\x{d800}\x{1234}
 Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
+\= Expect no match
+    XX\x{d800}\=offset=3
+No match
+    
+/(?<=.)X/utf
+    XX\x{d800}\=offset=3
+Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
 
 /(*UTF16)\x{11234}/
 Failed: error 160 at offset 5: (*VERB) not recognized or malformed
@@ -780,8 +692,10 @@ Subject length lower bound = 3
  0: aa
     a\x{123}aa\=offset=3
  0: a
+\= Expect no match
     a\x{123}aa\=offset=4
 No match
+\= Expect bad offset error     
     a\x{123}aa\=offset=5
 Failed: error -33: bad offset value
     a\x{123}aa\=offset=6
@@ -846,16 +760,21 @@ Subject length lower bound = 1
 # Check bad offset 
 
 /a/utf
+\= Expect bad UTF-16 offset, or no match in 32-bit
     \x{10000}\=offset=1
 No match
     \x{10000}ab\=offset=1
  0: a
+\= Expect 16-bit match, 32-bit no match
     \x{10000}ab\=offset=2
 No match
+\= Expect no match     
     \x{10000}ab\=offset=3
 No match
+\= Expect no match in 16-bit, bad offset in 32-bit    
     \x{10000}ab\=offset=4
 Failed: error -33: bad offset value
+\= Expect bad offset     
     \x{10000}ab\=offset=5
 Failed: error -33: bad offset value
 
@@ -1115,10 +1034,6 @@ Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too
 /\o{4200000}/utf
 Failed: error 134 at offset 10: character code point value in \x{} or \o{} is too large
 
-/\C/utf
-    \x{110000}
-Failed: error -28: UTF-32 error: code points greater than 0x10ffff are not defined at offset 0
-
 /\x{100}*A/IB,utf
 ------------------------------------------------------------------
         Bra
@@ -1166,8 +1081,6 @@ Subject length lower bound = 1
  0: \x{100}
     \x{100}Z
  0: \x{100}
-    *** Failers 
-No match
 
 /[z-\x{100}]/IB,utf
 ------------------------------------------------------------------
@@ -1357,8 +1270,7 @@ Subject length lower bound = 1
  0: \x{105}
     \x{109}  
  0: \x{109}
-    ** Failers
-No match
+\= Expect no match
     \x{100}
 No match
     \x{10a} 
@@ -1402,8 +1314,7 @@ Subject length lower bound = 1
  0: \x{100}
     \x{101} 
  0: \x{101}
-    ** Failers
-No match
+\= Expect no match
     \x{102}
 No match
     Y
@@ -1446,4 +1357,8 @@ Starting code units: \xff
 Last code unit = 'B' (caseless)
 Subject length lower bound = 2
 
+/./utf
+    \x{110000}
+Failed: error -28: UTF-32 error: code points greater than 0x10ffff are not defined at offset 0
+
 # End of testinput12
diff --git a/testdata/testoutput14 b/testdata/testoutput14
deleted file mode 100644 (file)
index cdfd6f7..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-# These are:
-#
-# (1) Tests of the match-limiting features. The results are different for
-# interpretive or JIT matching, so this test should not be run with JIT. The
-# same tests are run using JIT in test 16.
-
-# (2) Other tests that must not be run with JIT.
-
-/(a+)*zz/I
-Capturing subpattern count = 1
-Starting code units: a z 
-Last code unit = 'z'
-Subject length lower bound = 2
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
-Minimum match limit = 8
-Minimum recursion limit = 6
- 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz
- 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-  aaaaaaaaaaaaaz\=find_limits
-Minimum match limit = 32768
-Minimum recursion limit = 29
-No match
-
-!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
-Capturing subpattern count = 1
-May match empty string
-Subject length lower bound = 0
-   /* this is a C style comment */\=find_limits
-Minimum match limit = 120
-Minimum recursion limit = 6
- 0: /* this is a C style comment */
- 1: /* this is a C style comment */
-
-/^(?>a)++/
-    aa\=find_limits
-Minimum match limit = 5
-Minimum recursion limit = 2
- 0: aa
-    aaaaaaaaa\=find_limits
-Minimum match limit = 12
-Minimum recursion limit = 2
- 0: aaaaaaaaa
-    
-/(a)(?1)++/
-    aa\=find_limits
-Minimum match limit = 7
-Minimum recursion limit = 4
- 0: aa
- 1: a
-    aaaaaaaaa\=find_limits
-Minimum match limit = 21
-Minimum recursion limit = 4
- 0: aaaaaaaaa
- 1: a
-
-/a(?:.)*?a/ims
-    abbbbbbbbbbbbbbbbbbbbba\=find_limits
-Minimum match limit = 65
-Minimum recursion limit = 2
- 0: abbbbbbbbbbbbbbbbbbbbba
-    
-/a(?:.(*THEN))*?a/ims
-    abbbbbbbbbbbbbbbbbbbbba\=find_limits
-Minimum match limit = 86
-Minimum recursion limit = 45
- 0: abbbbbbbbbbbbbbbbbbbbba
-
-/a(?:.(*THEN:ABC))*?a/ims
-    abbbbbbbbbbbbbbbbbbbbba\=find_limits
-Minimum match limit = 86
-Minimum recursion limit = 45
- 0: abbbbbbbbbbbbbbbbbbbbba
-
-/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
-     aabbccddee\=find_limits
-Minimum match limit = 7
-Minimum recursion limit = 2
- 0: aabbccddee
-
-/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
-     aabbccddee\=find_limits
-Minimum match limit = 17
-Minimum recursion limit = 16
- 0: aabbccddee
- 1: aa
- 2: bb
- 3: cc
- 4: dd
- 5: ee
-
-/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
-     aabbccddee\=find_limits
-Minimum match limit = 13
-Minimum recursion limit = 10
- 0: aabbccddee
- 1: aa
- 2: cc
- 3: ee
-
-/(*LIMIT_MATCH=12bc)abc/
-Failed: error 160 at offset 0: (*VERB) not recognized or malformed
-
-/(*LIMIT_MATCH=4294967290)abc/
-Failed: error 160 at offset 0: (*VERB) not recognized or malformed
-
-/(*LIMIT_RECURSION=4294967280)abc/I
-Capturing subpattern count = 0
-Recursion limit = 4294967280
-First code unit = 'a'
-Last code unit = 'c'
-Subject length lower bound = 3
-
-/(a+)*zz/
-    aaaaaaaaaaaaaz
-No match
-    aaaaaaaaaaaaaz\=match_limit=3000
-Failed: error -47: match limit exceeded
-
-/(a+)*zz/
-    aaaaaaaaaaaaaz\=recursion_limit=10
-Failed: error -53: recursion limit exceeded
-
-/(*LIMIT_MATCH=3000)(a+)*zz/I
-Capturing subpattern count = 1
-Match limit = 3000
-Starting code units: a z 
-Last code unit = 'z'
-Subject length lower bound = 2
-    aaaaaaaaaaaaaz
-Failed: error -47: match limit exceeded
-    aaaaaaaaaaaaaz\=match_limit=60000
-Failed: error -47: match limit exceeded
-
-/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
-Capturing subpattern count = 1
-Match limit = 3000
-Starting code units: a z 
-Last code unit = 'z'
-Subject length lower bound = 2
-    aaaaaaaaaaaaaz
-Failed: error -47: match limit exceeded
-
-/(*LIMIT_MATCH=60000)(a+)*zz/I
-Capturing subpattern count = 1
-Match limit = 60000
-Starting code units: a z 
-Last code unit = 'z'
-Subject length lower bound = 2
-    aaaaaaaaaaaaaz
-No match
-    aaaaaaaaaaaaaz\=match_limit=3000
-Failed: error -47: match limit exceeded
-
-/(*LIMIT_RECURSION=10)(a+)*zz/I
-Capturing subpattern count = 1
-Recursion limit = 10
-Starting code units: a z 
-Last code unit = 'z'
-Subject length lower bound = 2
-    aaaaaaaaaaaaaz
-Failed: error -53: recursion limit exceeded
-    aaaaaaaaaaaaaz\=recursion_limit=1000
-Failed: error -53: recursion limit exceeded
-
-/(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/I
-Capturing subpattern count = 1
-Recursion limit = 1000
-Starting code units: a z 
-Last code unit = 'z'
-Subject length lower bound = 2
-    aaaaaaaaaaaaaz
-No match
-
-/(*LIMIT_RECURSION=1000)(a+)*zz/I
-Capturing subpattern count = 1
-Recursion limit = 1000
-Starting code units: a z 
-Last code unit = 'z'
-Subject length lower bound = 2
-    aaaaaaaaaaaaaz
-No match
-    aaaaaaaaaaaaaz\=recursion_limit=10
-Failed: error -53: recursion limit exceeded
-    
-# These three have infinitely nested recursions. 
-    
-/((?2))((?1))/
-    abc
-Failed: error -52: nested recursion at the same subject position
-
-/((?(R2)a+|(?1)b))/
-    aaaabcde
-Failed: error -52: nested recursion at the same subject position
-
-/(?(R)a*(?1)|((?R))b)/
-    aaaabcde
-Failed: error -52: nested recursion at the same subject position
-    
-# The allusedtext modifier does not work with JIT, which does not maintain
-# the leftchar/rightchar data.
-
-/abc(?=xyz)/allusedtext
-    abcxyzpqr
- 0: abcxyz
-       >>>
-    abcxyzpqr\=aftertext
- 0: abcxyz
-       >>>
- 0+ xyzpqr
-    
-/(?<=pqr)abc(?=xyz)/allusedtext
-    xyzpqrabcxyzpqr
- 0: pqrabcxyz
-    <<<   >>>
-    xyzpqrabcxyzpqr\=aftertext
- 0: pqrabcxyz
-    <<<   >>>
- 0+ xyzpqr
-    
-/a\b/
-    a.\=allusedtext
- 0: a.
-     >
-    a\=allusedtext  
- 0: a
-
-/abc\Kxyz/
-    abcxyz\=allusedtext
- 0: abcxyz
-    <<<   
-
-/abc(?=xyz(*ACCEPT))/
-    abcxyz\=allusedtext
- 0: abcxyz
-       >>>
-
-/abc(?=abcde)(?=ab)/allusedtext
-    abcabcdefg
- 0: abcabcde
-       >>>>>
-
-# End of testinput14
diff --git a/testdata/testoutput14-16 b/testdata/testoutput14-16
new file mode 100644 (file)
index 0000000..05b7d48
--- /dev/null
@@ -0,0 +1,61 @@
+# These test special (mostly error) UTF features of DFA matching. They are a 
+# selection of the more comprehensive tests that are run for non-DFA matching.
+# The output is different for the different widths.
+
+#subject dfa
+
+/X/utf
+    XX\x{d800}
+Failed: error -24: UTF-16 error: missing low surrogate at end at offset 2
+    XX\x{d800}\=offset=3
+No match
+    XX\x{d800}\=no_utf_check
+ 0: X
+    XX\x{da00}
+Failed: error -24: UTF-16 error: missing low surrogate at end at offset 2
+    XX\x{da00}\=no_utf_check
+ 0: X
+    XX\x{dc00}
+Failed: error -26: UTF-16 error: isolated low surrogate at offset 2
+    XX\x{dc00}\=no_utf_check
+ 0: X
+    XX\x{de00}
+Failed: error -26: UTF-16 error: isolated low surrogate at offset 2
+    XX\x{de00}\=no_utf_check
+ 0: X
+    XX\x{dfff}
+Failed: error -26: UTF-16 error: isolated low surrogate at offset 2
+    XX\x{dfff}\=no_utf_check
+ 0: X
+    XX\x{110000}
+** Failed: character \x{110000} is greater than 0x10ffff and so cannot be converted to UTF-16
+    XX\x{d800}\x{1234}
+Failed: error -25: UTF-16 error: invalid low surrogate at offset 3
+          
+/badutf/utf
+    X\xdf
+No match
+    XX\xef
+No match
+    XXX\xef\x80
+No match
+    X\xf7
+No match
+    XX\xf7\x80
+No match
+    XXX\xf7\x80\x80
+No match
+
+/shortutf/utf
+    XX\xdf\=ph
+No match
+    XX\xef\=ph
+No match
+    XX\xef\x80\=ph
+No match
+    \xf7\=ph
+No match
+    \xf7\x80\=ph
+No match
+
+# End of testinput14
diff --git a/testdata/testoutput14-32 b/testdata/testoutput14-32
new file mode 100644 (file)
index 0000000..30d7fa6
--- /dev/null
@@ -0,0 +1,61 @@
+# These test special (mostly error) UTF features of DFA matching. They are a 
+# selection of the more comprehensive tests that are run for non-DFA matching.
+# The output is different for the different widths.
+
+#subject dfa
+
+/X/utf
+    XX\x{d800}
+Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{d800}\=offset=3
+No match
+    XX\x{d800}\=no_utf_check
+ 0: X
+    XX\x{da00}
+Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{da00}\=no_utf_check
+ 0: X
+    XX\x{dc00}
+Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{dc00}\=no_utf_check
+ 0: X
+    XX\x{de00}
+Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{de00}\=no_utf_check
+ 0: X
+    XX\x{dfff}
+Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{dfff}\=no_utf_check
+ 0: X
+    XX\x{110000}
+Failed: error -28: UTF-32 error: code points greater than 0x10ffff are not defined at offset 2
+    XX\x{d800}\x{1234}
+Failed: error -27: UTF-32 error: code points 0xd800-0xdfff are not defined at offset 2
+          
+/badutf/utf
+    X\xdf
+No match
+    XX\xef
+No match
+    XXX\xef\x80
+No match
+    X\xf7
+No match
+    XX\xf7\x80
+No match
+    XXX\xf7\x80\x80
+No match
+
+/shortutf/utf
+    XX\xdf\=ph
+No match
+    XX\xef\=ph
+No match
+    XX\xef\x80\=ph
+No match
+    \xf7\=ph
+No match
+    \xf7\x80\=ph
+No match
+
+# End of testinput14
diff --git a/testdata/testoutput14-8 b/testdata/testoutput14-8
new file mode 100644 (file)
index 0000000..1fb0dc1
--- /dev/null
@@ -0,0 +1,61 @@
+# These test special (mostly error) UTF features of DFA matching. They are a 
+# selection of the more comprehensive tests that are run for non-DFA matching.
+# The output is different for the different widths.
+
+#subject dfa
+
+/X/utf
+    XX\x{d800}
+Failed: error -16: UTF-8 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{d800}\=offset=3
+Error -36 (bad UTF-8 offset)
+    XX\x{d800}\=no_utf_check
+ 0: X
+    XX\x{da00}
+Failed: error -16: UTF-8 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{da00}\=no_utf_check
+ 0: X
+    XX\x{dc00}
+Failed: error -16: UTF-8 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{dc00}\=no_utf_check
+ 0: X
+    XX\x{de00}
+Failed: error -16: UTF-8 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{de00}\=no_utf_check
+ 0: X
+    XX\x{dfff}
+Failed: error -16: UTF-8 error: code points 0xd800-0xdfff are not defined at offset 2
+    XX\x{dfff}\=no_utf_check
+ 0: X
+    XX\x{110000}
+Failed: error -15: UTF-8 error: code points greater than 0x10ffff are not defined at offset 2
+    XX\x{d800}\x{1234}
+Failed: error -16: UTF-8 error: code points 0xd800-0xdfff are not defined at offset 2
+          
+/badutf/utf
+    X\xdf
+Failed: error -3: UTF-8 error: 1 byte missing at end at offset 1
+    XX\xef
+Failed: error -4: UTF-8 error: 2 bytes missing at end at offset 2
+    XXX\xef\x80
+Failed: error -3: UTF-8 error: 1 byte missing at end at offset 3
+    X\xf7
+Failed: error -5: UTF-8 error: 3 bytes missing at end at offset 1
+    XX\xf7\x80
+Failed: error -4: UTF-8 error: 2 bytes missing at end at offset 2
+    XXX\xf7\x80\x80
+Failed: error -3: UTF-8 error: 1 byte missing at end at offset 3
+
+/shortutf/utf
+    XX\xdf\=ph
+Failed: error -3: UTF-8 error: 1 byte missing at end at offset 2
+    XX\xef\=ph
+Failed: error -4: UTF-8 error: 2 bytes missing at end at offset 2
+    XX\xef\x80\=ph
+Failed: error -3: UTF-8 error: 1 byte missing at end at offset 2
+    \xf7\=ph
+Failed: error -5: UTF-8 error: 3 bytes missing at end at offset 0
+    \xf7\x80\=ph
+Failed: error -4: UTF-8 error: 2 bytes missing at end at offset 0
+
+# End of testinput14
index fb945fd46c659d3dc446a2ac839f7f1d30de1523..bb29a496e27ed9e616774a0879d828d3aaf65600 100644 (file)
-# This test is run only when JIT support is not available. It checks that an
-# attempt to use it has the expected behaviour. It also tests things that
-# are different without JIT.
+# These are:
+#
+# (1) Tests of the match-limiting features. The results are different for
+# interpretive or JIT matching, so this test should not be run with JIT. The
+# same tests are run using JIT in test 17.
 
-/abc/I,jit,jitverify
+# (2) Other tests that must not be run with JIT.
+
+/(a+)*zz/I
+Capturing subpattern count = 1
+Starting code units: a z 
+Last code unit = 'z'
+Subject length lower bound = 2
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
+Minimum match limit = 8
+Minimum recursion limit = 6
+ 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz
+ 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+  aaaaaaaaaaaaaz\=find_limits
+Minimum match limit = 32768
+Minimum recursion limit = 29
+No match
+
+!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
+Capturing subpattern count = 1
+May match empty string
+Subject length lower bound = 0
+   /* this is a C style comment */\=find_limits
+Minimum match limit = 120
+Minimum recursion limit = 6
+ 0: /* this is a C style comment */
+ 1: /* this is a C style comment */
+
+/^(?>a)++/
+    aa\=find_limits
+Minimum match limit = 5
+Minimum recursion limit = 2
+ 0: aa
+    aaaaaaaaa\=find_limits
+Minimum match limit = 12
+Minimum recursion limit = 2
+ 0: aaaaaaaaa
+    
+/(a)(?1)++/
+    aa\=find_limits
+Minimum match limit = 7
+Minimum recursion limit = 4
+ 0: aa
+ 1: a
+    aaaaaaaaa\=find_limits
+Minimum match limit = 21
+Minimum recursion limit = 4
+ 0: aaaaaaaaa
+ 1: a
+
+/a(?:.)*?a/ims
+    abbbbbbbbbbbbbbbbbbbbba\=find_limits
+Minimum match limit = 65
+Minimum recursion limit = 2
+ 0: abbbbbbbbbbbbbbbbbbbbba
+    
+/a(?:.(*THEN))*?a/ims
+    abbbbbbbbbbbbbbbbbbbbba\=find_limits
+Minimum match limit = 86
+Minimum recursion limit = 45
+ 0: abbbbbbbbbbbbbbbbbbbbba
+
+/a(?:.(*THEN:ABC))*?a/ims
+    abbbbbbbbbbbbbbbbbbbbba\=find_limits
+Minimum match limit = 86
+Minimum recursion limit = 45
+ 0: abbbbbbbbbbbbbbbbbbbbba
+
+/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
+     aabbccddee\=find_limits
+Minimum match limit = 7
+Minimum recursion limit = 2
+ 0: aabbccddee
+
+/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
+     aabbccddee\=find_limits
+Minimum match limit = 17
+Minimum recursion limit = 16
+ 0: aabbccddee
+ 1: aa
+ 2: bb
+ 3: cc
+ 4: dd
+ 5: ee
+
+/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
+     aabbccddee\=find_limits
+Minimum match limit = 13
+Minimum recursion limit = 10
+ 0: aabbccddee
+ 1: aa
+ 2: cc
+ 3: ee
+
+/(*LIMIT_MATCH=12bc)abc/
+Failed: error 160 at offset 17: (*VERB) not recognized or malformed
+
+/(*LIMIT_MATCH=4294967290)abc/
+Failed: error 160 at offset 24: (*VERB) not recognized or malformed
+
+/(*LIMIT_RECURSION=4294967280)abc/I
 Capturing subpattern count = 0
+Recursion limit = 4294967280
 First code unit = 'a'
 Last code unit = 'c'
 Subject length lower bound = 3
-JIT support is not available in this version of PCRE2
 
-/a*/I
+/(a+)*zz/
+    aaaaaaaaaaaaaz
+No match
+    aaaaaaaaaaaaaz\=match_limit=3000
+Failed: error -47: match limit exceeded
+
+/(a+)*zz/
+    aaaaaaaaaaaaaz\=recursion_limit=10
+Failed: error -53: recursion limit exceeded
+
+/(*LIMIT_MATCH=3000)(a+)*zz/I
+Capturing subpattern count = 1
+Match limit = 3000
+Starting code units: a z 
+Last code unit = 'z'
+Subject length lower bound = 2
+    aaaaaaaaaaaaaz
+Failed: error -47: match limit exceeded
+    aaaaaaaaaaaaaz\=match_limit=60000
+Failed: error -47: match limit exceeded
+
+/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
+Capturing subpattern count = 1
+Match limit = 3000
+Starting code units: a z 
+Last code unit = 'z'
+Subject length lower bound = 2
+    aaaaaaaaaaaaaz
+Failed: error -47: match limit exceeded
+
+/(*LIMIT_MATCH=60000)(a+)*zz/I
+Capturing subpattern count = 1
+Match limit = 60000
+Starting code units: a z 
+Last code unit = 'z'
+Subject length lower bound = 2
+    aaaaaaaaaaaaaz
+No match
+    aaaaaaaaaaaaaz\=match_limit=3000
+Failed: error -47: match limit exceeded
+
+/(*LIMIT_RECURSION=10)(a+)*zz/I
+Capturing subpattern count = 1
+Recursion limit = 10
+Starting code units: a z 
+Last code unit = 'z'
+Subject length lower bound = 2
+    aaaaaaaaaaaaaz
+Failed: error -53: recursion limit exceeded
+    aaaaaaaaaaaaaz\=recursion_limit=1000
+Failed: error -53: recursion limit exceeded
+
+/(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/I
+Capturing subpattern count = 1
+Recursion limit = 1000
+Starting code units: a z 
+Last code unit = 'z'
+Subject length lower bound = 2
+    aaaaaaaaaaaaaz
+No match
+
+/(*LIMIT_RECURSION=1000)(a+)*zz/I
+Capturing subpattern count = 1
+Recursion limit = 1000
+Starting code units: a z 
+Last code unit = 'z'
+Subject length lower bound = 2
+    aaaaaaaaaaaaaz
+No match
+    aaaaaaaaaaaaaz\=recursion_limit=10
+Failed: error -53: recursion limit exceeded
+    
+# These three have infinitely nested recursions. 
+    
+/((?2))((?1))/
+    abc
+Failed: error -52: nested recursion at the same subject position
+
+/((?(R2)a+|(?1)b))/
+    aaaabcde
+Failed: error -52: nested recursion at the same subject position
+
+/(?(R)a*(?1)|((?R))b)/
+    aaaabcde
+Failed: error -52: nested recursion at the same subject position
+    
+# The allusedtext modifier does not work with JIT, which does not maintain
+# the leftchar/rightchar data.
+
+/abc(?=xyz)/allusedtext
+    abcxyzpqr
+ 0: abcxyz
+       >>>
+    abcxyzpqr\=aftertext
+ 0: abcxyz
+       >>>
+ 0+ xyzpqr
+    
+/(?<=pqr)abc(?=xyz)/allusedtext
+    xyzpqrabcxyzpqr
+ 0: pqrabcxyz
+    <<<   >>>
+    xyzpqrabcxyzpqr\=aftertext
+ 0: pqrabcxyz
+    <<<   >>>
+ 0+ xyzpqr
+    
+/a\b/
+    a.\=allusedtext
+ 0: a.
+     >
+    a\=allusedtext  
+ 0: a
+
+/abc\Kxyz/
+    abcxyz\=allusedtext
+ 0: abcxyz
+    <<<   
+
+/abc(?=xyz(*ACCEPT))/
+    abcxyz\=allusedtext
+ 0: abcxyz
+       >>>
+
+/abc(?=abcde)(?=ab)/allusedtext
+    abcabcdefg
+ 0: abcabcde
+       >>>>>
+    
+# These tests provoke recursion loops, which give a different error message
+# when JIT is used.
+
+/(?R)/I
 Capturing subpattern count = 0
 May match empty string
 Subject length lower bound = 0
+    abcd
+Failed: error -52: nested recursion at the same subject position
+
+/(a|(?R))/I
+Capturing subpattern count = 1
+May match empty string
+Subject length lower bound = 0
+    abcd
+ 0: a
+ 1: a
+    defg 
+Failed: error -52: nested recursion at the same subject position
+
+/(ab|(bc|(de|(?R))))/I
+Capturing subpattern count = 3
+May match empty string
+Subject length lower bound = 0
+    abcd
+ 0: ab
+ 1: ab
+    fghi 
+Failed: error -52: nested recursion at the same subject position
+
+/(ab|(bc|(de|(?1))))/I
+Capturing subpattern count = 3
+May match empty string
+Subject length lower bound = 0
+    abcd
+ 0: ab
+ 1: ab
+    fghi 
+Failed: error -52: nested recursion at the same subject position
+
+/x(ab|(bc|(de|(?1)x)x)x)/I
+Capturing subpattern count = 3
+First code unit = 'x'
+Subject length lower bound = 3
+    xab123
+ 0: xab
+ 1: ab
+    xfghi 
+Failed: error -52: nested recursion at the same subject position
+
+/(?!\w)(?R)/
+    abcd
+Failed: error -52: nested recursion at the same subject position
+    =abc 
+Failed: error -52: nested recursion at the same subject position
+
+/(?=\w)(?R)/
+    =abc 
+Failed: error -52: nested recursion at the same subject position
+    abcd
+Failed: error -52: nested recursion at the same subject position
+
+/(?<!\w)(?R)/
+    abcd
+Failed: error -52: nested recursion at the same subject position
+
+/(?<=\w)(?R)/
+    abcd
+Failed: error -52: nested recursion at the same subject position
+
+/(a+|(?R)b)/
+    aaa
+ 0: aaa
+ 1: aaa
+    bbb 
+Failed: error -52: nested recursion at the same subject position
+
+/[^\xff]((?1))/BI
+------------------------------------------------------------------
+        Bra
+        [^\x{ff}]
+        CBra 1
+        Recurse
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Subject length lower bound = 1
+    abcd
+Failed: error -52: nested recursion at the same subject position
+    
+# These tests don't behave the same with JIT 
+
+/\w+(?C1)/BI,no_auto_possess
+------------------------------------------------------------------
+        Bra
+        \w+
+        Callout 1 8 0
+        Ket
+        End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: no_auto_possess
+Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 
+  Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z 
+Subject length lower bound = 1
+    abc\=callout_fail=1
+--->abc
+  1 ^  ^    
+  1 ^ ^     
+  1 ^^      
+  1  ^ ^    
+  1  ^^     
+  1   ^^    
+No match
+
+/(*NO_AUTO_POSSESS)\w+(?C1)/BI
+------------------------------------------------------------------
+        Bra
+        \w+
+        Callout 1 26 0
+        Ket
+        End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Compile options: <none>
+Overall options: no_auto_possess
+Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 
+  Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z 
+Subject length lower bound = 1
+    abc\=callout_fail=1
+--->abc
+  1 ^  ^    
+  1 ^ ^     
+  1 ^^      
+  1  ^ ^    
+  1  ^^     
+  1   ^^    
+No match
 
 # End of testinput15
index ae4fb41ead1a2fd095f59933e84a30aaa7c5db3e..616567b5fb9c8f7fe61491ee9ccf92a546b4217c 100644 (file)
-# This test is run only when JIT support is available. It checks JIT complete
-# and partial modes, and things that are different with JIT.
+# This test is run only when JIT support is not available. It checks that an
+# attempt to use it has the expected behaviour. It also tests things that
+# are different without JIT.
 
-#pattern jitverify
-
-# JIT does not support this pattern (callout at start of condition).
-
-/(?(?C1)(?=a)a)/I
-Capturing subpattern count = 0
-May match empty string
-Subject length lower bound = 0
-JIT compilation was not successful
-
-# The following pattern cannot be compiled by JIT.
-
-/b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*/I
-Capturing subpattern count = 0
-May match empty string
-Subject length lower bound = 0
-JIT compilation was not successful
-
-# Check that an infinite recursion loop is caught.
-
-/(?(R)a*(?1)|((?R))b)/
-    aaaabcde
-Failed: error -46: JIT stack limit reached
-
-/abcd/I
+/abc/I,jit,jitverify
 Capturing subpattern count = 0
 First code unit = 'a'
-Last code unit = 'd'
-Subject length lower bound = 4
-JIT compilation was successful
-    abcd
- 0: abcd (JIT)
-    xyz
-No match (JIT)
-
-/(*NO_JIT)abcd/I
-Capturing subpattern count = 0
-First code unit = 'a'
-Last code unit = 'd'
-Subject length lower bound = 4
-JIT compilation was not successful
-    abcd
- 0: abcd
-    xyz
-No match
-
-/abcd/
-    abcd
- 0: abcd (JIT)
-    ab\=ps
-Partial match: ab (JIT)
-    ab\=ph
-Partial match: ab (JIT)
-    xyz
-No match (JIT)
-
-/abcd/jitfast
-    abcd
- 0: abcd (JIT)
-    ab\=ps
-Partial match: ab (JIT)
-    ab\=ph
-Partial match: ab (JIT)
-    xyz
-No match (JIT)
-
-/abcd/jit=1
-    abcd
- 0: abcd (JIT)
-    ab\=ps
-Partial match: ab
-    ab\=ph
-Partial match: ab
-    xyz
-No match (JIT)
-    xyz\=ps
-No match
-
-/abcd/jit=1,jitfast
-    abcd
- 0: abcd (JIT)
-    ab\=ps
-Failed: error -45: bad JIT option
-    ab\=ph
-Failed: error -45: bad JIT option
-    xyz
-No match (JIT)
-    xyz\=ps
-Failed: error -45: bad JIT option
-
-/abcd/jit=2
-    abcd
- 0: abcd
-    ab\=ps
-Partial match: ab (JIT)
-    ab\=ph
-Partial match: ab
-    xyz
-No match
-
-/abcd/jit=2,jitfast
-    abcd
-Failed: error -45: bad JIT option
-    ab\=ps
-Partial match: ab (JIT)
-    ab\=ph
-Failed: error -45: bad JIT option
-    xyz
-Failed: error -45: bad JIT option
-
-/abcd/jit=3
-    abcd
- 0: abcd (JIT)
-    ab\=ps
-Partial match: ab (JIT)
-    ab\=ph
-Partial match: ab
-    xyz
-No match (JIT)
-
-/abcd/jit=4
-    abcd
- 0: abcd
-    ab\=ps
-Partial match: ab
-    ab\=ph
-Partial match: ab (JIT)
-    xyz
-No match
-
-/abcd/jit=5
-    abcd
- 0: abcd (JIT)
-    ab\=ps
-Partial match: ab
-    ab\=ph
-Partial match: ab (JIT)
-    xyz
-No match (JIT)
-
-/abcd/jit=6
-    abcd
- 0: abcd
-    ab\=ps
-Partial match: ab (JIT)
-    ab\=ph
-Partial match: ab (JIT)
-    xyz
-No match
-
-/abcd/jit=7
-    abcd
- 0: abcd (JIT)
-    ab\=ps
-Partial match: ab (JIT)
-    ab\=ph
-Partial match: ab (JIT)
-    xyz
-No match (JIT)
+Last code unit = 'c'
+Subject length lower bound = 3
+JIT support is not available in this version of PCRE2
 
-/abcd/I,jit=2
+/a*/I
 Capturing subpattern count = 0
-First code unit = 'a'
-Last code unit = 'd'
-Subject length lower bound = 4
-JIT compilation was successful
-
-/(*NO_START_OPT)a(*:m)b/mark
-    a
-No match, mark = m (JIT)
-
-/^12345678abcd/m
-    12345678abcd
- 0: 12345678abcd (JIT)
-    
-# Limits tests that give different output with JIT. 
-
-/(a+)*zz/I
-Capturing subpattern count = 1
-Starting code units: a z 
-Last code unit = 'z'
-Subject length lower bound = 2
-JIT compilation was successful
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
-Minimum match limit = 3
- 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz (JIT)
- 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-  aaaaaaaaaaaaaz\=find_limits
-Minimum match limit = 16384
-No match (JIT)
-
-!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
-Capturing subpattern count = 1
 May match empty string
 Subject length lower bound = 0
-JIT compilation was successful
-   /* this is a C style comment */\=find_limits
-Minimum match limit = 2
- 0: /* this is a C style comment */ (JIT)
- 1: /* this is a C style comment */
-
-/^(?>a)++/
-    aa\=find_limits
-Minimum match limit = 2
- 0: aa (JIT)
-    aaaaaaaaa\=find_limits
-Minimum match limit = 2
- 0: aaaaaaaaa (JIT)
-    
-/(a)(?1)++/
-    aa\=find_limits
-Minimum match limit = 2
- 0: aa (JIT)
- 1: a
-    aaaaaaaaa\=find_limits
-Minimum match limit = 2
- 0: aaaaaaaaa (JIT)
- 1: a
-
-/a(?:.)*?a/ims
-    abbbbbbbbbbbbbbbbbbbbba\=find_limits
-Minimum match limit = 1
- 0: abbbbbbbbbbbbbbbbbbbbba (JIT)
-    
-/a(?:.(*THEN))*?a/ims
-    abbbbbbbbbbbbbbbbbbbbba\=find_limits
-Minimum match limit = 1
- 0: abbbbbbbbbbbbbbbbbbbbba (JIT)
-
-/a(?:.(*THEN:ABC))*?a/ims
-    abbbbbbbbbbbbbbbbbbbbba\=find_limits
-Minimum match limit = 1
- 0: abbbbbbbbbbbbbbbbbbbbba (JIT)
-
-/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
-     aabbccddee\=find_limits
-Minimum match limit = 6
- 0: aabbccddee (JIT)
-
-/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
-     aabbccddee\=find_limits
-Minimum match limit = 6
- 0: aabbccddee (JIT)
- 1: aa
- 2: bb
- 3: cc
- 4: dd
- 5: ee
-
-/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
-     aabbccddee\=find_limits
-Minimum match limit = 6
- 0: aabbccddee (JIT)
- 1: aa
- 2: cc
- 3: ee
-
-/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/jitfast
-     aabbccddee\=find_limits
-Minimum match limit = 6
- 0: aabbccddee (JIT)
- 1: aa
- 2: cc
- 3: ee
-     aabbccddee\=jitstack=1
- 0: aabbccddee (JIT)
- 1: aa
- 2: cc
- 3: ee
-
-/(a+)*zz/
-    aaaaaaaaaaaaaz
-No match (JIT)
-    aaaaaaaaaaaaaz\=match_limit=3000
-Failed: error -47: match limit exceeded
-
-/(*LIMIT_MATCH=3000)(a+)*zz/I
-Capturing subpattern count = 1
-Match limit = 3000
-Starting code units: a z 
-Last code unit = 'z'
-Subject length lower bound = 2
-JIT compilation was successful
-    aaaaaaaaaaaaaz
-Failed: error -47: match limit exceeded
-    aaaaaaaaaaaaaz\=match_limit=60000
-Failed: error -47: match limit exceeded
-
-/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
-Capturing subpattern count = 1
-Match limit = 3000
-Starting code units: a z 
-Last code unit = 'z'
-Subject length lower bound = 2
-JIT compilation was successful
-    aaaaaaaaaaaaaz
-Failed: error -47: match limit exceeded
-
-/(*LIMIT_MATCH=60000)(a+)*zz/I
-Capturing subpattern count = 1
-Match limit = 60000
-Starting code units: a z 
-Last code unit = 'z'
-Subject length lower bound = 2
-JIT compilation was successful
-    aaaaaaaaaaaaaz
-No match (JIT)
-    aaaaaaaaaaaaaz\=match_limit=3000
-Failed: error -47: match limit exceeded
-
-# These three have infinitely nested recursions. 
-    
-/((?2))((?1))/
-    abc
-Failed: error -46: JIT stack limit reached
-
-/((?(R2)a+|(?1)b))/
-    aaaabcde
-Failed: error -46: JIT stack limit reached
-
-/(?(R)a*(?1)|((?R))b)/
-    aaaabcde
-Failed: error -46: JIT stack limit reached
-    
-# Invalid options disable JIT when called via pcre2_match(), causing the
-# match to happen via the interpreter, but for fast JIT invalid options are
-# ignored, so an unanchored match happens.
-
-/abcd/
-    abcd\=anchored
- 0: abcd
-    fail abcd\=anchored 
-No match
-    
-/abcd/jitfast
-    abcd\=anchored 
- 0: abcd (JIT)
-    succeed abcd\=anchored 
- 0: abcd (JIT)
-    
-# Push/pop does not lose the JIT information, though jitverify applies only to
-# compilation, but serializing (save/load) discards JIT data completely.
-
-/^abc\Kdef/info,push
-** Applies only to compile when pattern is stacked with 'push': jitverify
-Capturing subpattern count = 0
-Compile options: <none>
-Overall options: anchored
-Subject length lower bound = 6
-JIT compilation was successful
-#pop jitverify
-    abcdef
- 0: def (JIT)
-
-/^abc\Kdef/info,push
-** Applies only to compile when pattern is stacked with 'push': jitverify
-Capturing subpattern count = 0
-Compile options: <none>
-Overall options: anchored
-Subject length lower bound = 6
-JIT compilation was successful
-#save testsaved1
-#load testsaved1
-#pop jitverify
-    abcdef
- 0: def
-    
-#load testsaved1
-#pop jit,jitverify
-    abcdef
- 0: def (JIT)
-    
-# Test pattern compilation
-
-/(?:a|b|c|d|e)(?R)/jit=1
-
-/(?:a|b|c|d|e)(?R)(?R)/jit=1
-
-/(a(?:a|b|c|d|e)b){8,16}/jit=1
 
 # End of testinput16
index f46b7e7334be13c79747e8cfcc933f23dd7fdbaf..0def4387b222a2691fceaa97477cd978fa3b63b9 100644 (file)
-# This set of tests is run only with the 8-bit library. It tests the POSIX
-# interface, which is supported only with the 8-bit library. This test should
-# not be run with JIT (which is not available for the POSIX interface).
+# This test is run only when JIT support is available. It checks JIT complete
+# and partial modes, and things that are different with JIT.
+
+#pattern jitverify
+
+# JIT does not support this pattern (callout at start of condition).
+
+/(?(?C1)(?=a)a)/I
+Capturing subpattern count = 0
+May match empty string
+Subject length lower bound = 0
+JIT compilation was not successful (no more memory)
+
+# The following pattern cannot be compiled by JIT.
+
+/b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*b*/I
+Capturing subpattern count = 0
+May match empty string
+Subject length lower bound = 0
+JIT compilation was not successful (no more memory)
+
+# Check that an infinite recursion loop is caught.
+
+/(?(R)a*(?1)|((?R))b)/
+    aaaabcde
+Failed: error -46: JIT stack limit reached
+
+/abcd/I
+Capturing subpattern count = 0
+First code unit = 'a'
+Last code unit = 'd'
+Subject length lower bound = 4
+JIT compilation was successful
+    abcd
+ 0: abcd (JIT)
+\= Expect no match
+    xyz
+No match (JIT)
+
+/(*NO_JIT)abcd/I
+Capturing subpattern count = 0
+First code unit = 'a'
+Last code unit = 'd'
+Subject length lower bound = 4
+JIT compilation was not successful
+    abcd
+ 0: abcd
+\= Expect no match
+    xyz
+No match
+
+/abcd/
+    abcd
+ 0: abcd (JIT)
+    ab\=ps
+Partial match: ab (JIT)
+    ab\=ph
+Partial match: ab (JIT)
+\= Expect no match
+    xyz
+No match (JIT)
+
+/abcd/jitfast
+    abcd
+ 0: abcd (JIT)
+    ab\=ps
+Partial match: ab (JIT)
+    ab\=ph
+Partial match: ab (JIT)
+\= Expect no match
+    xyz
+No match (JIT)
+
+/abcd/jit=1
+    abcd
+ 0: abcd (JIT)
+    ab\=ps
+Partial match: ab
+    ab\=ph
+Partial match: ab
+\= Expect no match
+    xyz
+No match (JIT)
+    xyz\=ps
+No match
+
+/abcd/jit=1,jitfast
+    abcd
+ 0: abcd (JIT)
+    ab\=ps
+Failed: error -45: bad JIT option
+    ab\=ph
+Failed: error -45: bad JIT option
+    xyz\=ps
+Failed: error -45: bad JIT option
+\= Expect no match
+    xyz
+No match (JIT)
+
+/abcd/jit=2
+    abcd
+ 0: abcd
+    ab\=ps
+Partial match: ab (JIT)
+    ab\=ph
+Partial match: ab
+\= Expect no match
+    xyz
+No match
+
+/abcd/jit=2,jitfast
+    abcd
+Failed: error -45: bad JIT option
+    ab\=ps
+Partial match: ab (JIT)
+    ab\=ph
+Failed: error -45: bad JIT option
+    xyz
+Failed: error -45: bad JIT option
+
+/abcd/jit=3
+    abcd
+ 0: abcd (JIT)
+    ab\=ps
+Partial match: ab (JIT)
+    ab\=ph
+Partial match: ab
+\= Expect no match
+    xyz
+No match (JIT)
+
+/abcd/jit=4
+    abcd
+ 0: abcd
+    ab\=ps
+Partial match: ab
+    ab\=ph
+Partial match: ab (JIT)
+\= Expect no match
+    xyz
+No match
+
+/abcd/jit=5
+    abcd
+ 0: abcd (JIT)
+    ab\=ps
+Partial match: ab
+    ab\=ph
+Partial match: ab (JIT)
+\= Expect no match
+    xyz
+No match (JIT)
+
+/abcd/jit=6
+    abcd
+ 0: abcd
+    ab\=ps
+Partial match: ab (JIT)
+    ab\=ph
+Partial match: ab (JIT)
+\= Expect no match
+    xyz
+No match
+
+/abcd/jit=7
+    abcd
+ 0: abcd (JIT)
+    ab\=ps
+Partial match: ab (JIT)
+    ab\=ph
+Partial match: ab (JIT)
+\= Expect no match
+    xyz
+No match (JIT)
+
+/abcd/I,jit=2
+Capturing subpattern count = 0
+First code unit = 'a'
+Last code unit = 'd'
+Subject length lower bound = 4
+JIT compilation was successful
+
+/(*NO_START_OPT)a(*:m)b/mark
+\= Expect no match
+    a
+No match, mark = m (JIT)
+
+/^12345678abcd/m
+    12345678abcd
+ 0: 12345678abcd (JIT)
+    
+# Limits tests that give different output with JIT. 
+
+/(a+)*zz/I
+Capturing subpattern count = 1
+Starting code units: a z 
+Last code unit = 'z'
+Subject length lower bound = 2
+JIT compilation was successful
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
+Minimum match limit = 2
+ 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz (JIT)
+ 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+  aaaaaaaaaaaaaz\=find_limits
+Minimum match limit = 16383
+No match (JIT)
+
+!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
+Capturing subpattern count = 1
+May match empty string
+Subject length lower bound = 0
+JIT compilation was successful
+   /* this is a C style comment */\=find_limits
+Minimum match limit = 29
+ 0: /* this is a C style comment */ (JIT)
+ 1: /* this is a C style comment */
+
+/^(?>a)++/
+    aa\=find_limits
+Minimum match limit = 1
+ 0: aa (JIT)
+    aaaaaaaaa\=find_limits
+Minimum match limit = 1
+ 0: aaaaaaaaa (JIT)
+    
+/(a)(?1)++/
+    aa\=find_limits
+Minimum match limit = 1
+ 0: aa (JIT)
+ 1: a
+    aaaaaaaaa\=find_limits
+Minimum match limit = 1
+ 0: aaaaaaaaa (JIT)
+ 1: a
+
+/a(?:.)*?a/ims
+    abbbbbbbbbbbbbbbbbbbbba\=find_limits
+Minimum match limit = 22
+ 0: abbbbbbbbbbbbbbbbbbbbba (JIT)
     
-#forbid_utf
-#pattern posix
+/a(?:.(*THEN))*?a/ims
+    abbbbbbbbbbbbbbbbbbbbba\=find_limits
+Minimum match limit = 22
+ 0: abbbbbbbbbbbbbbbbbbbbba (JIT)
+
+/a(?:.(*THEN:ABC))*?a/ims
+    abbbbbbbbbbbbbbbbbbbbba\=find_limits
+Minimum match limit = 22
+ 0: abbbbbbbbbbbbbbbbbbbbba (JIT)
+
+/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
+     aabbccddee\=find_limits
+Minimum match limit = 5
+ 0: aabbccddee (JIT)
+
+/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
+     aabbccddee\=find_limits
+Minimum match limit = 5
+ 0: aabbccddee (JIT)
+ 1: aa
+ 2: bb
+ 3: cc
+ 4: dd
+ 5: ee
+
+/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
+     aabbccddee\=find_limits
+Minimum match limit = 5
+ 0: aabbccddee (JIT)
+ 1: aa
+ 2: cc
+ 3: ee
 
-# Test invalid options
+/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/jitfast
+     aabbccddee\=find_limits
+Minimum match limit = 5
+ 0: aabbccddee (JIT)
+ 1: aa
+ 2: cc
+ 3: ee
+     aabbccddee\=jitstack=1
+ 0: aabbccddee (JIT)
+ 1: aa
+ 2: cc
+ 3: ee
 
-/abc/auto_callout
-** Ignored with POSIX interface: auto_callout
+/(a+)*zz/
+\= Expect no match
+    aaaaaaaaaaaaaz
+No match (JIT)
+\= Expect limit exceeded
+    aaaaaaaaaaaaaz\=match_limit=3000
+Failed: error -47: match limit exceeded
 
-/abc/
-   abc\=find_limits
-** Ignored with POSIX interface: find_limits
- 0: abc
+/(*LIMIT_MATCH=3000)(a+)*zz/I
+Capturing subpattern count = 1
+Match limit = 3000
+Starting code units: a z 
+Last code unit = 'z'
+Subject length lower bound = 2
+JIT compilation was successful
+    aaaaaaaaaaaaaz
+Failed: error -47: match limit exceeded
+    aaaaaaaaaaaaaz\=match_limit=60000
+Failed: error -47: match limit exceeded
 
-/abc/
-  abc\=partial_hard
-** Ignored with POSIX interface: partial_hard
- 0: abc
+/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
+Capturing subpattern count = 1
+Match limit = 3000
+Starting code units: a z 
+Last code unit = 'z'
+Subject length lower bound = 2
+JIT compilation was successful
+    aaaaaaaaaaaaaz
+Failed: error -47: match limit exceeded
 
-# Real tests
+/(*LIMIT_MATCH=60000)(a+)*zz/I
+Capturing subpattern count = 1
+Match limit = 60000
+Starting code units: a z 
+Last code unit = 'z'
+Subject length lower bound = 2
+JIT compilation was successful
+\= Expect no match
+    aaaaaaaaaaaaaz
+No match (JIT)
+\= Expect limit exceeded
+    aaaaaaaaaaaaaz\=match_limit=3000
+Failed: error -47: match limit exceeded
 
-/abc/
+# These three have infinitely nested recursions. 
+    
+/((?2))((?1))/
     abc
- 0: abc
-    *** Failers
-No match: POSIX code 17: match failed
+Failed: error -46: JIT stack limit reached
+
+/((?(R2)a+|(?1)b))/
+    aaaabcde
+Failed: error -46: JIT stack limit reached
 
-/^abc|def/
+/(?(R)a*(?1)|((?R))b)/
+    aaaabcde
+Failed: error -46: JIT stack limit reached
+    
+# Invalid options disable JIT when called via pcre2_match(), causing the
+# match to happen via the interpreter, but for fast JIT invalid options are
+# ignored, so an unanchored match happens.
+
+/abcd/
+    abcd\=anchored
+ 0: abcd
+\= Expect no match
+    fail abcd\=anchored 
+No match
+    
+/abcd/jitfast
+    abcd\=anchored 
+ 0: abcd (JIT)
+    succeed abcd\=anchored 
+ 0: abcd (JIT)
+    
+# Push/pop does not lose the JIT information, though jitverify applies only to
+# compilation, but serializing (save/load) discards JIT data completely.
+
+/^abc\Kdef/info,push
+** Applies only to compile when pattern is stacked with 'push': jitverify
+Capturing subpattern count = 0
+Compile options: <none>
+Overall options: anchored
+Subject length lower bound = 6
+JIT compilation was successful
+#pop jitverify
     abcdef
- 0: abc
-    abcdef\=notbol
- 0: def
+ 0: def (JIT)
 
-/.*((abc)$|(def))/
-    defabc
- 0: defabc
- 1: abc
- 2: abc
-    defabc\=noteol
+/^abc\Kdef/info,push
+** Applies only to compile when pattern is stacked with 'push': jitverify
+Capturing subpattern count = 0
+Compile options: <none>
+Overall options: anchored
+Subject length lower bound = 6
+JIT compilation was successful
+#save testsaved1
+#load testsaved1
+#pop jitverify
+    abcdef
  0: def
- 1: def
- 3: def
-
-/the quick brown fox/
-    the quick brown fox
- 0: the quick brown fox
-    *** Failers
-No match: POSIX code 17: match failed
-    The Quick Brown Fox
-No match: POSIX code 17: match failed
-
-/the quick brown fox/i
-    the quick brown fox
- 0: the quick brown fox
-    The Quick Brown Fox
- 0: The Quick Brown Fox
-
-/abc.def/
-    *** Failers
-No match: POSIX code 17: match failed
-    abc\ndef
-No match: POSIX code 17: match failed
-
-/abc$/
-    abc
- 0: abc
-    abc\n
- 0: abc
+    
+#load testsaved1
+#pop jit,jitverify
+    abcdef
+ 0: def (JIT)
+    
+# Test pattern compilation
 
-/(abc)\2/
-Failed: POSIX code 15: bad back reference at offset 7     
+/(?:a|b|c|d|e)(?R)/jit=1
 
-/(abc\1)/
-    abc
-No match: POSIX code 17: match failed
-
-/a*(b+)(z)(z)/
-    aaaabbbbzzzz
- 0: aaaabbbbzz
- 1: bbbb
- 2: z
- 3: z
-    aaaabbbbzzzz\=ovector=0
-Matched without capture
-    aaaabbbbzzzz\=ovector=1
- 0: aaaabbbbzz
-    aaaabbbbzzzz\=ovector=2
- 0: aaaabbbbzz
- 1: bbbb
-
-/ab.cd/
-    ab-cd
- 0: ab-cd
-    ab=cd
- 0: ab=cd
-    ** Failers
-No match: POSIX code 17: match failed
-    ab\ncd
-No match: POSIX code 17: match failed
-
-/ab.cd/s
-    ab-cd
- 0: ab-cd
-    ab=cd
- 0: ab=cd
-    ab\ncd
- 0: ab\x0acd
-
-/a(b)c/no_auto_capture
-    abc
-Matched with REG_NOSUB
+/(?:a|b|c|d|e)(?R)(?R)/jit=1
 
-/a(?P<name>b)c/no_auto_capture
-    abc
-Matched with REG_NOSUB
+/(a(?:a|b|c|d|e)b){8,16}/jit=1
 
-/a?|b?/
-    abc
- 0: a
-    ** Failers
- 0: 
-    ddd\=notempty
-No match: POSIX code 17: match failed
-
-/\w+A/
-   CDAAAAB
- 0: CDAAAA
-
-/\w+A/ungreedy
-   CDAAAAB
- 0: CDA
-   
-/\Biss\B/I,aftertext
-** Ignored with POSIX interface: info
-    Mississippi
- 0: iss
- 0+ issippi
-
-/abc/\
-Failed: POSIX code 9: bad escape sequence at offset 4     
-
-"(?(?C)"
-Failed: POSIX code 3: pattern error at offset 2     
-
-# End of testdata/testinput16  
+/(?:|a|){100}x/jit=1
+
+# These tests provoke recursion loops, which give a different error message
+# when JIT is used.
+
+/(?R)/I
+Capturing subpattern count = 0
+May match empty string
+Subject length lower bound = 0
+JIT compilation was successful
+    abcd
+Failed: error -46: JIT stack limit reached
+
+/(a|(?R))/I
+Capturing subpattern count = 1
+May match empty string
+Subject length lower bound = 0
+JIT compilation was successful
+    abcd
+ 0: a (JIT)
+ 1: a
+    defg 
+Failed: error -46: JIT stack limit reached
+
+/(ab|(bc|(de|(?R))))/I
+Capturing subpattern count = 3
+May match empty string
+Subject length lower bound = 0
+JIT compilation was successful
+    abcd
+ 0: ab (JIT)
+ 1: ab
+    fghi 
+Failed: error -46: JIT stack limit reached
+
+/(ab|(bc|(de|(?1))))/I
+Capturing subpattern count = 3
+May match empty string
+Subject length lower bound = 0
+JIT compilation was successful
+    abcd
+ 0: ab (JIT)
+ 1: ab
+    fghi 
+Failed: error -46: JIT stack limit reached
+
+/x(ab|(bc|(de|(?1)x)x)x)/I
+Capturing subpattern count = 3
+First code unit = 'x'
+Subject length lower bound = 3
+JIT compilation was successful
+    xab123
+ 0: xab (JIT)
+ 1: ab
+    xfghi 
+Failed: error -46: JIT stack limit reached
+
+/(?!\w)(?R)/
+    abcd
+Failed: error -46: JIT stack limit reached
+    =abc 
+Failed: error -46: JIT stack limit reached
+
+/(?=\w)(?R)/
+    =abc 
+Failed: error -46: JIT stack limit reached
+    abcd
+Failed: error -46: JIT stack limit reached
+
+/(?<!\w)(?R)/
+    abcd
+Failed: error -46: JIT stack limit reached
+
+/(?<=\w)(?R)/
+    abcd
+Failed: error -46: JIT stack limit reached
+
+/(a+|(?R)b)/
+    aaa
+ 0: aaa (JIT)
+ 1: aaa
+    bbb 
+Failed: error -46: JIT stack limit reached
+
+/[^\xff]((?1))/BI
+------------------------------------------------------------------
+        Bra
+        [^\x{ff}]
+        CBra 1
+        Recurse
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Subject length lower bound = 1
+JIT compilation was successful
+    abcd
+Failed: error -46: JIT stack limit reached
+
+/(x(?1)){4}/
+
+/[axm]{7}/
+
+/(.|.)*?bx/
+    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabax
+Failed: error -47: match limit exceeded
+
+# End of testinput17
index 954b4b58f8f884d070424694fb59d7fa1dbe624b..0a5ffffd5c0a1cff264f36d78432bffc43cf761a 100644 (file)
 # This set of tests is run only with the 8-bit library. It tests the POSIX
-# interface with UTF/UCP support, which is supported only with the 8-bit
-# library. This test should not be run with JIT (which is not available for the
-# POSIX interface).
+# interface, which is supported only with the 8-bit library. This test should
+# not be run with JIT (which is not available for the POSIX interface).
     
+#forbid_utf
 #pattern posix
 
-/a\x{1234}b/utf
-    a\x{1234}b
- 0: a\x{1234}b
+# Test invalid options
 
-/\w/
-    +++\x{c2}
+/abc/auto_callout
+** Ignored with POSIX interface: auto_callout
+
+/abc/
+   abc\=find_limits
+** Ignored with POSIX interface: find_limits
+ 0: abc
+
+/abc/
+  abc\=partial_hard
+** Ignored with POSIX interface: partial_hard
+ 0: abc
+
+# Real tests
+
+/abc/
+    abc
+ 0: abc
+
+/^abc|def/
+    abcdef
+ 0: abc
+    abcdef\=notbol
+ 0: def
+
+/.*((abc)$|(def))/
+    defabc
+ 0: defabc
+ 1: abc
+ 2: abc
+    defabc\=noteol
+ 0: def
+ 1: def
+ 3: def
+
+/the quick brown fox/
+    the quick brown fox
+ 0: the quick brown fox
+\= Expect no match
+    The Quick Brown Fox
 No match: POSIX code 17: match failed
 
-/\w/ucp
-    +++\x{c2}
- 0: \xc2
-    
-# End of testdata/testinput17
+/the quick brown fox/i
+    the quick brown fox
+ 0: the quick brown fox
+    The Quick Brown Fox
+ 0: The Quick Brown Fox
+
+/(*LF)abc.def/
+\= Expect no match
+    abc\ndef
+No match: POSIX code 17: match failed
+
+/(*LF)abc$/
+    abc
+ 0: abc
+    abc\n
+ 0: abc
+
+/(abc)\2/
+Failed: POSIX code 15: bad back reference at offset 6     
+
+/(abc\1)/
+\= Expect no match
+    abc
+No match: POSIX code 17: match failed
+
+/a*(b+)(z)(z)/
+    aaaabbbbzzzz
+ 0: aaaabbbbzz
+ 1: bbbb
+ 2: z
+ 3: z
+    aaaabbbbzzzz\=ovector=0
+Matched without capture
+    aaaabbbbzzzz\=ovector=1
+ 0: aaaabbbbzz
+    aaaabbbbzzzz\=ovector=2
+ 0: aaaabbbbzz
+ 1: bbbb
+
+/(*ANY)ab.cd/
+    ab-cd
+ 0: ab-cd
+    ab=cd
+ 0: ab=cd
+\= Expect no match
+    ab\ncd
+No match: POSIX code 17: match failed
+
+/ab.cd/s
+    ab-cd
+ 0: ab-cd
+    ab=cd
+ 0: ab=cd
+    ab\ncd
+ 0: ab\x0acd
+
+/a(b)c/no_auto_capture
+    abc
+Matched with REG_NOSUB
+
+/a(?P<name>b)c/no_auto_capture
+    abc
+Matched with REG_NOSUB
+
+/a?|b?/
+    abc
+ 0: a
+\= Expect no match
+    ddd\=notempty
+No match: POSIX code 17: match failed
+
+/\w+A/
+   CDAAAAB
+ 0: CDAAAA
+
+/\w+A/ungreedy
+   CDAAAAB
+ 0: CDA
+   
+/\Biss\B/I,aftertext
+** Ignored with POSIX interface: info
+    Mississippi
+ 0: iss
+ 0+ issippi
+
+/abc/\
+Failed: POSIX code 9: bad escape sequence at offset 3     
+
+"(?(?C)"
+Failed: POSIX code 3: pattern error at offset 2     
+
+/abcd/substitute_extended
+** Ignored with POSIX interface: substitute_extended
+
+/\[A]{1000000}**/expand,regerror_buffsize=31
+Failed: POSIX code 4: ? * + invalid at offset 100000
+** regerror() message truncated
+
+/\[A]{1000000}**/expand,regerror_buffsize=32
+Failed: POSIX code 4: ? * + invalid at offset 1000001
+
+# End of testdata/testinput18
index 7f3aa0c28647cea27d88161f97de7e30127a7240..c4169ca08456e278f56e8a86458390a3fdc78b27 100644 (file)
-# This set of tests exercises the serialization/deserialization functions in
-# the library. It does not use UTF or JIT.
-
-#forbid_utf
-
-# Compile several patterns, push them onto the stack, and then write them
-# all to a file.
-
-#pattern push
-
-/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
-  (?(DEFINE)
-  (?<NAME_PAT>[a-z]+)
-  (?<ADDRESS_PAT>\d+)
-  )/x
-/^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i
-
-#save testsaved1
-
-# Do it again for some more patterns.
-
-/(*MARK:A)(*SKIP:B)(C|X)/mark
-** Ignored when compiled pattern is stacked with 'push': mark
-/(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames
-
-#save testsaved2
-#pattern -push
-
-# Reload the patterns, then pop them one by one and check them.
-
-#load testsaved1
-#load testsaved2
-
-#pop info
-Capturing subpattern count = 2
-Max back reference = 2
-Named capturing subpatterns:
-  n   1
-  n   2
-Options: dupnames
-Starting code units: b f 
-Subject length lower bound = 6
-    foofoo             
- 0: foofoo
- 1: foo
-    barbar
- 0: barbar
- 1: <unset>
- 2: bar
-    
-#pop mark
-    C
- 0: C
- 1: C
-MK: A
-    D 
-No match, mark = A
-    
-#pop
-    AmanaplanacanalPanama   
- 0: AmanaplanacanalPanama
- 1: <unset>
- 2: <unset>
- 3: AmanaplanacanalPanama
- 4: A
-
-#pop info
-Capturing subpattern count = 4
-Named capturing subpatterns:
-  ADDR          2
-  ADDRESS_PAT   4
-  NAME          1
-  NAME_PAT      3
-Options: extended
-Subject length lower bound = 3
-    metcalfe 33
- 0: metcalfe 33
- 1: metcalfe
- 2: 33
+# This set of tests is run only with the 8-bit library. It tests the POSIX
+# interface with UTF/UCP support, which is supported only with the 8-bit
+# library. This test should not be run with JIT (which is not available for the
+# POSIX interface).
     
-# Check for an error when different tables are used.
-
-/abc/push,tables=1
-/xyz/push,tables=2
-#save testsaved1
-Serialization failed: error -30: patterns do not all use the same character tables
+#pattern posix
 
-#pop
-    xyz
- 0: xyz
+/a\x{1234}b/utf
+    a\x{1234}b
+ 0: a\x{1234}b
 
-#pop
-    abc
- 0: abc
+/\w/
+\= Expect no match
+    +++\x{c2}
+No match: POSIX code 17: match failed
 
-#pop should give an error
-** Can't pop off an empty stack
-    pqr
-
-# End of testinput19 
+/\w/ucp
+    +++\x{c2}
+ 0: \xc2
+    
+# End of testdata/testinput19
index b62846612e77459b7eedb72faac46f8d34ecc0d1..7178410cfe8c22aebbfee508f56d9d4715e10e41 100644 (file)
@@ -9,6 +9,7 @@
 # test 5. 
 
 #forbid_utf
+#newline_default lf any anycrlf
 
 # Test binary zeroes in the pattern
 
@@ -61,8 +62,7 @@ Subject length lower bound = 3
  0: abc
     abc\=anchored
  0: abc
-    *** Failers
-No match
+\= Expect no match
     defabc\=anchored
 No match
     ABC
@@ -77,8 +77,7 @@ Subject length lower bound = 3
  0: abc
     abc\=anchored
  0: abc
-    *** Failers
-No match
+\= Expect no match
     defabc
 No match
     defabc\=anchored
@@ -114,8 +113,7 @@ Overall options: anchored
 Subject length lower bound = 3
     abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     def\nabc
 No match
 
@@ -227,7 +225,7 @@ Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 a b
 Subject length lower bound = 1
 
 /(ab\2)/
-Failed: error 115 at offset 6: reference to non-existent subpattern
+Failed: error 115 at offset 4: reference to non-existent subpattern
 
 /{4,5}abc/
 Failed: error 109 at offset 4: quantifier does not follow a repeatable item
@@ -319,15 +317,14 @@ Last code unit = 'c'
 Subject length lower bound = 3
     abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     abc\n
 No match
     abc\ndef
 No match
 
 /(a)(b)(c)(d)(e)\6/
-Failed: error 115 at offset 17: reference to non-existent subpattern
+Failed: error 115 at offset 16: reference to non-existent subpattern
 
 /the quick brown fox/I
 Capturing subpattern count = 0
@@ -345,8 +342,7 @@ Options: anchored
 Subject length lower bound = 19
     the quick brown fox
  0: the quick brown fox
-    *** Failers
-No match
+\= Expect no match
     this is a line with the quick brown fox
 No match
 
@@ -428,8 +424,6 @@ Subject length lower bound = 2
 
 /(?U)<.*>/I
 Capturing subpattern count = 0
-Compile options: <none>
-Overall options: ungreedy
 First code unit = '<'
 Last code unit = '>'
 Subject length lower bound = 2
@@ -456,8 +450,6 @@ Subject length lower bound = 3
 
 /(?U)={3,}?/I
 Capturing subpattern count = 0
-Compile options: <none>
-Overall options: ungreedy
 First code unit = '='
 Last code unit = '='
 Subject length lower bound = 3
@@ -474,8 +466,7 @@ Subject length lower bound = 3
  0: foo
     catfoo
  0: foo
-    *** Failers
-No match
+\= Expect no match
     the barfoo
 No match
     and cattlefoo
@@ -492,8 +483,6 @@ Failed: error 125 at offset 12: lookbehind assertion is not fixed length
 
 /(?i)abc/I
 Capturing subpattern count = 0
-Compile options: <none>
-Overall options: caseless
 First code unit = 'a' (caseless)
 Last code unit = 'c' (caseless)
 Subject length lower bound = 3
@@ -506,7 +495,7 @@ Subject length lower bound = 1
 /(?i)^1234/I
 Capturing subpattern count = 0
 Compile options: <none>
-Overall options: anchored caseless
+Overall options: anchored
 Subject length lower bound = 4
 
 /(^b|(?i)^d)/I
@@ -519,7 +508,7 @@ Subject length lower bound = 1
 Capturing subpattern count = 0
 May match empty string
 Compile options: <none>
-Overall options: anchored dotall
+Overall options: anchored
 Subject length lower bound = 0
 
 /[abcd]/I
@@ -529,15 +518,11 @@ Subject length lower bound = 1
 
 /(?i)[abcd]/I
 Capturing subpattern count = 0
-Compile options: <none>
-Overall options: caseless
 Starting code units: A B C D a b c d 
 Subject length lower bound = 1
 
 /(?m)[xy]|(b|c)/I
 Capturing subpattern count = 1
-Compile options: <none>
-Overall options: multiline
 Starting code units: b c x y 
 Subject length lower bound = 1
 
@@ -549,8 +534,7 @@ Subject length lower bound = 1
 
 /(?i)(^a|^b)/Im
 Capturing subpattern count = 1
-Compile options: multiline
-Overall options: caseless multiline
+Options: multiline
 First code unit at start or follows newline
 Subject length lower bound = 1
 
@@ -615,8 +599,7 @@ Subject length lower bound = 1
  0: a
     a\n
  0: a
-    *** Failers
-No match
+\= Expect no match
     a\=noteol
 No match
     a\n\=noteol
@@ -633,8 +616,7 @@ Subject length lower bound = 1
  0: a
     a\n\=noteol
  0: a
-    *** Failers
-No match
+\= Expect no match
     a\=noteol
 No match
 
@@ -692,8 +674,7 @@ Last code unit = 'r'
 Subject length lower bound = 3
     foo\nbarbar
  0: bar
-    ***Failers
-No match
+\= Expect no match
     rhubarb
 No match
     barbell
@@ -711,8 +692,7 @@ Last code unit = 'r'
 Subject length lower bound = 3
     foo\nbarbar
  0: bar
-    ***Failers
-No match
+\= Expect no match
     rhubarb
 No match
     barbell
@@ -730,8 +710,7 @@ Subject length lower bound = 3
  0: abc
     def\nabc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     defabc
 No match
 
@@ -756,8 +735,7 @@ Subject length lower bound = 5
  0: -cart
     a donkey-cart race
  0: -cart
-    *** Failers
-No match
+\= Expect no match
     cart
 No match
     horse-and-cart
@@ -800,8 +778,7 @@ Subject length lower bound = 2
  0: ZZ
     BZZ
  0: ZZ
-    *** Failers
-No match
+\= Expect no match
     ZZ
 No match
     abXYZZ
@@ -821,16 +798,11 @@ Subject length lower bound = 3
  0: bar
     foobbar
  0: bar
-    *** Failers
-No match
+\= Expect no match
     fooabar
 No match
 
-/This one is here because Perl behaves differently; see also the following/I
-Capturing subpattern count = 0
-First code unit = 'T'
-Last code unit = 'g'
-Subject length lower bound = 73
+# This one is here because Perl behaves differently; see also the following.
 
 /^(a\1?){4}$/I
 Capturing subpattern count = 1
@@ -838,23 +810,21 @@ Max back reference = 1
 Compile options: <none>
 Overall options: anchored
 Subject length lower bound = 4
+\= Expect no match
     aaaa
 No match
     aaaaaa
 No match
     
-/Perl does not fail these two for the final subjects. Neither did PCRE until/
-/release 8.01. The problem is in backtracking into a subpattern that contains/
-No match
-/a recursive reference to itself. PCRE has now made these into atomic patterns./
-No match
+# Perl does not fail these two for the final subjects. Neither did PCRE until
+# release 8.01. The problem is in backtracking into a subpattern that contains
+# a recursive reference to itself. PCRE has now made these into atomic patterns.
 
 /^(xa|=?\1a){2}$/
     xa=xaa
  0: xa=xaa
  1: =xaa
-    ** Failers
-No match
+\= Expect no match
     xa=xaaa
 No match
 
@@ -862,16 +832,11 @@ No match
     xa=xaa
  0: xa=xaa
  1: =xaa
-    ** Failers
-No match
+\= Expect no match
     xa=xaaa
 No match
 
-/These are syntax tests from Perl 5.005/I
-Capturing subpattern count = 0
-First code unit = 'T'
-Last code unit = '5'
-Subject length lower bound = 38
+# These are syntax tests from Perl 5.005
 
 /a[b-a]/
 Failed: error 108 at offset 4: range out of order in character class
@@ -901,13 +866,13 @@ Failed: error 109 at offset 2: quantifier does not follow a repeatable item
 Failed: error 122 at offset 0: unmatched closing parenthesis
 
 /\1/
-Failed: error 115 at offset 2: reference to non-existent subpattern
+Failed: error 115 at offset 1: reference to non-existent subpattern
 
 /\2/
-Failed: error 115 at offset 2: reference to non-existent subpattern
+Failed: error 115 at offset 1: reference to non-existent subpattern
 
 /(a)|\2/
-Failed: error 115 at offset 6: reference to non-existent subpattern
+Failed: error 115 at offset 5: reference to non-existent subpattern
 
 /a[b-a]/Ii
 Failed: error 108 at offset 4: range out of order in character class
@@ -940,7 +905,7 @@ Failed: error 122 at offset 0: unmatched closing parenthesis
 Failed: error 114 at offset 4: missing closing parenthesis
 
 /(?<%)b/
-Failed: error 124 at offset 3: unrecognized character after (?<
+Failed: error 124 at offset 3: letter or underscore expected after (?< or (?'
 
 /a(?{)b/
 Failed: error 111 at offset 3: unrecognized character after (? or (?-
@@ -970,10 +935,10 @@ Failed: error 125 at offset 6: lookbehind assertion is not fixed length
 Failed: error 104 at offset 7: numbers out of order in {} quantifier
 
 /abc/\
-Failed: error 101 at offset 4: \ at end of pattern
+Failed: error 101 at offset 3: \ at end of pattern
 
 /abc/\i
-Failed: error 101 at offset 4: \ at end of pattern
+Failed: error 101 at offset 3: \ at end of pattern
 
 /(a)bc(d)/I
 Capturing subpattern count = 2
@@ -1170,7 +1135,7 @@ Subject length lower bound = 1
 ------------------------------------------------------------------
 Capturing subpattern count = 1
 Compile options: <none>
-Overall options: anchored dotall
+Overall options: anchored
 Subject length lower bound = 1
 
 /(?s:.*X|^B)/IB
@@ -1233,8 +1198,7 @@ Subject length lower bound = 3
  0+ issippi
  0: iss
  0+ ippi
-    *** Failers
-No match
+\= Expect no match
     Mississippi\=anchored
 No match
 
@@ -1341,6 +1305,17 @@ Subject length lower bound = 3
  0: ab\x0a
  0+ cd
 
+/^/gm,newline=any
+    a\rb\nc\r\nxyz\=aftertext
+ 0: 
+ 0+ a\x0db\x0ac\x0d\x0axyz
+ 0: 
+ 0+ b\x0ac\x0d\x0axyz
+ 0: 
+ 0+ c\x0d\x0axyz
+ 0: 
+ 0+ xyz
+
 /abc/I
 Capturing subpattern count = 0
 First code unit = 'a'
@@ -1584,8 +1559,7 @@ Subject length lower bound = 0
  0: ab
     \
  0: 
-    *** Failers
- 0: 
+\= Expect no match
     \=notempty
 No match
 
@@ -1599,8 +1573,7 @@ Subject length lower bound = 0
  0: 
     ab-c\=notempty
  0: -
-    *** Failers
- 0: 
+\= Expect no match
     abc\=notempty
 No match
 
@@ -1638,8 +1611,7 @@ Subject length lower bound = 2
  0: ()
     12(abcde(fsh)xyz(foo(bar))lmno)89
  0: (abcde(fsh)xyz(foo(bar))lmno)
-    *** Failers
-No match
+\= Expect no match
     abcd
 No match
     abcd)
@@ -1676,8 +1648,7 @@ Subject length lower bound = 3
  0: (c)
     ((ab))
  0: ((ab))
-    *** Failers
-No match
+\= Expect no match
     ()
 No match
 
@@ -2134,9 +2105,7 @@ Subject length lower bound = 2
     aB
  0: aB
  1: a
-    *** Failers
- 0: ai
- 1: a
+\= Expect no match
     Ab
 No match
     AB
@@ -2659,8 +2628,7 @@ Subject length lower bound = 2
  0: ab
     aB
  0: aB
-    *** Failers
-No match
+\= Expect no match
     AB
 No match
 
@@ -2684,8 +2652,7 @@ Subject length lower bound = 2
     aB
  0: aB
  1: aB
-    *** Failers
-No match
+\= Expect no match
     AB
 No match
 
@@ -2697,8 +2664,7 @@ No match
         End
 ------------------------------------------------------------------
 Capturing subpattern count = 0
-Compile options: extended
-Overall options: caseless extended
+Options: extended
 First code unit = 'a' (caseless)
 Last code unit = 'c' (caseless)
 Subject length lower bound = 3
@@ -2712,8 +2678,7 @@ Subject length lower bound = 3
         End
 ------------------------------------------------------------------
 Capturing subpattern count = 0
-Compile options: extended
-Overall options: caseless extended
+Options: extended
 First code unit = 'a' (caseless)
 Last code unit = 'c' (caseless)
 Subject length lower bound = 3
@@ -2831,8 +2796,7 @@ Capturing subpattern count = 0
 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 
   Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z 
 Subject length lower bound = 1
-    *** Failers
- 0: F
+\= Expect no match
     xxxxx
 No match
 
@@ -2917,8 +2881,7 @@ Subject length lower bound = 0
     now is the time for all good men to come to the aid of the party
  0: now is the time for all good men to come to the aid of the party
  1: party
-    *** Failers
-No match
+\= Expect no match
     this is not a line with only words and spaces!
 No match
 
@@ -2930,8 +2893,7 @@ Subject length lower bound = 2
  0: 12345a
  1: 12345
  2: a
-    *** Failers
-No match
+\= Expect no match
     12345+
 No match
 
@@ -2993,8 +2955,7 @@ Subject length lower bound = 3
     (abc(def)xyz)
  0: (abc(def)xyz)
  1: xyz
-    *** Failers
-No match
+\= Expect no match
     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 No match
 
@@ -3062,8 +3023,6 @@ Subject length lower bound = 3
         End
 ------------------------------------------------------------------
 Capturing subpattern count = 0
-Compile options: <none>
-Overall options: ungreedy
 First code unit = 'x'
 Last code unit = 'b'
 Subject length lower bound = 3
@@ -3218,8 +3177,7 @@ Subject length lower bound = 2
  0: <abc<>def>
     <abc<>
  0: <>
-    *** Failers
-No match
+\= Expect no match
     <abc
 No match
 
@@ -3435,8 +3393,7 @@ Subject length lower bound = 1
  0: a
   xy\nabc
  0: a
-  *** Failers
-No match
+\= Expect no match
   xyabc
 No match
 
@@ -3448,8 +3405,6 @@ Subject length lower bound = 1
 
 /(?i)[ab]/I
 Capturing subpattern count = 0
-Compile options: <none>
-Overall options: caseless
 Starting code units: A B a b 
 Subject length lower bound = 1
 
@@ -3472,8 +3427,7 @@ Subject length lower bound = 6
 --->1234abcdef
   0     ^  ^       d
  0: abcdef
-    *** Failers
-No match
+\= Expect no match
     abcxyz
 No match
     abcxyzf
@@ -3505,8 +3459,7 @@ Subject length lower bound = 7
   1    ^           \d
   2    ^   ^       d
  0: 4abcdef
-    *** Failers
-No match
+\= Expect no match
     abcdef
 No match
 
@@ -3523,8 +3476,7 @@ Subject length lower bound = 7
   1    ^           \d
   2    ^   ^       d
  0: 4abcdef
-    *** Failers
-No match
+\= Expect no match
     abcdef
 No match
 
@@ -3548,8 +3500,6 @@ Capturing subpattern count = 0
 First code unit = 'a'
 Last code unit = 'f'
 Subject length lower bound = 6
-    *** Failers
-No match
     \x83\x0\x61bcdef
 --->\x83\x00abcdef
   0         ^  ^       d
@@ -3582,8 +3532,7 @@ Callout 1: last capture = 1
     123abcdefC-\=callout_none
  0: abcdef
  1: abc
-    *** Failers
-No match
+\= Expect no match
     123abcdef\=callout_fail=1
 --->123abcdef
   0    ^  ^       d
@@ -3609,10 +3558,6 @@ Subject length lower bound = 0
   1 ^     ^    )
  0: abcabc
  1: abc
-    *** Failers
---->*** Failers
-  0 ^               (abc(?C1))*
- 0: 
     abcabcabc\=callout_fail=1:3
 --->abcabcabc
   0 ^             (abc(?C1))*
@@ -3754,6 +3699,7 @@ Capturing subpattern count = 2
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
+\= Expect no match
     abbbbbccc\=callout_data=1
 --->abbbbbccc
   1 ^        ^    
@@ -3765,6 +3711,7 @@ Capturing subpattern count = 2
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
+\= Expect no match
     abbbbbccc\=callout_data=1
 --->abbbbbccc
   1 ^ ^           
@@ -3802,15 +3749,6 @@ Capturing subpattern count = 0
 Starting code units: a b 
 Subject length lower bound = 1
 
-/(?R)/I
-Failed: error 140 at offset 3: recursion could loop indefinitely
-
-/(a|(?R))/I
-Failed: error 140 at offset 6: recursion could loop indefinitely
-
-/(ab|(bc|(de|(?R))))/I
-Failed: error 140 at offset 15: recursion could loop indefinitely
-
 /x(ab|(bc|(de|(?R))))/I
 Capturing subpattern count = 3
 First code unit = 'x'
@@ -3837,17 +3775,10 @@ Subject length lower bound = 3
  1: xxab
  2: xxab
  3: xxab
-    *** Failers
-No match
+\= Expect no match
     xyab
 No match
 
-/(ab|(bc|(de|(?1))))/I
-Failed: error 140 at offset 15: recursion could loop indefinitely
-
-/x(ab|(bc|(de|(?1)x)x)x)/I
-Failed: error 140 at offset 16: recursion could loop indefinitely
-
 /^([^()]|\((?1)*\))*$/I
 Capturing subpattern count = 1
 May match empty string
@@ -3863,8 +3794,7 @@ Subject length lower bound = 0
     a(b(c))d
  0: a(b(c))d
  1: d
-    *** Failers)
-No match
+\= Expect no match)
     a(b(c)d
 No match
 
@@ -3933,8 +3863,7 @@ Subject length lower bound = 1
     -12
  0: -12
  1: -12
-    *** Failers
-No match
+\= Expect no match
     ((2+2)*-3)-7)
 No match
 
@@ -3942,7 +3871,7 @@ No match
 Capturing subpattern count = 2
 Compile options: <none>
 Overall options: anchored
-Subject length lower bound = 2
+Subject length lower bound = 3
     xyz
  0: xyz
  1: xyz
@@ -3951,8 +3880,7 @@ Subject length lower bound = 2
  0: xxyzxyzz
  1: xxyzxyzz
  2: xyzxyz
-    *** Failers
-No match
+\= Expect no match
     xxyzz
 No match
     xxyzxyzxyzz
@@ -3988,8 +3916,7 @@ Subject length lower bound = 2
  0: <>
  1: <>
  2: <>
-    *** Failers
-No match
+\= Expect no match
     <abc
 No match
 
@@ -4027,7 +3954,7 @@ Subject length lower bound = 3
 Capturing subpattern count = 2
 Compile options: <none>
 Overall options: anchored
-Subject length lower bound = 3
+Subject length lower bound = 2
     a=a
  0: a=a
  1: a
@@ -4158,8 +4085,7 @@ Subject length lower bound = 0
  2: <unset>
  3: Able was I ere I saw Elba
  4: A
-    *** Failers
-No match
+\= Expect no match
     The quick brown fox
 No match
 
@@ -4337,6 +4263,7 @@ Subject length lower bound = 2
 Callout data = 1
  0: ab
  1: ab
+\= Expect no match    
    aaabbb\=callout_data=-1
 --->aaabbb
   1 ^  ^       b
@@ -4445,8 +4372,7 @@ Subject length lower bound = 3
  1: 10,20,30,5,5,4,4,2,43,23,4234
  2: 10
  3: ,4234
-    *** Failers
-No match
+\= Expect no match
     []
 No match
 
@@ -4533,16 +4459,33 @@ Capturing subpattern count = 2
 May match empty string
 Subject length lower bound = 0
 
-/[ab]{1}+/IB
+/[ab]{1}+/B
 ------------------------------------------------------------------
         Bra
-        [ab]{1,1}+
+        [ab]
+        Ket
+        End
+------------------------------------------------------------------
+
+/()(?1){1}/B
+------------------------------------------------------------------
+        Bra
+        CBra 1
+        Ket
+        Recurse
+        Ket
+        End
+------------------------------------------------------------------
+
+/()(?1)/B
+------------------------------------------------------------------
+        Bra
+        CBra 1
+        Ket
+        Recurse
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
-Starting code units: a b 
-Subject length lower bound = 1
 
 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
 Capturing subpattern count = 3
@@ -4640,6 +4583,7 @@ Subject length lower bound = 5
  +4 ^   ^     e
  +5 ^    ^    
  0: abcde
+\= Expect no match
   abcdfe
 --->abcdfe
  +0 ^          a
@@ -4763,6 +4707,7 @@ Subject length lower bound = 2
  +2 ^   ^     b
  +3 ^    ^    
  0: aaaab
+\= Expect no match 
   aaaacb
 --->aaaacb
  +0 ^          a+
@@ -4830,8 +4775,7 @@ Subject length lower bound = 4
 +10 ^   ^    
  0: defx
  1: def
-  ** Failers 
-No match
+\= Expect no match 
   abcdefzx
 --->abcdefzx
  +0 ^            (abc|def)
@@ -4905,8 +4849,7 @@ Subject length lower bound = 4
 +10 ^   ^    
  0: defx
  1: def
-  ** Failers 
-No match
+\= Expect no match 
   abcdefzx
 --->abcdefzx
  +0 ^            (abc|def)
@@ -5022,6 +4965,7 @@ Capturing subpattern count = 1
 Options: auto_callout
 Starting code units: a b x 
 Subject length lower bound = 2
+\= Expect no match 
     Note: that { does NOT introduce a quantifier
 --->Note: that { does NOT introduce a quantifier
  +0         ^                                        ([ab]{,4}c|xy)
@@ -5071,6 +5015,7 @@ Capturing subpattern count = 1
 Options: auto_callout
 Starting code units: a b x 
 Subject length lower bound = 2
+\= Expect no match 
     Note: that { does NOT introduce a quantifier
 --->Note: that { does NOT introduce a quantifier
  +0         ^                                        ([ab]{,4}c|xy)
@@ -5212,7 +5157,7 @@ Max lookbehind = 1
 May match empty string
 Options: dotall
 Subject length lower bound = 0
-  ab cd\=offset=1
+  ab cd\=startoffset=1
  0:  cd
 
 /(?!.bcd).*/I
@@ -5237,8 +5182,7 @@ Partial match: abcd
  0: abcde
     the quick brown abc\=ps
 Partial match: abc
-    ** Failers\=ps
-No match
+\= Expect no match\=ps
     the quick brown abxyz fox\=ps
 No match
 
@@ -5279,8 +5223,7 @@ Partial match: 02/
 Partial match: 02/0
     02/1\=ps
 Partial match: 02/1
-    ** Failers\=ps
-No match
+\= Expect no match\=ps
     \=ps
 No match
     123\=ps
@@ -5360,8 +5303,7 @@ Partial match: 1234
 Partial match: 12345
     12345X
  0: 12345X
-    *** Failers
-No match
+\= Expect no match
     1X
 No match
     123456\=ps
@@ -5400,8 +5342,7 @@ Last code unit = 'k'
 Subject length lower bound = 10
     this is a line\nbreak
  0: line\x0abreak
-    ** Failers
-No match
+\= Expect no match
     line one\nthis is a line\nbreak in the second line
 No match
 
@@ -5414,8 +5355,7 @@ Last code unit = 'k'
 Subject length lower bound = 10
     this is a line\nbreak
  0: line\x0abreak
-    ** Failers
-No match
+\= Expect no match
     line one\nthis is a line\nbreak in the second line
 No match
 
@@ -5426,8 +5366,7 @@ Last code unit = 'd'
 Subject length lower bound = 4
     AbCd
  0: AbCd
-    ** Failers
-No match
+\= Expect no match
     abcd
 No match
 
@@ -5733,8 +5672,6 @@ Subject length lower bound = 2
  2: <unset>
  3: a2
   C a2 (2) A (non-unique)
-    ** Failers
-No match
     a1b\=copy=Z,copy=A
  0: a1
  1: a1
@@ -5819,8 +5756,6 @@ Subject length lower bound = 2
  2: <unset>
  3: a2
   G a2 (2) A (non-unique)
-    ** Failers
-No match
     a1b\=get=Z,get=A
  0: a1
  1: a1
@@ -5882,7 +5817,7 @@ Named capturing subpatterns:
   A   2
   A   3
 Compile options: <none>
-Overall options: anchored dupnames
+Overall options: anchored
 Duplicate name status changes
 Subject length lower bound = 2
     a1b\=copy=A
@@ -5900,14 +5835,9 @@ Subject length lower bound = 2
 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I
 Failed: error 143 at offset 37: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
 
-/ In this next test, J is not set at the outer level; consequently it isn't
-set in the pattern's options; consequently pcre_get_named_substring() produces
-a random value. /Ix
-Capturing subpattern count = 1
-Options: extended
-First code unit = 'I'
-Last code unit = 'e'
-Subject length lower bound = 141
+# In this next test, J is not set at the outer level; consequently it isn't set
+# in the pattern's options; consequently pcre2_substring_get_byname() produces
+# a random value.
 
 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
 Capturing subpattern count = 4
@@ -5943,8 +5873,7 @@ Subject length lower bound = 1
  1: a
     bc
  0: b
-    ** Failers
-No match
+\= Expect no match
     abc
 No match
 
@@ -6043,8 +5972,7 @@ Subject length lower bound = 3
  0: abc
     xyz\r\nabc
  0: abc
-    ** Failers
-No match
+\= Expect no match
     xyz\rabc
 No match
     xyzabc\r
@@ -6065,8 +5993,7 @@ Last code unit = 'c'
 Subject length lower bound = 3
     xyz\r\nabclf>
  0: abc
-    ** Failers
-No match
+\= Expect no match
     xyz\nabclf
 No match
     xyz\rabclf
@@ -6081,8 +6008,7 @@ Last code unit = 'c'
 Subject length lower bound = 3
     xyz\rabc
  0: abc
-    ** Failers
-No match
+\= Expect no match
     xyz\nabc
 No match
     xyz\r\nabc
@@ -6376,8 +6302,7 @@ Last code unit = 'A'
 Subject length lower bound = 3
     aaaA5
  0: aaaA5
-    ** Failers
-No match
+\= Expect no match
     aaaa5
 No match
 
@@ -7091,8 +7016,7 @@ Failed: error 141 at offset 3: unrecognized character after (?P
     bXbX
  0: bX
  1: X
-    ** Failers
-No match
+\= Expect no match
     aXaX
 No match
     aXbX
@@ -7138,8 +7062,7 @@ Failed: error 115 at offset 8: reference to non-existent subpattern
  0: bx
  1: bx
  2: x
-    ** Failers
-No match
+\= Expect no match
     axby
 No match
 
@@ -7159,8 +7082,7 @@ No match
  1: Xy
  2: X
  3: y
-    ** Failers
-No match
+\= Expect no match
     x
 No match
 
@@ -7308,8 +7230,7 @@ Subject length lower bound = 0
  2: <unset>
  3: Able was I ere I saw Elba
  4: A
-    *** Failers
-No match
+\= Expect no match
     The quick brown fox
 No match
 
@@ -7342,8 +7263,7 @@ Subject length lower bound = 2
  0: adaa
  1: a
  2: d
-    ** Failers
-No match
+\= Expect no match
     addd
 No match
     adbb
@@ -7358,8 +7278,7 @@ No match
  0: bdab
  1: b
  2: d
-    ** Failers
-No match
+\= Expect no match
     bddd
 No match
 
@@ -7398,39 +7317,36 @@ Last code unit = 'z'
 Subject length lower bound = 3
 
 /(a|)*\d/
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=ovector=0
-No match
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4\=ovector=0
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  1: 
+\= Expect no match
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=ovector=0
+No match
 
 /^a.b/newline=lf
     a\rb
  0: a\x0db
-    ** Failers
-No match
+\= Expect no match
     a\nb
 No match
 
 /^a.b/newline=cr
     a\nb
  0: a\x0ab
-    ** Failers
-No match
+\= Expect no match
     a\rb
 No match
 
 /^a.b/newline=anycrlf
     a\x85b
  0: a\x85b
-    ** Failers
-No match
+\= Expect no match
     a\rb
 No match
 
 /^a.b/newline=any
-    ** Failers
-No match
+\= Expect no match
     a\nb
 No match
     a\rb
@@ -7471,8 +7387,7 @@ No match
  0: a\x0cb
     a\x85b
  0: a\x85b
-    ** Failers
-No match
+\= Expect no match
     a\n\rb
 No match
 
@@ -7513,8 +7428,7 @@ No match
  0: a\x0a\x0db
     a\n\r\x85\x0cb
  0: a\x0a\x0d\x85\x0cb
-    ** Failers
-No match
+\= Expect no match
     ab
 No match
 
@@ -7533,8 +7447,7 @@ No match
  0: a\x0a\x0d\x0a\x0db
     a\n\n\r\nb
  0: a\x0a\x0a\x0d\x0ab
-    ** Failers
-No match
+\= Expect no match
     a\n\n\n\rb
 No match
     a\r
@@ -7584,17 +7497,19 @@ Subject length lower bound = 3
  1: x
 
 /(abc)(?i:(?1))/
-   defabcabcxyz
+    defabcabcxyz
  0: abcabc
  1: abc
-   DEFabcABCXYZ
+\= Expect no match
+    DEFabcABCXYZ
 No match
 
 /(abc)(?:(?i)(?1))/
-   defabcabcxyz
+    defabcabcxyz
  0: abcabc
  1: abc
-   DEFabcABCXYZ
+\= Expect no match
+    DEFabcABCXYZ
 No match
 
 /^(a)\g-2/
@@ -7615,16 +7530,14 @@ Failed: error 115 at offset 9: reference to non-existent subpattern
 /^a.b/newline=lf
     a\rb
  0: a\x0db
-    *** Failers
-No match
+\= Expect no match
     a\nb
 No match
 
 /.+foo/
     afoo
  0: afoo
-    ** Failers
-No match
+\= Expect no match
     \r\nfoo
 No match
     \nfoo
@@ -7635,16 +7548,14 @@ No match
  0: afoo
     \nfoo
  0: \x0afoo
-    ** Failers
-No match
+\= Expect no match
     \r\nfoo
 No match
 
 /.+foo/newline=any
     afoo
  0: afoo
-    ** Failers
-No match
+\= Expect no match
     \nfoo
 No match
     \r\nfoo
@@ -7663,8 +7574,7 @@ No match
  0: 
     abc\n\rxyz  
  0: 
-    ** Failers 
-No match
+\= Expect no match 
     abc\r\nxyz
 No match
 
@@ -7699,8 +7609,7 @@ No match
 /^X/m
     XABC
  0: X
-    ** Failers 
-No match
+\= Expect no match 
     XABC\=notbol
 No match
 
@@ -7734,8 +7643,7 @@ No match
     xyabcabc
  0: xyabcabc
  1: abc
-    ** Failers
-No match
+\= Expect no match
     xyabc  
 No match
     
@@ -7773,8 +7681,7 @@ Failed: error 115 at offset 5: reference to non-existent subpattern
  1: abc
     Y
  0: Y
-    ** Failers
-No match
+\= Expect no match
     abcY   
 No match
     
@@ -7804,8 +7711,7 @@ No match
  0: YabcXabcXabc
  1: Xabc
  2: abc
-    ** Failers
-No match
+\= Expect no match
     XabcXabc  
 No match
 
@@ -7855,8 +7761,7 @@ Failed: error 115 at offset 7: reference to non-existent subpattern
     bon-bon 
  0: bon-bon
  1: bon
-    ** Failers
-No match
+\= Expect no match
     tom-bon  
 No match
 
@@ -7962,8 +7867,7 @@ Failed: error 142 at offset 4: syntax error in subpattern name (missing terminat
         Ket
         End
 ------------------------------------------------------------------
-    ** Failers
-No match
+\= Expect no match
     XXXX
 No match
     
@@ -8191,6 +8095,7 @@ Failed: error 106 at offset 10: missing terminating ] for character class
 ------------------------------------------------------------------
 
 /^a+(*FAIL)/auto_callout
+\= Expect no match
     aaaaaa
 --->aaaaaa
  +0 ^          ^
@@ -8204,6 +8109,7 @@ Failed: error 106 at offset 10: missing terminating ] for character class
 No match
     
 /a+b?c+(*FAIL)/auto_callout
+\= Expect no match
     aaabccc
 --->aaabccc
  +0 ^           a+
@@ -8227,6 +8133,7 @@ No match
 No match
 
 /a+b?(*PRUNE)c+(*FAIL)/auto_callout
+\= Expect no match
     aaabccc
 --->aaabccc
  +0 ^           a+
@@ -8253,6 +8160,7 @@ No match
 No match
 
 /a+b?(*COMMIT)c+(*FAIL)/auto_callout
+\= Expect no match
     aaabccc
 --->aaabccc
  +0 ^           a+
@@ -8265,6 +8173,7 @@ No match
 No match
     
 /a+b?(*SKIP)c+(*FAIL)/auto_callout
+\= Expect no match
     aaabcccaaabccc
 --->aaabcccaaabccc
  +0 ^                  a+
@@ -8284,6 +8193,7 @@ No match
 No match
 
 /a+b?(*THEN)c+(*FAIL)/auto_callout
+\= Expect no match
     aaabccc
 --->aaabccc
  +0 ^           a+
@@ -8330,6 +8240,7 @@ Failed: error 161 at offset 11: number is too big
 Failed: error 115 at offset 3: reference to non-existent subpattern
 
 /.+A/newline=crlf
+\= Expect no match
     \r\nA
 No match
     
@@ -8352,24 +8263,21 @@ Failed: error 160 at offset 5: (*VERB) not recognized or malformed
 /(*CR)a.b/
     a\nb
  0: a\x0ab
-    ** Failers
-No match
+\= Expect no match
     a\rb  
 No match
 
 /(*CR)a.b/newline=lf
     a\nb
  0: a\x0ab
-    ** Failers
-No match
+\= Expect no match
     a\rb  
 No match
 
 /(*LF)a.b/newline=CRLF
     a\rb
  0: a\x0db
-    ** Failers
-No match
+\= Expect no match
     a\nb  
 No match
 
@@ -8378,14 +8286,12 @@ No match
  0: a\x0db
     a\nb  
  0: a\x0ab
-    ** Failers
-No match
+\= Expect no match
     a\r\nb  
 No match
 
 /(*ANYCRLF)a.b/newline=CR
-    ** Failers
-No match
+\= Expect no match
     a\rb
 No match
     a\nb  
@@ -8394,8 +8300,7 @@ No match
 No match
 
 /(*ANY)a.b/newline=cr
-    ** Failers
-No match
+\= Expect no match
     a\rb
 No match
     a\nb  
@@ -8438,8 +8343,7 @@ Subject length lower bound = 3
  0: a\x0ab
     a\r\nb
  0: a\x0d\x0ab
-    ** Failers
-No match
+\= Expect no match
     a\x85b
 No match
     a\x0bb     
@@ -8474,8 +8378,7 @@ Subject length lower bound = 2
  0: a\x0ab
     a\r\nb
  0: a\x0d\x0ab
-    ** Failers
-No match
+\= Expect no match
     a\x85b
 No match
     a\x0bb     
@@ -8510,8 +8413,7 @@ Subject length lower bound = 4
  0: a\x0a\x0d\x0db
     a\r\n\r\n\r\n\r\nb
  0: a\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0ab
-    ** Failers
-No match
+\= Expect no match
     a\x85\x85b
 No match
     a\x0b\x0bb     
@@ -8533,8 +8435,7 @@ Subject length lower bound = 4
  0: a\x85\x85b
     a\x0b\x0bb     
  0: a\x0b\x0bb
-    ** Failers 
-No match
+\= Expect no match 
     a\r\r\r\r\rb 
 No match
  
@@ -8626,10 +8527,10 @@ Failed: error 162 at offset 3: subpattern name expected
 Failed: error 162 at offset 3: subpattern name expected
 
 /\k/
-Failed: error 169 at offset 2: \k is not followed by a braced, angle-bracketed, or quoted name
+Failed: error 169 at offset 1: \k is not followed by a braced, angle-bracketed, or quoted name
 
 /\kabc/
-Failed: error 169 at offset 5: \k is not followed by a braced, angle-bracketed, or quoted name
+Failed: error 169 at offset 1: \k is not followed by a braced, angle-bracketed, or quoted name
 
 /(?P=)/
 Failed: error 162 at offset 4: subpattern name expected
@@ -8637,18 +8538,6 @@ Failed: error 162 at offset 4: subpattern name expected
 /(?P>)/
 Failed: error 162 at offset 4: subpattern name expected
 
-/(?!\w)(?R)/
-Failed: error 140 at offset 9: recursion could loop indefinitely
-
-/(?=\w)(?R)/
-Failed: error 140 at offset 9: recursion could loop indefinitely
-
-/(?<!\w)(?R)/
-Failed: error 140 at offset 10: recursion could loop indefinitely
-
-/(?<=\w)(?R)/
-Failed: error 140 at offset 10: recursion could loop indefinitely
-
 /[[:foo:]]/
 Failed: error 130 at offset 3: unknown POSIX class name
 
@@ -8677,19 +8566,19 @@ Failed: error 130 at offset 6: unknown POSIX class name
 Failed: error 130 at offset 3: unknown POSIX class name
 
 /(^(a|b\g<-1'c))/
-Failed: error 157 at offset 15: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
+Failed: error 157 at offset 8: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
 
 /^(?+1)(?<a>x|y){0}z/
     xzxx
  0: xz
     yzyy 
  0: yz
-    ** Failers
-No match
+\= Expect no match
     xxz  
 No match
 
 /(\3)(\1)(a)/
+\= Expect no match
     cat
 No match
 
@@ -8720,8 +8609,7 @@ Failed: error 115 at offset 3: reference to non-existent subpattern
     abcbabc
  0: abcbabc
  1: abc
-    ** Failers 
-No match
+\= Expect no match 
     abcXabc
 No match
 
@@ -8729,8 +8617,7 @@ No match
     abcXabc
  0: abcXabc
  1: abc
-    ** Failers 
-No match
+\= Expect no match 
     abcbabc
 No match
 
@@ -8755,20 +8642,17 @@ Failed: error 106 at offset 4: missing terminating ] for character class
 Failed: error 106 at offset 5: missing terminating ] for character class
 
 /a[]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
-    ** Failers
-No match
+\= Expect no match
     ab
 No match
 
 /a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
-    ** Failers
-No match
+\= Expect no match
     ab 
 No match
 
 /a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
-    ** Failers
-No match
+\= Expect no match
     ab 
 No match
 
@@ -8777,8 +8661,7 @@ No match
  0: aXb
     a\nb 
  0: a\x0ab
-    ** Failers
-No match
+\= Expect no match
     ab  
 No match
     
@@ -8787,8 +8670,7 @@ No match
  0: aXb
     a\nX\nXb 
  0: a\x0aX\x0aXb
-    ** Failers
-No match
+\= Expect no match
     ab  
 No match
 
@@ -8887,8 +8769,7 @@ Subject length lower bound = 1
  +2    ^ ^     z
  +3    ^  ^    
  0: xyz
-  ** Failers 
-No match
+\= Expect no match 
   abc
 No match
   abcxypqr  
@@ -8905,20 +8786,7 @@ No match
  +2    ^ ^     z
  +3    ^  ^    
  0: xyz
-  ** Failers 
---->** Failers
- +0 ^              x
- +0  ^             x
- +0   ^            x
- +0    ^           x
- +0     ^          x
- +0      ^         x
- +0       ^        x
- +0        ^       x
- +0         ^      x
- +0          ^     x
- +0           ^    x
-No match
+\= Expect no match 
   abc
 --->abc
  +0 ^       x
@@ -8956,7 +8824,7 @@ No match
 /(*NO_AUTO_POSSESS)a+b/B
 ------------------------------------------------------------------
         Bra
-        a++
+        a+
         b
         Ket
         End
@@ -9248,12 +9116,14 @@ Partial match: 123999
     ^^^^
 
 /Z(*F)/
+\= Expect no match
     Z\=ps
 No match
     ZA\=ps
 No match
     
 /Z(?!)/
+\= Expect no match
     Z\=ps
 No match
     ZA\=ps
@@ -9405,8 +9275,7 @@ Partial match: +ab
  0: abc
     ^^^
  0+ def
-    ** Failers
-No match
+\= Expect no match
     abcdef\=notempty
 No match
     xyzabcdef\=notempty
@@ -9420,8 +9289,7 @@ No match
  0: abc
     ^^^
  0+ def
-    ** Failers 
-No match
+\= Expect no match 
     abcdef\=notempty
 No match
 
@@ -9441,9 +9309,7 @@ No match
     xyz\=notempty_atstart
  0: 
  0+ yz
-    ** Failers 
- 0: 
- 0+ ** Failers
+\= Expect no match 
     xyz\=notempty
 No match
 
@@ -9454,9 +9320,7 @@ No match
     xyzabc
  0: 
  0+ xyzabc
-    ** Failers 
- 0: 
- 0+ ** Failers
+\= Expect no match 
     xyzabc\=notempty
 No match
     xyzabc\=notempty_atstart
@@ -9566,8 +9430,7 @@ No match
     XaaX
  0: aa
  1: a
-    ** Failers 
-No match
+\= Expect no match 
     XAAX 
 No match
 
@@ -9778,8 +9641,7 @@ Subject length lower bound = 3
  4: "
  5: <unset>
  6: "
-    ** Failers 
-No match
+\= Expect no match 
     b"11111
 No match
     a"11111 
@@ -9833,8 +9695,7 @@ Subject length lower bound = 2
     eX
  0: eX
  1: e
-    ** Failers
-No match
+\= Expect no match
     abcdY
 No match
     ey     
@@ -9879,8 +9740,7 @@ Subject length lower bound = 4
  2: b
  3: c
  4: dd
-    ** Failers
-No match
+\= Expect no match
     abcdde  
 No match
 
@@ -9936,8 +9796,7 @@ Partial match: abcde
     ABXABD  
  0: ABD
  1: B
-    ** Failers 
-No match
+\= Expect no match 
     ABX 
 No match
     BAXBAD  
@@ -9967,6 +9826,7 @@ Capturing subpattern count = 3
 Max back reference = 3
 Last code unit = 'a'
 Subject length lower bound = 3
+\= Expect no match
     cat
 No match
 
@@ -10004,8 +9864,7 @@ Subject length lower bound = 1
  0: Ab
     CcC 
  0: c
-    ** Failers
-No match
+\= Expect no match
     XABX   
 No match
 
@@ -10105,8 +9964,8 @@ No match
         End
 ------------------------------------------------------------------
 
-/ -- This one is here because Perl gives the match as "b" rather than "ab". I
-     believe this to be a Perl bug. --/
+# This one is here because Perl gives the match as "b" rather than "ab". I
+# believe this to be a Perl bug.
       
 /(?>a\Kb)z|(ab)/
     ab\=startchar 
@@ -10114,7 +9973,14 @@ No match
  1: ab
 
 /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
-Failed: error 140 at offset 31: recursion could loop indefinitely
+    abcd
+ 0: 
+ 1: 
+ 2: 
+    0abc 
+ 0: 0
+ 1: 0
+ 2: 0
 
 /abc(*MARK:)pqr/
 Failed: error 166 at offset 10: (*MARK) must have an argument
@@ -10129,6 +9995,7 @@ Failed: error 159 at offset 13: an argument is not allowed for (*ACCEPT), (*FAIL
 # bug because replacing the B in the pattern by (B|D) does make it fail.
 
 /A(*COMMIT)B/aftertext,mark
+\= Expect no match
     ACABX
 No match
 
@@ -10140,6 +10007,7 @@ No match
  0: AC
 
 /A(*PRUNE)B|A(*PRUNE)C/mark
+\= Expect no match
     AC
 No match
     
@@ -10147,8 +10015,7 @@ No match
 # though PCRE2 does.
 
 /^A(*:A)B|^X(*:A)Y/mark
-    ** Failers
-No match
+\= Expect no match
     XAQQ
 No match, mark = A
     
@@ -10161,20 +10028,22 @@ No match, mark = A
  0: ABC
     
 /(*COMMIT)ABC/no_start_optimize
-    ** Failers
-No match
+\= Expect no match
     DEFGABC
 No match
     
 /^(ab (c+(*THEN)cd) | xyz)/x
+\= Expect no match
     abcccd  
 No match
 
 /^(ab (c+(*PRUNE)cd) | xyz)/x
+\= Expect no match
     abcccd  
 No match
 
 /^(ab (c+(*FAIL)cd) | xyz)/x
+\= Expect no match
     abcccd  
 No match
     
@@ -10211,8 +10080,7 @@ No match
 ------------------------------------------------------------------
     ACBD
  0: ACBD
-    *** Failers
-No match
+\= Expect no match
     A\nB
 No match
     ACB\n   
@@ -10232,8 +10100,7 @@ No match
  0: ACBD
     ACB\n 
  0: ACB\x0a
-    *** Failers
-No match
+\= Expect no match
     A\nB  
 No match
   
@@ -10242,8 +10109,7 @@ No match
  0: A\x0aB
     A\rB
  0: A\x0dB
-    ** Failers
-No match
+\= Expect no match
     A\r\nB    
 No match
 
@@ -10354,6 +10220,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
+\= Expect no match
     X\x0d\x0a
 No match
 
@@ -10409,26 +10276,30 @@ Partial match: abc
 Partial match: abc
 
 /abc\B/
-    abc
-No match
     abc\=ps
 Partial match: abc
     abc\=ph
 Partial match: abc
+\= Expect no match
+    abc
+No match
 
 /.+/
+\= Bad offsets
+    abc\=offset=4
+Failed: error -33: bad offset value
+    abc\=offset=-4 
+** Invalid value in 'offset=-4'
+\= Valid data
     abc\=offset=0
  0: abc
     abc\=offset=1
  0: bc
     abc\=offset=2
  0: c
+\= Expect no match
     abc\=offset=3
 No match
-    abc\=offset=4
-Failed: error -33: bad offset value
-    abc\=offset=-4 
-** Invalid value in 'offset=-4'
 
 /^\cģ/
 Failed: error 168 at offset 3: \c must be followed by a printable ASCII character
@@ -10551,8 +10422,7 @@ Failed: error 115 at offset 15: reference to non-existent subpattern
  0: aaaaX
  1: a
  2: X
-    ** Failers 
-No match
+\= Expect no match 
     aaaa
 No match
 
@@ -10560,8 +10430,7 @@ No match
     aaaaX
  0: aaaaX
  1: X
-    ** Failers 
-No match
+\= Expect no match 
     aaaa
 No match
 
@@ -10745,8 +10614,7 @@ Subject length lower bound = 1
 /(?1)(?:(b(*ACCEPT))){0}c/
     bc
  0: bc
-    ** Failers 
-No match
+\= Expect no match 
     b 
 No match
 
@@ -10757,6 +10625,7 @@ No match
  0: c
 
 /^.*?(?(?=a)a|b(*THEN)c)/
+\= Expect no match 
     ba
 No match
 
@@ -10765,14 +10634,17 @@ No match
  0: ba
 
 /^.*?(?(?=a)a(*THEN)b|c)/
+\= Expect no match 
     ac
 No match
 
 /^.*?(?(?=a)a(*THEN)b)c/
+\= Expect no match 
     ac
 No match
 
 /^.*?(a(*THEN)b)c/
+\= Expect no match 
     aabc
 No match
     
@@ -10798,10 +10670,12 @@ No match
  0: C
  1: C
 MK: A
+\= Expect no match 
     D
 No match, mark = A
      
 /(*:A)A+(*SKIP:A)(B|Z)/mark
+\= Expect no match 
     AAAC
 No match, mark = A
 
@@ -10822,6 +10696,7 @@ No match, mark = A
 /(?>(*ACCEPT)b)c/
     c
  0: 
+\= Expect no match 
     c\=notempty
 No match
 
@@ -11087,9 +10962,6 @@ Matched, but too many substrings
         End
 ------------------------------------------------------------------
 
-/(a+|(?R)b)/
-Failed: error 140 at offset 7: recursion could loop indefinitely
-
 /^(a(*:A)(d|e(*:B))z|aeq)/auto_callout
     adz
 --->adz
@@ -11149,6 +11021,7 @@ Latest Mark: B
  1: aeq
 
 /.(*F)/
+\= Expect no match
     abc\=ph
 No match
 
@@ -11181,14 +11054,15 @@ Subject length lower bound = 0
  0: x
 
 'a*(*ACCEPT)b'aftertext
-    \=notempty_atstart
-No match
     abc\=notempty_atstart
  0: a
  0+ bc
     bbb\=notempty_atstart
  0: 
  0+ bb
+\= Expect no match
+    \=notempty_atstart
+No match
 
 /(*ACCEPT)a/I,aftertext
 Capturing subpattern count = 0
@@ -11224,8 +11098,7 @@ Subject length lower bound = 0
     aaaazzzzb
  0: aaaazzzzb
  1: zzzz
-    ** Failers
-No match
+\= Expect no match
     aazz  
 No match
 
@@ -11241,6 +11114,7 @@ No match
  1: c
     
 /(.)((?(1)c|a)|a(?2))/
+\= Expect no match
     baa  
 No match
 
@@ -11274,8 +11148,7 @@ No match
 /^a\x41z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     aAz
  0: aAz
-    *** Failers
-No match
+\= Expect no match
     ax41z
 No match
 
@@ -11290,8 +11163,7 @@ No match
 /^a\u0041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     aAz
  0: aAz
-    *** Failers
-No match
+\= Expect no match
     au0041z
 No match
 
@@ -11302,16 +11174,14 @@ No match
 /^a\u041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     au041z
  0: au041z
-    *** Failers
-No match
+\= Expect no match
     aAz
 No match
 
 /^a\U0041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     aU0041z
  0: aU0041z
-    *** Failers
-No match
+\= Expect no match
     aAz
 No match
 
@@ -11384,8 +11254,7 @@ MK: A
  4: X
  5: Y
 MK: B
-    ** Failers
-No match
+\= Expect no match
     XAQQ  
 No match, mark = A
     XAQQXZZ  
@@ -11402,8 +11271,7 @@ No match, mark = B
     aw 
  0: aw
 MK: n
-    ** Failers 
-No match, mark = n
+\= Expect no match 
     abc
 No match, mark = m
 
@@ -11411,8 +11279,7 @@ No match, mark = m
     aw 
  0: aw
 MK: n
-    ** Failers 
-No match, mark = n
+\= Expect no match 
     abc
 No match, mark = m
 
@@ -11969,10 +11836,11 @@ Partial match: 123a
  0: ad
 
 /^(?!a(*THEN)b|ac)../
-     ac
-No match
      ad 
  0: ad
+\= Expect no match
+     ac
+No match
 
 /^(?=a(*THEN)b|ac)/
     ac
@@ -12009,6 +11877,7 @@ No match
  0: bn
 
 /(?(?=b(*SKIP)a)bn|bnn)/
+\= Expect no match
     bnn
 No match
 
@@ -12073,9 +11942,10 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-# A complete set of tests for auto-possessification of character types.
+# A complete set of tests for auto-possessification of character types, but
+# omitting \C because it might be disabled (it has its own tests).
 
-/\D+\D \D+\d \D+\S \D+\s \D+\W \D+\w \D+. \D+\C \D+\R \D+\H \D+\h \D+\V \D+\v \D+\Z \D+\z \D+$/Bx
+/\D+\D \D+\d \D+\S \D+\s \D+\W \D+\w \D+. \D+\R \D+\H \D+\h \D+\V \D+\v \D+\Z \D+\z \D+$/Bx
 ------------------------------------------------------------------
         Bra
         \D+
@@ -12093,8 +11963,6 @@ Subject length lower bound = 5
         \D+
         Any
         \D+
-        AllAny
-        \D+
         \R
         \D+
         \H
@@ -12114,7 +11982,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/\d+\D \d+\d \d+\S \d+\s \d+\W \d+\w \d+. \d+\C \d+\R \d+\H \d+\h \d+\V \d+\v \d+\Z \d+\z \d+$/Bx
+/\d+\D \d+\d \d+\S \d+\s \d+\W \d+\w \d+. \d+\R \d+\H \d+\h \d+\V \d+\v \d+\Z \d+\z \d+$/Bx
 ------------------------------------------------------------------
         Bra
         \d++
@@ -12131,8 +11999,6 @@ Subject length lower bound = 5
         \w
         \d+
         Any
-        \d+
-        AllAny
         \d++
         \R
         \d+
@@ -12153,7 +12019,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/\S+\D \S+\d \S+\S \S+\s \S+\W \S+\w \S+. \S+\C \S+\R \S+\H \S+\h \S+\V \S+\v \S+\Z \S+\z \S+$/Bx
+/\S+\D \S+\d \S+\S \S+\s \S+\W \S+\w \S+. \S+\R \S+\H \S+\h \S+\V \S+\v \S+\Z \S+\z \S+$/Bx
 ------------------------------------------------------------------
         Bra
         \S+
@@ -12170,8 +12036,6 @@ Subject length lower bound = 5
         \w
         \S+
         Any
-        \S+
-        AllAny
         \S++
         \R
         \S+
@@ -12192,7 +12056,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/\s+\D \s+\d \s+\S \s+\s \s+\W \s+\w \s+. \s+\C \s+\R \s+\H \s+\h \s+\V \s+\v \s+\Z \s+\z \s+$/Bx
+/\s+\D \s+\d \s+\S \s+\s \s+\W \s+\w \s+. \s+\R \s+\H \s+\h \s+\V \s+\v \s+\Z \s+\z \s+$/Bx
 ------------------------------------------------------------------
         Bra
         \s+
@@ -12210,8 +12074,6 @@ Subject length lower bound = 5
         \s+
         Any
         \s+
-        AllAny
-        \s+
         \R
         \s+
         \H
@@ -12231,7 +12093,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/\W+\D \W+\d \W+\S \W+\s \W+\W \W+\w \W+. \W+\C \W+\R \W+\H \W+\h \W+\V \W+\v \W+\Z \W+\z \W+$/Bx
+/\W+\D \W+\d \W+\S \W+\s \W+\W \W+\w \W+. \W+\R \W+\H \W+\h \W+\V \W+\v \W+\Z \W+\z \W+$/Bx
 ------------------------------------------------------------------
         Bra
         \W+
@@ -12249,8 +12111,6 @@ Subject length lower bound = 5
         \W+
         Any
         \W+
-        AllAny
-        \W+
         \R
         \W+
         \H
@@ -12270,7 +12130,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/\w+\D \w+\d \w+\S \w+\s \w+\W \w+\w \w+. \w+\C \w+\R \w+\H \w+\h \w+\V \w+\v \w+\Z \w+\z \w+$/Bx
+/\w+\D \w+\d \w+\S \w+\s \w+\W \w+\w \w+. \w+\R \w+\H \w+\h \w+\V \w+\v \w+\Z \w+\z \w+$/Bx
 ------------------------------------------------------------------
         Bra
         \w+
@@ -12287,8 +12147,6 @@ Subject length lower bound = 5
         \w
         \w+
         Any
-        \w+
-        AllAny
         \w++
         \R
         \w+
@@ -12309,65 +12167,24 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/\C+\D \C+\d \C+\S \C+\s \C+\W \C+\w \C+. \C+\C \C+\R \C+\H \C+\h \C+\V \C+\v \C+\Z \C+\z \C+$/Bx
+/\R+\D \R+\d \R+\S \R+\s \R+\W \R+\w \R+. \R+\R \R+\H \R+\h \R+\V \R+\v \R+\Z \R+\z \R+$/Bx
 ------------------------------------------------------------------
         Bra
-        AllAny+
+        \R+
         \D
-        AllAny+
+        \R++
         \d
-        AllAny+
+        \R+
         \S
-        AllAny+
+        \R++
         \s
-        AllAny+
+        \R+
         \W
-        AllAny+
-        \w
-        AllAny+
-        Any
-        AllAny+
-        AllAny
-        AllAny+
-        \R
-        AllAny+
-        \H
-        AllAny+
-        \h
-        AllAny+
-        \V
-        AllAny+
-        \v
-        AllAny+
-        \Z
-        AllAny++
-        \z
-        AllAny+
-        $
-        Ket
-        End
-------------------------------------------------------------------
-
-/\R+\D \R+\d \R+\S \R+\s \R+\W \R+\w \R+. \R+\C \R+\R \R+\H \R+\h \R+\V \R+\v \R+\Z \R+\z \R+$/Bx
-------------------------------------------------------------------
-        Bra
-        \R+
-        \D
-        \R++
-        \d
-        \R+
-        \S
-        \R++
-        \s
-        \R+
-        \W
-        \R++
+        \R++
         \w
         \R++
         Any
         \R+
-        AllAny
-        \R+
         \R
         \R+
         \H
@@ -12387,7 +12204,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/\H+\D \H+\d \H+\S \H+\s \H+\W \H+\w \H+. \H+\C \H+\R \H+\H \H+\h \H+\V \H+\v \H+\Z \H+\z \H+$/Bx
+/\H+\D \H+\d \H+\S \H+\s \H+\W \H+\w \H+. \H+\R \H+\H \H+\h \H+\V \H+\v \H+\Z \H+\z \H+$/Bx
 ------------------------------------------------------------------
         Bra
         \H+
@@ -12405,8 +12222,6 @@ Subject length lower bound = 5
         \H+
         Any
         \H+
-        AllAny
-        \H+
         \R
         \H+
         \H
@@ -12426,7 +12241,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/\h+\D \h+\d \h+\S \h+\s \h+\W \h+\w \h+. \h+\C \h+\R \h+\H \h+\h \h+\V \h+\v \h+\Z \h+\z \h+$/Bx
+/\h+\D \h+\d \h+\S \h+\s \h+\W \h+\w \h+. \h+\R \h+\H \h+\h \h+\V \h+\v \h+\Z \h+\z \h+$/Bx
 ------------------------------------------------------------------
         Bra
         \h+
@@ -12443,8 +12258,6 @@ Subject length lower bound = 5
         \w
         \h+
         Any
-        \h+
-        AllAny
         \h++
         \R
         \h++
@@ -12465,7 +12278,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/\V+\D \V+\d \V+\S \V+\s \V+\W \V+\w \V+. \V+\C \V+\R \V+\H \V+\h \V+\V \V+\v \V+\Z \V+\z \V+$/Bx
+/\V+\D \V+\d \V+\S \V+\s \V+\W \V+\w \V+. \V+\R \V+\H \V+\h \V+\V \V+\v \V+\Z \V+\z \V+$/Bx
 ------------------------------------------------------------------
         Bra
         \V+
@@ -12482,8 +12295,6 @@ Subject length lower bound = 5
         \w
         \V+
         Any
-        \V+
-        AllAny
         \V++
         \R
         \V+
@@ -12504,7 +12315,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/\v+\D \v+\d \v+\S \v+\s \v+\W \v+\w \v+. \v+\C \v+\R \v+\H \v+\h \v+\V \v+\v \v+\Z \v+\z \v+$/Bx
+/\v+\D \v+\d \v+\S \v+\s \v+\W \v+\w \v+. \v+\R \v+\H \v+\h \v+\V \v+\v \v+\Z \v+\z \v+$/Bx
 ------------------------------------------------------------------
         Bra
         \v+
@@ -12522,8 +12333,6 @@ Subject length lower bound = 5
         \v+
         Any
         \v+
-        AllAny
-        \v+
         \R
         \v+
         \H
@@ -12543,7 +12352,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/ a+\D  a+\d  a+\S  a+\s  a+\W  a+\w  a+.  a+\C  a+\R  a+\H  a+\h  a+\V  a+\v  a+\Z  a+\z  a+$/Bx
+/ a+\D  a+\d  a+\S  a+\s  a+\W  a+\w  a+.  a+\R  a+\H  a+\h  a+\V  a+\v  a+\Z  a+\z  a+$/Bx
 ------------------------------------------------------------------
         Bra
         a+
@@ -12560,8 +12369,6 @@ Subject length lower bound = 5
         \w
         a+
         Any
-        a+
-        AllAny
         a++
         \R
         a+
@@ -12582,7 +12389,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/\n+\D \n+\d \n+\S \n+\s \n+\W \n+\w \n+. \n+\C \n+\R \n+\H \n+\h \n+\V \n+\v \n+\Z \n+\z \n+$/Bx
+/\n+\D \n+\d \n+\S \n+\s \n+\W \n+\w \n+. \n+\R \n+\H \n+\h \n+\V \n+\v \n+\Z \n+\z \n+$/Bx
 ------------------------------------------------------------------
         Bra
         \x0a+
@@ -12600,8 +12407,6 @@ Subject length lower bound = 5
         \x0a+
         Any
         \x0a+
-        AllAny
-        \x0a+
         \R
         \x0a+
         \H
@@ -12621,7 +12426,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/ .+\D  .+\d  .+\S  .+\s  .+\W  .+\w  .+.  .+\C  .+\R  .+\H  .+\h  .+\V  .+\v  .+\Z  .+\z  .+$/Bx
+/ .+\D  .+\d  .+\S  .+\s  .+\W  .+\w  .+.  .+\R  .+\H  .+\h  .+\V  .+\v  .+\Z  .+\z  .+$/Bx
 ------------------------------------------------------------------
         Bra
         Any+
@@ -12638,8 +12443,6 @@ Subject length lower bound = 5
         \w
         Any+
         Any
-        Any+
-        AllAny
         Any++
         \R
         Any+
@@ -12660,7 +12463,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/ .+\D  .+\d  .+\S  .+\s  .+\W  .+\w  .+.  .+\C  .+\R  .+\H  .+\h  .+\V  .+\v  .+\Z  .+\z  .+$/Bsx
+/ .+\D  .+\d  .+\S  .+\s  .+\W  .+\w  .+.  .+\R  .+\H  .+\h  .+\V  .+\v  .+\Z  .+\z  .+$/Bsx
 ------------------------------------------------------------------
         Bra
         AllAny+
@@ -12678,8 +12481,6 @@ Subject length lower bound = 5
         AllAny+
         AllAny
         AllAny+
-        AllAny
-        AllAny+
         \R
         AllAny+
         \H
@@ -12699,7 +12500,7 @@ Subject length lower bound = 5
         End
 ------------------------------------------------------------------
 
-/\D+$  \d+$  \S+$  \s+$  \W+$  \w+$  \C+$  \R+$  \H+$  \h+$  \V+$  \v+$   a+$  \n+$   .+$  .+$/Bmx
+/ \D+$  \d+$  \S+$  \s+$  \W+$  \w+$  \R+$  \H+$  \h+$  \V+$ \v+$  a+$   \n+$  .+$  .+$/Bmx
 ------------------------------------------------------------------
         Bra
         \D+
@@ -12713,8 +12514,6 @@ Subject length lower bound = 5
         \W+
      /m $
         \w++
-     /m $
-        AllAny+
      /m $
         \R+
      /m $
@@ -13326,10 +13125,10 @@ Failed: error 144 at offset 13: group name must start with a non-digit
 Failed: error 144 at offset 14: group name must start with a non-digit
 
 /\g'3gh'/
-Failed: error 157 at offset 7: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
+Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
 
 /\g<5fg>/
-Failed: error 157 at offset 7: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
+Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
 
 /(?(<4gh>)abc)/
 Failed: error 144 at offset 4: group name must start with a non-digit
@@ -13393,8 +13192,7 @@ Failed: error 144 at offset 5: group name must start with a non-digit
  0: red
     put it all on red  
  0: red
-    ** Failers
-No match
+\= Expect no match
     no reduction
 No match
     Alfred Winifred
@@ -13410,6 +13208,7 @@ Start of matched string is beyond its end - displaying from end to start.
  0+ abcd
 
 /abcd/newline=lf,firstline
+\= Expect no match
     xx\nxabcd
 No match
     
@@ -13461,10 +13260,10 @@ Failed: error 178 at offset 3: digits missing in \x{} or \o{}
 Failed: error 167 at offset 3: non-hex character in \x{} (closing brace missing?)
 
 /A\8B/
-Failed: error 115 at offset 4: reference to non-existent subpattern
+Failed: error 115 at offset 2: reference to non-existent subpattern
 
 /A\9B/
-Failed: error 115 at offset 4: reference to non-existent subpattern
+Failed: error 115 at offset 2: reference to non-existent subpattern
 
 # This one is here because Perl fails to match "12" for this pattern when the $ 
 # is present.
@@ -13474,8 +13273,7 @@ Failed: error 115 at offset 4: reference to non-existent subpattern
  0: abc:
     12
  0: 12
-    *** Failers
-No match
+\= Expect no match
     123
 No match
     xyz    
@@ -13551,8 +13349,7 @@ Capturing subpattern count = 0
 Subject length lower bound = 6
     yesnononoyes
  0: nonono
-    ** Failers
-No match
+\= Expect no match
     yesno   
 No match
 
@@ -13568,8 +13365,7 @@ Subject length lower bound = 5
  1: abc
     xyzno
  0: xyzno
-    ** Failers
-No match
+\= Expect no match
     abcno
 No match
     xyzyes    
@@ -13584,6 +13380,9 @@ Failed: error 179 at offset 11: syntax error in (?(VERSION condition
 /(?(VERSION>=10.0.0)yes|no)/
 Failed: error 179 at offset 16: syntax error in (?(VERSION condition
 
+/(?(VERSION=10.101)yes|no)/
+Failed: error 179 at offset 17: syntax error in (?(VERSION condition
+
 /abcd/I
 Capturing subpattern count = 0
 First code unit = 'a'
@@ -13626,8 +13425,6 @@ Subject length lower bound = 0
 /(((((a)))))/parens_nest_limit=2
 Failed: error 119 at offset 3: parentheses are too deeply nested
 
-# Tests for pcre2_substitute()
-
 /abc/replace=XYZ
     123123
  0: 123123
@@ -13674,27 +13471,27 @@ Failed: error 119 at offset 3: parentheses are too deeply nested
 
 /abc/replace=a$++
     123abc
-Failed: error -35: invalid replacement string
+Failed: error -35 at offset 2 in replacement: invalid replacement string
 
 /abc/replace=a$bad
     123abc
-Failed: error -49: unknown substring
+Failed: error -49 at offset 5 in replacement: unknown substring
 
 /abc/replace=a${A234567890123456789_123456789012}z
     123abc
-Failed: error -49: unknown substring
+Failed: error -49 at offset 36 in replacement: unknown substring
 
 /abc/replace=a${A23456789012345678901234567890123}z
     123abc
-Failed: error -35: invalid replacement string
+Failed: error -35 at offset 35 in replacement: invalid replacement string
 
 /abc/replace=a${bcd
     123abc
-Failed: error -35: invalid replacement string
+Failed: error -58 at offset 6 in replacement: expected closing curly bracket in replacement string
 
 /abc/replace=a${b+d}z
     123abc
-Failed: error -35: invalid replacement string
+Failed: error -58 at offset 4 in replacement: expected closing curly bracket in replacement string
 
 /abc/replace=[10]XYZ
     123abc123
@@ -13737,8 +13534,76 @@ Failed: error -34: bad option value
 /(.)(.)/g,replace=$2$1
     abcdefgh  
  4: badcfehg
+    
+/(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=${*MARK}
+    apple lemon blackberry
+ 3: pear orange strawberry
+    apple strudel
+ 1: pear strudel
+    fruitless  
+ 0: fruitless
+
+/(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/replace=${*MARK} sauce,
+    apple lemon blackberry
+ 1: pear sauce lemon blackberry
+
+/(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=<$*MARK>
+    apple lemon blackberry
+ 3: <pear> <orange> <strawberry>
+    apple strudel
+ 1: <pear> strudel
+    fruitless  
+ 0: fruitless
+    
+/(*:pear)apple/g,replace=${*MARKING} 
+    apple lemon blackberry
+Failed: error -35 at offset 11 in replacement: invalid replacement string
+
+/(*:pear)apple/g,replace=${*MARK-time
+    apple lemon blackberry
+Failed: error -58 at offset 7 in replacement: expected closing curly bracket in replacement string
+
+/(*:pear)apple/g,replace=${*mark} 
+    apple lemon blackberry
+Failed: error -35 at offset 8 in replacement: invalid replacement string
 
-# End of substitute tests 
+/(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=<$*MARKET>
+    apple lemon blackberry
+Failed: error -35 at offset 9 in replacement: invalid replacement string
+
+/(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=[22]${*MARK}
+    apple lemon blackberry
+Failed: error -48: no more memory
+    apple lemon blackberry\=substitute_overflow_length
+Failed: error -48: no more memory: 23 code units are needed
+
+/(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=[23]${*MARK}
+    apple lemon blackberry
+ 3: pear orange strawberry
+
+/abc/
+    123abc123\=replace=[9]XYZ
+Failed: error -48: no more memory
+    123abc123\=substitute_overflow_length,replace=[9]XYZ
+Failed: error -48: no more memory: 10 code units are needed
+    123abc123\=substitute_overflow_length,replace=[6]XYZ
+Failed: error -48: no more memory: 10 code units are needed
+    123abc123\=substitute_overflow_length,replace=[1]XYZ
+Failed: error -48: no more memory: 10 code units are needed
+    123abc123\=substitute_overflow_length,replace=[0]XYZ
+Failed: error -48: no more memory: 10 code units are needed
+
+/a(b)c/
+    123abc123\=replace=[9]x$1z
+Failed: error -48: no more memory
+    123abc123\=substitute_overflow_length,replace=[9]x$1z
+Failed: error -48: no more memory: 10 code units are needed
+    123abc123\=substitute_overflow_length,replace=[6]x$1z
+Failed: error -48: no more memory: 10 code units are needed
+    123abc123\=substitute_overflow_length,replace=[1]x$1z
+Failed: error -48: no more memory: 10 code units are needed
+    123abc123\=substitute_overflow_length,replace=[0]x$1z
+Failed: error -48: no more memory: 10 code units are needed
 
 "((?=(?(?=(?(?=(?(?=()))))))))"
     a
@@ -13747,6 +13612,7 @@ Failed: error -34: bad option value
  2: 
 
 "(?(?=)==)(((((((((?=)))))))))"
+\= Expect no match
     a
 No match
 
@@ -13821,6 +13687,7 @@ Capturing subpattern count = 0
 Options: auto_callout
 First code unit at start or follows newline
 Subject length lower bound = 1
+\= Expect no match
     aaa
 --->aaa
  +0 ^       .*
@@ -13834,6 +13701,7 @@ No match
 Capturing subpattern count = 0
 Options: auto_callout no_dotstar_anchor
 Subject length lower bound = 1
+\= Expect no match
     aaa
 --->aaa
  +0 ^       .*
@@ -13864,7 +13732,7 @@ Subject length lower bound = 1
 /(*NO_DOTSTAR_ANCHOR)(?s).*\d/info
 Capturing subpattern count = 0
 Compile options: <none>
-Overall options: dotall no_dotstar_anchor
+Overall options: no_dotstar_anchor
 Subject length lower bound = 1
 
 '^(?:(a)|b)(?(1)A|B)'
@@ -13928,8 +13796,7 @@ Failed: error 109 at offset 7: quantifier does not follow a repeatable item
  0: 00765
      456
  0: 456
-     ** Failers
-No match
+\= Expect no match
      356   
 No match
 
@@ -14193,8 +14060,7 @@ Callout (5): 'x\x00z'
 /(?(?!)a|b)/
     bbb
  0: b
-    ** Failers 
-No match
+\= Expect no match 
     aaa 
 No match
 
@@ -14293,10 +14159,8 @@ Capturing subpattern count = 2
 May match empty string
 Subject length lower bound = 0
 
-/ab\Cde/never_backslash_c
-Failed: error 183 at offset 3: using \C is disabled by the application
-
 /abc/
+\= Expect no match
     \[9x!xxx(]{9999}
 No match
     
@@ -14319,7 +14183,7 @@ No match
  0: 
 
 /((((((((x))))))))\81/
-Failed: error 115 at offset 20: reference to non-existent subpattern
+Failed: error 115 at offset 19: reference to non-existent subpattern
     xx1
 
 /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((x))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\80/
@@ -14342,10 +14206,10 @@ Matched, but too many substrings
 14: x
 
 /\80/
-Failed: error 115 at offset 3: reference to non-existent subpattern
+Failed: error 115 at offset 2: reference to non-existent subpattern
 
 /A\8B\9C/
-Failed: error 115 at offset 7: reference to non-existent subpattern
+Failed: error 115 at offset 2: reference to non-existent subpattern
     A8B9C
     
 /(?x:((?'a')) # comment (with parentheses) and | vertical
@@ -14428,10 +14292,10 @@ Subject length lower bound = 1
 ------------------------------------------------------------------
 
 /(\9*+(?2);\3++()2|)++{/
-Failed: error 115 at offset 22: reference to non-existent subpattern
+Failed: error 115 at offset 2: reference to non-existent subpattern
 
 /\V\x85\9*+((?2)\3++()2)*:2/
-Failed: error 115 at offset 26: reference to non-existent subpattern
+Failed: error 115 at offset 7: reference to non-existent subpattern
 
 /(((?(R)){0,2}) (?'x'((?'R')((?'R')))))/dupnames
 
@@ -14470,4 +14334,828 @@ Failed: error 161 at offset 32: number is too big
         End
 ------------------------------------------------------------------
 
+/[[:>:]](?<)/
+Failed: error 124 at offset 10: letter or underscore expected after (?< or (?'
+
+/((?x)(*:0))#(?'/
+Failed: error 124 at offset 15: letter or underscore expected after (?< or (?'
+
+/(?C$[$)(?<]/
+Failed: error 124 at offset 10: letter or underscore expected after (?< or (?'
+
+/(?C$)$)(?<]/
+Failed: error 124 at offset 10: letter or underscore expected after (?< or (?'
+
+/(?(R))*+/B
+------------------------------------------------------------------
+        Bra
+        Braposzero
+        SBraPos
+        SCond
+        Cond recurse any
+        Ket
+        KetRpos
+        Ket
+        End
+------------------------------------------------------------------
+    abcd
+ 0: 
+
+/((?x)(?#))#(?'/
+Failed: error 124 at offset 14: letter or underscore expected after (?< or (?'
+
+/((?x)(?#))#(?'abc')/I
+Capturing subpattern count = 2
+Named capturing subpatterns:
+  abc   2
+First code unit = '#'
+Subject length lower bound = 1
+
+/[[:\\](?<[::]/
+Failed: error 124 at offset 9: letter or underscore expected after (?< or (?'
+
+/[[:\\](?'abc')[a:]/I
+Capturing subpattern count = 1
+Named capturing subpatterns:
+  abc   1
+Starting code units: : [ \ 
+Subject length lower bound = 2
+
+"[[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[:::::::::::::::::[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[[[:::E[[[:[:[[:[:::[[:::E[[[:[:[[:'[:::::E[[[:[::::::[[[:[[[[[[[::E[[[:[::::::[[[:[[[[[[[[:[[::[::::[[:::::::[[:[[[[[[[:[[::[:[[:[~"
+Failed: error 106 at offset 353: missing terminating ] for character class
+
+/()(?(R)0)*+/B
+------------------------------------------------------------------
+        Bra
+        CBra 1
+        Ket
+        Braposzero
+        SBraPos
+        SCond
+        Cond recurse any
+        0
+        Ket
+        KetRpos
+        Ket
+        End
+------------------------------------------------------------------
+
+/(?R-:(?</
+Failed: error 129 at offset 3: (?R or (?[+-]digits must be followed by )
+
+/(?(?C{\Q})(?!(?'/
+Failed: error 124 at offset 16: letter or underscore expected after (?< or (?'
+
+/(?(?C{\Q})(?!(?'abc')))/I
+Capturing subpattern count = 1
+Named capturing subpatterns:
+  abc   1
+May match empty string
+Subject length lower bound = 0
+
+/(?1){3918}(((((0(\k'R'))))(?J)(?'R'(?'R'\3){99})))/I
+Capturing subpattern count = 8
+Max back reference = 8
+Named capturing subpatterns:
+  R   7
+  R   8
+Duplicate name status changes
+Last code unit = '0'
+Subject length lower bound = 65535
+
+/(?|(aaa)|(b))\g{1}/I
+Capturing subpattern count = 1
+Max back reference = 1
+Starting code units: a b 
+Subject length lower bound = 0
+
+/(?|(aaa)|(b))(?1)/I
+Capturing subpattern count = 1
+Starting code units: a b 
+Subject length lower bound = 4
+
+/(?|(aaa)|(b))/I
+Capturing subpattern count = 1
+Starting code units: a b 
+Subject length lower bound = 1
+
+/(?|(?'a'aaa)|(?'a'b))\k'a'/I
+Capturing subpattern count = 1
+Max back reference = 1
+Named capturing subpatterns:
+  a   1
+Starting code units: a b 
+Subject length lower bound = 0
+
+/(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/I,dupnames
+Capturing subpattern count = 2
+Max back reference = 2
+Named capturing subpatterns:
+  a   1
+  a   2
+Options: dupnames
+Starting code units: a b 
+Last code unit = 'c'
+Subject length lower bound = 0
+
+/ab{3cd/
+    ab{3cd
+ 0: ab{3cd
+
+/ab{3,cd/
+    ab{3,cd
+ 0: ab{3,cd
+
+/ab{3,4a}cd/
+    ab{3,4a}cd
+ 0: ab{3,4a}cd
+
+/{4,5a}bc/
+    {4,5a}bc
+ 0: {4,5a}bc
+
+/\x0{ab}/
+    \0{ab} 
+ 0: \x00{ab}
+
+/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
+    ababababbbabZXXXX
+ 0: ababababbbabZ
+ 1: ab
+ 2: b
+
+/.*?a(*PRUNE)b/
+    aab
+ 0: ab
+
+/.*?a(*PRUNE)b/s
+    aab
+ 0: ab
+
+/^a(*PRUNE)b/s
+\= Expect no match
+    aab
+No match
+
+/.*?a(*SKIP)b/
+    aab
+ 0: ab
+
+/(?(8000000000/
+Failed: error 161 at offset 13: number is too big
+
+/((?(R8000000000)))/
+Failed: error 161 at offset 16: number is too big
+
+/0(?0)|(1)(*THEN)(*SKIP:0)(*FAIL)/
+\= Expect no match
+    01
+No match
+
+/(?(1)()\983040\2)/
+Failed: error 115 at offset 13: reference to non-existent subpattern
+
+/(*LIMIT_MATCH=)abc/
+Failed: error 160 at offset 14: (*VERB) not recognized or malformed
+
+/(*CRLF)(*LIMIT_MATCH=)abc/
+Failed: error 160 at offset 21: (*VERB) not recognized or malformed
+
+/(?:ab)?(?:ab)(?:ab)/
+    abab
+ 0: abab
+    ababab
+ 0: ababab
+\= Expect no match
+    aba
+No match
+
+/((*MARK:A))++a(*SKIP:B)b/
+\= Expect no match
+    aacb
+No match
+
+/(*MARK:a\zb)z/alt_verbnames 
+Failed: error 140 at offset 9: invalid escape sequence in (*VERB) name
+    
+/(*:ab\t(d\)c)xxx/
+Failed: error 122 at offset 12: unmatched closing parenthesis
+
+/(*:ab\t(d\)c)xxx/alt_verbnames,mark
+    cxxxz
+ 0: xxx
+MK: ab\x09(d)c
+
+/(*:A\Qxx)x\EB)x/alt_verbnames,mark
+    x
+ 0: x
+MK: Axx)xB
+    
+/(*:A\ExxxB)x/alt_verbnames,mark
+    x 
+ 0: x
+MK: AxxxB
+    
+/(*: A \ and #comment
+     \ B)x/x,alt_verbnames,mark
+    x  
+ 0: x
+MK: A and B
+    
+/(*:A
+B)x/alt_verbnames,mark 
+    x
+ 0: x
+MK: A\x0aB
+
+/(*:abc\Qpqr)/alt_verbnames
+Failed: error 160 at offset 12: (*VERB) not recognized or malformed
+
+/abc/use_offset_limit
+    1234abcde\=offset_limit=100
+ 0: abc
+    1234abcde\=offset_limit=9
+ 0: abc
+    1234abcde\=offset_limit=4
+ 0: abc
+    1234abcde\=offset_limit=4,offset=4
+ 0: abc
+\= Expect no match
+    1234abcde\=offset_limit=4,offset=5
+No match
+    1234abcde\=offset_limit=3
+No match
+
+/(?<=abc)/use_offset_limit
+    1234abc\=offset_limit=7
+ 0: 
+\= Expect no match
+    1234abc\=offset_limit=6
+No match
+    
+/A/g,replace=-,use_offset_limit
+    XAXAXAXAXA\=offset_limit=4
+ 2: X-X-XAXAXA
+
+/abc/
+\= Expect error
+    1234abcde\=offset_limit=4
+Failed: error -56: offset limit set without PCRE2_USE_OFFSET_LIMIT
+
+/^\w/m,use_offset_limit
+    \n..\naa\=offset_limit=3
+No match
+    \n..\naa\=offset_limit=4
+ 0: a
+
+/abcd/null_context
+    abcd\=null_context
+ 0: abcd
+\= Expect error     
+    abcd\=null_context,find_limits
+** Not allowed together: find_limits null_context
+    abcd\=allusedtext,startchar 
+** Not allowed together: allusedtext startchar
+
+/abcd/replace=w\rx\x82y\o{333}z(\Q12\$34$$\x34\E5$$),substitute_extended
+    abcd
+ 1: w\x0dx\x82y\xdbz(12\$34$$\x345$)
+    
+/a(bc)(DE)/replace=a\u$1\U$1\E$1\l$2\L$2\Eab\Uab\LYZ\EDone,substitute_extended
+    abcDE
+ 1: aBcBCbcdEdeabAByzDone
+/abcd/replace=xy\kz,substitute_extended
+    abcd
+Failed: error -57 at offset 4 in replacement: bad escape sequence in replacement string
+
+/a(?:(b)|(c))/substitute_extended,replace=X${1:+1:-1}X${2:+2:-2}
+    ab
+ 1: X1X-2
+    ac
+ 1: X-1X2
+    ab\=replace=${1:+$1\:$1:$2}
+ 1: b:b
+    ac\=replace=${1:+$1\:$1:$2}
+ 1: c
+
+/a(?:(b)|(c))/substitute_extended,replace=X${1:-1:-1}X${2:-2:-2}
+    ab
+ 1: XbX2:-2
+    ac
+ 1: X1:-1Xc
+
+/(a)/substitute_extended,replace=>${1:+\Q$1:{}$$\E+\U$1}<
+    a
+ 1: >$1:{}$$+A<
+
+/X(b)Y/substitute_extended
+    XbY\=replace=x${1:+$1\U$1}y
+ 1: xbBY
+    XbY\=replace=\Ux${1:+$1$1}y
+ 1: XBBY
+
+/a/substitute_extended,replace=${*MARK:+a:b}
+    a
+Failed: error -58 at offset 7 in replacement: expected closing curly bracket in replacement string
+
+/(abcd)/replace=${1:+xy\kz},substitute_extended
+    abcd
+Failed: error -57 at offset 8 in replacement: bad escape sequence in replacement string
+
+/(abcd)/
+    abcd\=replace=${1:+xy\kz},substitute_extended
+Failed: error -57 at offset 8 in replacement: bad escape sequence in replacement string
+
+/abcd/substitute_extended,replace=>$1<
+    abcd
+Failed: error -49 at offset 3 in replacement: unknown substring
+
+/abcd/substitute_extended,replace=>xxx${xyz}<<<
+    abcd
+Failed: error -49 at offset 10 in replacement: unknown substring
+
+/(?J)(?:(?<A>a)|(?<A>b))/replace=<$A>
+    [a]
+ 1: [<a>]
+    [b] 
+ 1: [<b>]
+\= Expect error     
+    (a)\=ovector=1
+Failed: error -54 at offset 3 in replacement: requested value is not available
+
+/(a)|(b)/replace=<$1>
+\= Expect error
+    b
+Failed: error -55 at offset 3 in replacement: requested value is not set
+
+/(aa)(BB)/substitute_extended,replace=\U$1\L$2\E$1..\U$1\l$2$1
+    aaBB
+ 1: AAbbaa..AAbBaa
+
+/^(o(\1{72}{\"{\\{00000059079}\d*){74}}){19}/I
+Capturing subpattern count = 2
+Max back reference = 1
+Compile options: <none>
+Overall options: anchored
+Last code unit = '}'
+Subject length lower bound = 65535
+
+/((p(?'K/
+Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator)
+
+/((p(?'K/no_auto_capture
+Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator)
+
+/abc/replace=A$3123456789Z
+    abc
+Failed: error -49 at offset 3 in replacement: unknown substring
+
+/(?<!a{65535}a{5})x/I
+Failed: error 187 at offset 16: lookbehind assertion is too long
+
+/(?<!a{65535})x/I
+Capturing subpattern count = 0
+Max lookbehind = 65535
+First code unit = 'x'
+Subject length lower bound = 1
+
+/(?=a\K)/replace=z
+    BaCaD
+Failed: error -60: match with end before start is not supported
+    
+/(?'abcdefghijklmnopqrstuvwxyzABCDEFG'toolong)/
+Failed: error 148 at offset 36: subpattern name is too long (maximum 32 characters)
+/(?'abcdefghijklmnopqrstuvwxyzABCDEF'justright)/ 
+
+# These two use zero-termination
+/abcd/max_pattern_length=3
+Failed: error 188 at offset 0: pattern string is longer than the limit set by the application
+
+/abc/max_pattern_length=3
+
+# These two, being hex, pass the length
+/abcdefab/hex,max_pattern_length=3
+Failed: error 188 at offset 0: pattern string is longer than the limit set by the application
+
+/abcdef/hex,max_pattern_length=3
+
+# These two patterns used to take a long time to compile
+
+"(.*)
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI
+Capturing subpattern count = 12
+May match empty string
+Options: extended
+First code unit at start or follows newline
+Subject length lower bound = 0
+
+"(?<=a()
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+a)"xI
+Capturing subpattern count = 12
+Max lookbehind = 2
+May match empty string
+Options: extended
+Subject length lower bound = 0
+
+# When (?| is used and groups of the same number may be different,
+# we have to rely on a count to catch overly complicated patterns.
+
+"(?|()|())(.*)
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI
+Failed: error 186 at offset 148: regular expression is too complicated
+
+"(?|()|())(?<=a()
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
+a)"xI
+Failed: error 186 at offset 154: regular expression is too complicated
+
+# Test the use of malloc for caching group information when there are more
+# groups than fit into the on-stack workspace.
+
+/\[()]{1024}/I,expand
+Expanded: ()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
+Capturing subpattern count = 1024
+May match empty string
+Subject length lower bound = 0
+
+# Test minlength capped at 65535
+
+/(A{65000})\1{65000}/I
+Capturing subpattern count = 1
+Max back reference = 1
+First code unit = 'A'
+Last code unit = 'A'
+Subject length lower bound = 65535
+
+# Test group scans when numbers are not unique
+
+/(?|()+|(a)+)/BI
+------------------------------------------------------------------
+        Bra
+        Bra
+        SCBra 1
+        KetRmax
+        Alt
+        CBra 1
+        a
+        KetRmax
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+May match empty string
+Subject length lower bound = 0
+
+/(?|(a)+|()+)/BI
+------------------------------------------------------------------
+        Bra
+        Bra
+        CBra 1
+        a
+        KetRmax
+        Alt
+        SCBra 1
+        KetRmax
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+May match empty string
+Subject length lower bound = 0
+
+/(?|()|(a))/BI
+------------------------------------------------------------------
+        Bra
+        Bra
+        CBra 1
+        Ket
+        Alt
+        CBra 1
+        a
+        Ket
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+May match empty string
+Subject length lower bound = 0
+
+/(?|(a)|())/BI
+------------------------------------------------------------------
+        Bra
+        Bra
+        CBra 1
+        a
+        Ket
+        Alt
+        CBra 1
+        Ket
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+May match empty string
+Subject length lower bound = 0
+
+# Test CRLF handling in empty string substitutions
+
+/^$/gm,newline=anycrlf,replace=-
+    X\r\n\r\nY
+ 1: X\x0d\x0a-\x0d\x0aY
+
+/^$/gm,newline=crlf,replace=-
+    X\r\n\r\nY
+ 1: X\x0d\x0a-\x0d\x0aY
+
+/^$/gm,newline=any,replace=-
+    X\r\n\r\nY
+ 1: X\x0d\x0a-\x0d\x0aY
+
+"(*ANYCRLF)(?m)^(.*[^0-9\r\n].*|)$"g,replace=NaN
+    15\r\nfoo\r\n20\r\nbar\r\nbaz\r\n\r\n20
+ 4: 15\x0d\x0aNaN\x0d\x0a20\x0d\x0aNaN\x0d\x0aNaN\x0d\x0aNaN\x0d\x0a20
+
+/a[[:punct:]b]/bincode
+------------------------------------------------------------------
+        Bra
+        a
+        [!-/:-@[-`b{-~]
+        Ket
+        End
+------------------------------------------------------------------
+
+/a[b[:punct:]]/bincode
+------------------------------------------------------------------
+        Bra
+        a
+        [!-/:-@[-`b{-~]
+        Ket
+        End
+------------------------------------------------------------------
+
+/L(?#(|++<!(2)?/B
+------------------------------------------------------------------
+        Bra
+        L?+
+        Ket
+        End
+------------------------------------------------------------------
+
+/L(?#(|++<!(2)?/B,no_auto_possess
+------------------------------------------------------------------
+        Bra
+        L?
+        Ket
+        End
+------------------------------------------------------------------
+
+/L(?#(|++<!(2)?/B,auto_callout
+------------------------------------------------------------------
+        Bra
+        Callout 255 0 14
+        L?+
+        Callout 255 14 0
+        Ket
+        End
+------------------------------------------------------------------
+
+/L(?#(|++<!(2)?/B,no_auto_possess,auto_callout
+------------------------------------------------------------------
+        Bra
+        Callout 255 0 14
+        L?
+        Callout 255 14 0
+        Ket
+        End
+------------------------------------------------------------------
+
+/(A*)\E+/B,auto_callout
+------------------------------------------------------------------
+        Bra
+        Callout 255 0 7
+        SCBra 1
+        Callout 255 1 2
+        A*
+        Callout 255 3 0
+        KetRmax
+        Callout 255 7 0
+        Ket
+        End
+------------------------------------------------------------------
+
+/()\Q\E*]/B,auto_callout
+------------------------------------------------------------------
+        Bra
+        Callout 255 0 7
+        Brazero
+        SCBra 1
+        Callout 255 1 0
+        KetRmax
+        Callout 255 7 1
+        ]
+        Callout 255 8 0
+        Ket
+        End
+------------------------------------------------------------------
+    a[bc]d
+--->a[bc]d
+ +0     ^      ()\Q\E*
+ +1     ^      )
+ +7     ^      ]
+ +8     ^^     
+ 0: ]
+ 1: 
+
+/\x8a+f|;T?(*:;.'?`(\xeap ){![^()!y*''C*(?';]{1;(\x08)/B,alt_verbnames,dupnames,extended
+------------------------------------------------------------------
+        Bra
+        \x{8a}++
+        f
+        Alt
+        ;
+        T?
+        *MARK ;.'?`(\x{ea}p
+        {!
+        [\x00- "-&+-:<->@-BD-xz-\xff] (neg)
+        {1;
+        CBra 1
+        \x08
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+
+# Tests for NULL characters in comments and verb "names" and callouts
+
+# /A#B\x00C\x0aZ/
+/41 23 42 00 43 0a 5a/Bx,hex
+------------------------------------------------------------------
+        Bra
+        AZ
+        Ket
+        End
+------------------------------------------------------------------
+
+# /A+#B\x00C\x0a+/
+/41 2b 23 42 00 43 0a 2b/Bx,hex
+------------------------------------------------------------------
+        Bra
+        A++
+        Ket
+        End
+------------------------------------------------------------------
+
+# /A(*:B\x00W#X\00Y\x0aC)Z/
+/41 28 2a 3a 42 00 57 23 58 00 59 0a 43 29 5a/Bx,hex,alt_verbnames
+------------------------------------------------------------------
+        Bra
+        A
+        *MARK B\x{0}WC
+        Z
+        Ket
+        End
+------------------------------------------------------------------
+
+# /A(*:B\x00W#X\00Y\x0aC)Z/
+/41 28 2a 3a 42 00 57 23 58 00 59 0a 43 29 5a/Bx,hex
+------------------------------------------------------------------
+        Bra
+        A
+        *MARK B\x{0}W#X\x{0}Y\x{a}C
+        Z
+        Ket
+        End
+------------------------------------------------------------------
+
+# /A(?C{X\x00Y})B/
+/41 28 3f 43 7b 58 00 59 7d 29 42/B,hex
+------------------------------------------------------------------
+        Bra
+        A
+        CalloutStr {X\x{0}Y} 5 10 1
+        B
+        Ket
+        End
+------------------------------------------------------------------
+
+# /A(?#X\x00Y)B/
+/41 28 3f 23 7b 00 7d 29 42/B,hex
+------------------------------------------------------------------
+        Bra
+        AB
+        Ket
+        End
+------------------------------------------------------------------
+
+# Tests for leading comment in extended patterns
+
+/ (?-x):?/extended
+
+/\v(?-x):?/extended
+
+/0b 28 3f 2d 78 29 3a/hex,extended
+
+/#comment
+(?-x):?/extended
+
+/(8(*:6^\x09x\xa6l\)6!|\xd0:[^:|)\x09d\Z\d{85*m(?'(?<1!)*\W[*\xff]!!h\w]*\xbe;/alt_bsux,alt_verbnames,allow_empty_class,dollar_endonly,extended,multiline,never_utf,no_dotstar_anchor,no_start_optimize
+Failed: error 124 at offset 49: letter or underscore expected after (?< or (?'
+
+/a|(b)c/replace=>$1<,substitute_unset_empty
+    cat
+ 1: c><t
+    xbcom 
+ 1: x>b<om
+
+/a|(b)c/
+    cat\=replace=>$1<
+Failed: error -55 at offset 3 in replacement: requested value is not set
+    cat\=replace=>$1<,substitute_unset_empty
+ 1: c><t
+    xbcom\=replace=>$1<,substitute_unset_empty
+ 1: x>b<om
+
+/a|(b)c/substitute_extended
+    cat\=replace=>${2:-xx}<
+Failed: error -49 at offset 9 in replacement: unknown substring
+    cat\=replace=>${2:-xx}<,substitute_unknown_unset
+ 1: c>xx<t
+    cat\=replace=>${X:-xx}<,substitute_unknown_unset
+ 1: c>xx<t
+
+/a|(?'X'b)c/replace=>$X<,substitute_unset_empty
+    cat
+ 1: c><t
+    xbcom 
+ 1: x>b<om
+
+/a|(?'X'b)c/replace=>$Y<,substitute_unset_empty
+    cat
+Failed: error -49 at offset 3 in replacement: unknown substring
+    cat\=substitute_unknown_unset 
+ 1: c><t
+    cat\=substitute_unknown_unset,-substitute_unset_empty 
+Failed: error -55 at offset 3 in replacement: requested value is not set
+
+/a|(b)c/replace=>$2<,substitute_unset_empty
+    cat
+Failed: error -49 at offset 3 in replacement: unknown substring
+    cat\=substitute_unknown_unset 
+ 1: c><t
+    cat\=substitute_unknown_unset,-substitute_unset_empty 
+Failed: error -55 at offset 3 in replacement: requested value is not set
+
+/()()()/use_offset_limit
+    \=ovector=11000000000
+** Invalid value in 'ovector=11000000000'
+    \=callout_fail=11000000000
+** Invalid value in 'callout_fail=11000000000'
+    \=callout_fail=1:11000000000
+** Invalid value in 'callout_fail=1:11000000000'
+    \=callout_data=11000000000 
+** Invalid value in 'callout_data=11000000000'
+    \=callout_data=-11000000000 
+** Invalid value in 'callout_data=-11000000000'
+    \=offset_limit=1100000000000000000000 
+** Invalid value in 'offset_limit=1100000000000000000000'
+    \=copy=11000000000 
+** Invalid value in 'copy=11000000000'
+
+/(*MARK:A\x00b)/mark
+    abc
+ 0: 
+MK: A\x00b
+
+/(*MARK:A\x00b)/mark,alt_verbnames
+    abc
+ 0: 
+MK: A\x00b
+
+# /(*MARK:A\x00b)/
+/28 2a 4d 41 52 4b 3a 41 00 62 29/mark,hex
+    abc
+ 0: 
+MK: A\x00b
+
+# /(*MARK:A\x00b)/
+/28 2a 4d 41 52 4b 3a 41 00 62 29/mark,hex,alt_verbnames
+    abc
+ 0: 
+MK: A\x00b
+
 # End of testinput2 
diff --git a/testdata/testoutput20 b/testdata/testoutput20
new file mode 100644 (file)
index 0000000..e923080
--- /dev/null
@@ -0,0 +1,101 @@
+# This set of tests exercises the serialization/deserialization functions in
+# the library. It does not use UTF or JIT.
+
+#forbid_utf
+
+# Compile several patterns, push them onto the stack, and then write them
+# all to a file.
+
+#pattern push
+
+/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
+  (?(DEFINE)
+  (?<NAME_PAT>[a-z]+)
+  (?<ADDRESS_PAT>\d+)
+  )/x
+/^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i
+
+#save testsaved1
+
+# Do it again for some more patterns.
+
+/(*MARK:A)(*SKIP:B)(C|X)/mark
+** Ignored when compiled pattern is stacked with 'push': mark
+/(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames
+
+#save testsaved2
+#pattern -push
+
+# Reload the patterns, then pop them one by one and check them.
+
+#load testsaved1
+#load testsaved2
+
+#pop info
+Capturing subpattern count = 2
+Max back reference = 2
+Named capturing subpatterns:
+  n   1
+  n   2
+Options: dupnames
+Starting code units: b f 
+Subject length lower bound = 6
+    foofoo             
+ 0: foofoo
+ 1: foo
+    barbar
+ 0: barbar
+ 1: <unset>
+ 2: bar
+    
+#pop mark
+    C
+ 0: C
+ 1: C
+MK: A
+\= Expect no match     
+    D 
+No match, mark = A
+    
+#pop
+    AmanaplanacanalPanama   
+ 0: AmanaplanacanalPanama
+ 1: <unset>
+ 2: <unset>
+ 3: AmanaplanacanalPanama
+ 4: A
+
+#pop info
+Capturing subpattern count = 4
+Named capturing subpatterns:
+  ADDR          2
+  ADDRESS_PAT   4
+  NAME          1
+  NAME_PAT      3
+Options: extended
+Subject length lower bound = 3
+    metcalfe 33
+ 0: metcalfe 33
+ 1: metcalfe
+ 2: 33
+    
+# Check for an error when different tables are used.
+
+/abc/push,tables=1
+/xyz/push,tables=2
+#save testsaved1
+Serialization failed: error -30: patterns do not all use the same character tables
+
+#pop
+    xyz
+ 0: xyz
+
+#pop
+    abc
+ 0: abc
+
+#pop should give an error
+** Can't pop off an empty stack
+    pqr
+
+# End of testinput20
diff --git a/testdata/testoutput21 b/testdata/testoutput21
new file mode 100644 (file)
index 0000000..6bf3f60
--- /dev/null
@@ -0,0 +1,94 @@
+# These are tests of \C that do not involve UTF. They are not run when \C is
+# disabled by compiling with --enable-never-backslash-C.
+
+/\C+\D \C+\d \C+\S \C+\s \C+\W \C+\w \C+. \C+\R \C+\H \C+\h \C+\V \C+\v \C+\Z \C+\z \C+$/Bx
+------------------------------------------------------------------
+        Bra
+        AllAny+
+        \D
+        AllAny+
+        \d
+        AllAny+
+        \S
+        AllAny+
+        \s
+        AllAny+
+        \W
+        AllAny+
+        \w
+        AllAny+
+        Any
+        AllAny+
+        \R
+        AllAny+
+        \H
+        AllAny+
+        \h
+        AllAny+
+        \V
+        AllAny+
+        \v
+        AllAny+
+        \Z
+        AllAny++
+        \z
+        AllAny+
+        $
+        Ket
+        End
+------------------------------------------------------------------
+
+/\D+\C \d+\C \S+\C \s+\C \W+\C \w+\C .+\C \R+\C \H+\C \h+\C \V+\C \v+\C a+\C \n+\C \C+\C/Bx
+------------------------------------------------------------------
+        Bra
+        \D+
+        AllAny
+        \d+
+        AllAny
+        \S+
+        AllAny
+        \s+
+        AllAny
+        \W+
+        AllAny
+        \w+
+        AllAny
+        Any+
+        AllAny
+        \R+
+        AllAny
+        \H+
+        AllAny
+        \h+
+        AllAny
+        \V+
+        AllAny
+        \v+
+        AllAny
+        a+
+        AllAny
+        \x0a+
+        AllAny
+        AllAny+
+        AllAny
+        Ket
+        End
+------------------------------------------------------------------
+
+/ab\Cde/never_backslash_c
+Failed: error 183 at offset 3: using \C is disabled by the application
+
+/ab\Cde/info
+Capturing subpattern count = 0
+Contains \C
+First code unit = 'a'
+Last code unit = 'e'
+Subject length lower bound = 5
+    abXde
+ 0: abXde
+    
+/(?<=ab\Cde)X/
+    abZdeX
+ 0: X
+
+# End of testinput21
diff --git a/testdata/testoutput22-16 b/testdata/testoutput22-16
new file mode 100644 (file)
index 0000000..ca1fd76
--- /dev/null
@@ -0,0 +1,167 @@
+# Tests of \C when Unicode support is available. Note that \C is not supported
+# for DFA matching in UTF mode, so this test is not run with -dfa. The output
+# of this test is different in 8-, 16-, and 32-bit modes. Some tests may match
+# in some widths and not in others.
+
+/ab\Cde/utf,info
+Capturing subpattern count = 0
+Contains \C
+Options: utf
+First code unit = 'a'
+Last code unit = 'e'
+Subject length lower bound = 0
+    abXde
+ 0: abXde
+
+# This should produce an error diagnostic (\C in UTF lookbehind)
+
+/(?<=ab\Cde)X/utf
+Failed: error 136 at offset 10: \C is not allowed in a lookbehind assertion
+
+# Autopossessification tests
+
+/\C+\X \X+\C/Bx
+------------------------------------------------------------------
+        Bra
+        AllAny+
+        extuni
+        extuni+
+        AllAny
+        Ket
+        End
+------------------------------------------------------------------
+
+/\C+\X \X+\C/Bx,utf
+------------------------------------------------------------------
+        Bra
+        Anybyte+
+        extuni
+        extuni+
+        Anybyte
+        Ket
+        End
+------------------------------------------------------------------
+
+/\C\X*TӅ;\r
+{0,6}\v+\rF
+/utf
+\= Expect no match
+    Ӆ\x0a
+No match
+
+/\C(\W?ſ)'?{{/utf
+\= Expect no match
+    \\C(\\W?ſ)'?{{
+No match
+
+/X(\C{3})/utf
+    X\x{1234}
+No match
+    X\x{11234}Y
+ 0: X\x{11234}Y
+ 1: \x{11234}Y
+    X\x{11234}YZ
+ 0: X\x{11234}Y
+ 1: \x{11234}Y
+
+/X(\C{4})/utf
+    X\x{1234}YZ
+No match
+    X\x{11234}YZ
+ 0: X\x{11234}YZ
+ 1: \x{11234}YZ
+    X\x{11234}YZW
+ 0: X\x{11234}YZ
+ 1: \x{11234}YZ
+
+/X\C*/utf
+    XYZabcdce
+ 0: XYZabcdce
+
+/X\C*?/utf
+    XYZabcde
+ 0: X
+
+/X\C{3,5}/utf
+    Xabcdefg
+ 0: Xabcde
+    X\x{1234}
+No match
+    X\x{1234}YZ
+ 0: X\x{1234}YZ
+    X\x{1234}\x{512}
+No match
+    X\x{1234}\x{512}YZ
+ 0: X\x{1234}\x{512}YZ
+    X\x{11234}Y
+ 0: X\x{11234}Y
+    X\x{11234}YZ
+ 0: X\x{11234}YZ
+    X\x{11234}\x{512}
+ 0: X\x{11234}\x{512}
+    X\x{11234}\x{512}YZ
+ 0: X\x{11234}\x{512}YZ
+    X\x{11234}\x{512}\x{11234}Z
+ 0: X\x{11234}\x{512}\x{11234}
+
+/X\C{3,5}?/utf
+    Xabcdefg
+ 0: Xabc
+    X\x{1234}
+No match
+    X\x{1234}YZ
+ 0: X\x{1234}YZ
+    X\x{1234}\x{512}
+No match
+    X\x{11234}Y
+ 0: X\x{11234}Y
+    X\x{11234}YZ
+ 0: X\x{11234}Y
+    X\x{11234}\x{512}YZ
+ 0: X\x{11234}\x{512}
+    X\x{11234}
+No match
+
+/a\Cb/utf
+    aXb
+ 0: aXb
+    a\nb
+ 0: a\x{0a}b
+    a\x{100}b
+ 0: a\x{100}b
+
+/a\C\Cb/utf
+    a\x{100}b
+No match
+    a\x{12257}b
+ 0: a\x{12257}b
+    a\x{12257}\x{11234}b
+No match
+
+/ab\Cde/utf
+    abXde
+ 0: abXde
+
+# This one is here not because it's different to Perl, but because the way
+# the captured single code unit is displayed. (In Perl it becomes a character,
+# and you can't tell the difference.)
+
+/X(\C)(.*)/utf
+    X\x{1234}
+ 0: X\x{1234}
+ 1: \x{1234}
+ 2: 
+    X\nabc
+ 0: X\x{0a}abc
+ 1: \x{0a}
+ 2: abc
+
+# This one is here because Perl gives out a grumbly error message (quite
+# correctly, but that messes up comparisons).
+
+/a\Cb/utf
+\= Expect no match in 8-bit mode
+    a\x{100}b
+ 0: a\x{100}b
+
+# End of testinput22
diff --git a/testdata/testoutput22-32 b/testdata/testoutput22-32
new file mode 100644 (file)
index 0000000..91d0b05
--- /dev/null
@@ -0,0 +1,165 @@
+# Tests of \C when Unicode support is available. Note that \C is not supported
+# for DFA matching in UTF mode, so this test is not run with -dfa. The output
+# of this test is different in 8-, 16-, and 32-bit modes. Some tests may match
+# in some widths and not in others.
+
+/ab\Cde/utf,info
+Capturing subpattern count = 0
+Contains \C
+Options: utf
+First code unit = 'a'
+Last code unit = 'e'
+Subject length lower bound = 0
+    abXde
+ 0: abXde
+
+# This should produce an error diagnostic (\C in UTF lookbehind)
+
+/(?<=ab\Cde)X/utf
+Failed: error 136 at offset 10: \C is not allowed in a lookbehind assertion
+
+# Autopossessification tests
+
+/\C+\X \X+\C/Bx
+------------------------------------------------------------------
+        Bra
+        AllAny+
+        extuni
+        extuni+
+        AllAny
+        Ket
+        End
+------------------------------------------------------------------
+
+/\C+\X \X+\C/Bx,utf
+------------------------------------------------------------------
+        Bra
+        Anybyte+
+        extuni
+        extuni+
+        Anybyte
+        Ket
+        End
+------------------------------------------------------------------
+
+/\C\X*TӅ;\r
+{0,6}\v+\rF
+/utf
+\= Expect no match
+    Ӆ\x0a
+No match
+
+/\C(\W?ſ)'?{{/utf
+\= Expect no match
+    \\C(\\W?ſ)'?{{
+No match
+
+/X(\C{3})/utf
+    X\x{1234}
+No match
+    X\x{11234}Y
+No match
+    X\x{11234}YZ
+ 0: X\x{11234}YZ
+ 1: \x{11234}YZ
+
+/X(\C{4})/utf
+    X\x{1234}YZ
+No match
+    X\x{11234}YZ
+No match
+    X\x{11234}YZW
+ 0: X\x{11234}YZW
+ 1: \x{11234}YZW
+
+/X\C*/utf
+    XYZabcdce
+ 0: XYZabcdce
+
+/X\C*?/utf
+    XYZabcde
+ 0: X
+
+/X\C{3,5}/utf
+    Xabcdefg
+ 0: Xabcde
+    X\x{1234}
+No match
+    X\x{1234}YZ
+ 0: X\x{1234}YZ
+    X\x{1234}\x{512}
+No match
+    X\x{1234}\x{512}YZ
+ 0: X\x{1234}\x{512}YZ
+    X\x{11234}Y
+No match
+    X\x{11234}YZ
+ 0: X\x{11234}YZ
+    X\x{11234}\x{512}
+No match
+    X\x{11234}\x{512}YZ
+ 0: X\x{11234}\x{512}YZ
+    X\x{11234}\x{512}\x{11234}Z
+ 0: X\x{11234}\x{512}\x{11234}Z
+
+/X\C{3,5}?/utf
+    Xabcdefg
+ 0: Xabc
+    X\x{1234}
+No match
+    X\x{1234}YZ
+ 0: X\x{1234}YZ
+    X\x{1234}\x{512}
+No match
+    X\x{11234}Y
+No match
+    X\x{11234}YZ
+ 0: X\x{11234}YZ
+    X\x{11234}\x{512}YZ
+ 0: X\x{11234}\x{512}Y
+    X\x{11234}
+No match
+
+/a\Cb/utf
+    aXb
+ 0: aXb
+    a\nb
+ 0: a\x{0a}b
+    a\x{100}b
+ 0: a\x{100}b
+
+/a\C\Cb/utf
+    a\x{100}b
+No match
+    a\x{12257}b
+No match
+    a\x{12257}\x{11234}b
+ 0: a\x{12257}\x{11234}b
+
+/ab\Cde/utf
+    abXde
+ 0: abXde
+
+# This one is here not because it's different to Perl, but because the way
+# the captured single code unit is displayed. (In Perl it becomes a character,
+# and you can't tell the difference.)
+
+/X(\C)(.*)/utf
+    X\x{1234}
+ 0: X\x{1234}
+ 1: \x{1234}
+ 2: 
+    X\nabc
+ 0: X\x{0a}abc
+ 1: \x{0a}
+ 2: abc
+
+# This one is here because Perl gives out a grumbly error message (quite
+# correctly, but that messes up comparisons).
+
+/a\Cb/utf
+\= Expect no match in 8-bit mode
+    a\x{100}b
+ 0: a\x{100}b
+
+# End of testinput22
diff --git a/testdata/testoutput22-8 b/testdata/testoutput22-8
new file mode 100644 (file)
index 0000000..acb31d6
--- /dev/null
@@ -0,0 +1,169 @@
+# Tests of \C when Unicode support is available. Note that \C is not supported
+# for DFA matching in UTF mode, so this test is not run with -dfa. The output
+# of this test is different in 8-, 16-, and 32-bit modes. Some tests may match
+# in some widths and not in others.
+
+/ab\Cde/utf,info
+Capturing subpattern count = 0
+Contains \C
+Options: utf
+First code unit = 'a'
+Last code unit = 'e'
+Subject length lower bound = 0
+    abXde
+ 0: abXde
+
+# This should produce an error diagnostic (\C in UTF lookbehind)
+
+/(?<=ab\Cde)X/utf
+Failed: error 136 at offset 10: \C is not allowed in a lookbehind assertion
+
+# Autopossessification tests
+
+/\C+\X \X+\C/Bx
+------------------------------------------------------------------
+        Bra
+        AllAny+
+        extuni
+        extuni+
+        AllAny
+        Ket
+        End
+------------------------------------------------------------------
+
+/\C+\X \X+\C/Bx,utf
+------------------------------------------------------------------
+        Bra
+        Anybyte+
+        extuni
+        extuni+
+        Anybyte
+        Ket
+        End
+------------------------------------------------------------------
+
+/\C\X*TӅ;\r
+{0,6}\v+\rF
+/utf
+\= Expect no match
+    Ӆ\x0a
+No match
+
+/\C(\W?ſ)'?{{/utf
+\= Expect no match
+    \\C(\\W?ſ)'?{{
+No match
+
+/X(\C{3})/utf
+    X\x{1234}
+ 0: X\x{1234}
+ 1: \x{1234}
+    X\x{11234}Y
+ 0: X\x{f0}\x{91}\x{88}
+ 1: \x{f0}\x{91}\x{88}
+    X\x{11234}YZ
+ 0: X\x{f0}\x{91}\x{88}
+ 1: \x{f0}\x{91}\x{88}
+
+/X(\C{4})/utf
+    X\x{1234}YZ
+ 0: X\x{1234}Y
+ 1: \x{1234}Y
+    X\x{11234}YZ
+ 0: X\x{11234}
+ 1: \x{11234}
+    X\x{11234}YZW
+ 0: X\x{11234}
+ 1: \x{11234}
+
+/X\C*/utf
+    XYZabcdce
+ 0: XYZabcdce
+
+/X\C*?/utf
+    XYZabcde
+ 0: X
+
+/X\C{3,5}/utf
+    Xabcdefg
+ 0: Xabcde
+    X\x{1234}
+ 0: X\x{1234}
+    X\x{1234}YZ
+ 0: X\x{1234}YZ
+    X\x{1234}\x{512}
+ 0: X\x{1234}\x{512}
+    X\x{1234}\x{512}YZ
+ 0: X\x{1234}\x{512}
+    X\x{11234}Y
+ 0: X\x{11234}Y
+    X\x{11234}YZ
+ 0: X\x{11234}Y
+    X\x{11234}\x{512}
+ 0: X\x{11234}\x{d4}
+    X\x{11234}\x{512}YZ
+ 0: X\x{11234}\x{d4}
+    X\x{11234}\x{512}\x{11234}Z
+ 0: X\x{11234}\x{d4}
+
+/X\C{3,5}?/utf
+    Xabcdefg
+ 0: Xabc
+    X\x{1234}
+ 0: X\x{1234}
+    X\x{1234}YZ
+ 0: X\x{1234}
+    X\x{1234}\x{512}
+ 0: X\x{1234}
+    X\x{11234}Y
+ 0: X\x{f0}\x{91}\x{88}
+    X\x{11234}YZ
+ 0: X\x{f0}\x{91}\x{88}
+    X\x{11234}\x{512}YZ
+ 0: X\x{f0}\x{91}\x{88}
+    X\x{11234}
+ 0: X\x{f0}\x{91}\x{88}
+
+/a\Cb/utf
+    aXb
+ 0: aXb
+    a\nb
+ 0: a\x{0a}b
+    a\x{100}b
+No match
+
+/a\C\Cb/utf
+    a\x{100}b
+ 0: a\x{100}b
+    a\x{12257}b
+No match
+    a\x{12257}\x{11234}b
+No match
+
+/ab\Cde/utf
+    abXde
+ 0: abXde
+
+# This one is here not because it's different to Perl, but because the way
+# the captured single code unit is displayed. (In Perl it becomes a character,
+# and you can't tell the difference.)
+
+/X(\C)(.*)/utf
+    X\x{1234}
+ 0: X\x{1234}
+ 1: \x{e1}
+ 2: \x{88}\x{b4}
+    X\nabc
+ 0: X\x{0a}abc
+ 1: \x{0a}
+ 2: abc
+
+# This one is here because Perl gives out a grumbly error message (quite
+# correctly, but that messes up comparisons).
+
+/a\Cb/utf
+\= Expect no match in 8-bit mode
+    a\x{100}b
+No match
+
+# End of testinput22
diff --git a/testdata/testoutput23 b/testdata/testoutput23
new file mode 100644 (file)
index 0000000..1da1c39
--- /dev/null
@@ -0,0 +1,8 @@
+# This test is run when PCRE2 has been built with --enable-never-backslash-C,
+# which disables the use of \C. All we can do is check that it gives the 
+# correct error message.
+
+/a\Cb/
+Failed: error 185 at offset 2: using \C is disabled in this PCRE2 library
+
+# End of testinput23
index dba3fc3ea91f6c8281832f835846be87abd0d3b4..d9e8c5c1d7e3c20b8a50f4796a64bbb3bd8be236 100644 (file)
@@ -8,8 +8,7 @@
 #forbid_utf
 
 /^[\w]+/
-    *** Failers
-No match
+\= Expect no match
     École
 No match
 
@@ -18,8 +17,7 @@ No match
  0: École
 
 /^[\w]+/
-    *** Failers
-No match
+\= Expect no match
     École
 No match
 
@@ -28,30 +26,26 @@ No match
  0: \xc9
 
 /^[\W]+/locale=fr_FR
-    *** Failers
- 0: *** 
+\= Expect no match
     École
 No match
 
 /[\b]/
     \b
  0: \x08
-    *** Failers
-No match
+\= Expect no match
     a
 No match
 
 /[\b]/locale=fr_FR
     \b
  0: \x08
-    *** Failers
-No match
+\= Expect no match
     a
 No match
 
 /^\w+/
-    *** Failers
-No match
+\= Expect no match
     École
 No match
 
@@ -66,18 +60,14 @@ No match
  2: cole
 
 /(.+)\b(.+)/locale=fr_FR
-    *** Failers
- 0: *** Failers
- 1: *** 
- 2: Failers
+\= Expect no match
     École
 No match
 
 /École/i
     École
  0: \xc9cole
-    *** Failers
-No match
+\= Expect no match
     école
 No match
 
@@ -114,8 +104,7 @@ Subject length lower bound = 1
 /^[\xc8-\xc9]/
     École
  0: É
-    *** Failers 
-No match
+\= Expect no match
     école
 No match
 
index 3044e4577bcaf1aea7a7471c722fa6a68f040778..9b00be8b92162f6115e437e6221dafaefb06178f 100644 (file)
@@ -8,8 +8,7 @@
 #forbid_utf
 
 /^[\w]+/
-    *** Failers
-No match
+\= Expect no match
     École
 No match
 
@@ -18,8 +17,7 @@ No match
  0: École
 
 /^[\w]+/
-    *** Failers
-No match
+\= Expect no match
     École
 No match
 
@@ -28,30 +26,26 @@ No match
  0: \xc9
 
 /^[\W]+/locale=fr_FR
-    *** Failers
- 0: *** 
+\= Expect no match
     École
 No match
 
 /[\b]/
     \b
  0: \x08
-    *** Failers
-No match
+\= Expect no match
     a
 No match
 
 /[\b]/locale=fr_FR
     \b
  0: \x08
-    *** Failers
-No match
+\= Expect no match
     a
 No match
 
 /^\w+/
-    *** Failers
-No match
+\= Expect no match
     École
 No match
 
@@ -66,18 +60,14 @@ No match
  2: cole
 
 /(.+)\b(.+)/locale=fr_FR
-    *** Failers
- 0: *** Failers
- 1: *** 
- 2: Failers
+\= Expect no match
     École
 No match
 
 /École/i
     École
  0: \xc9cole
-    *** Failers
-No match
+\= Expect no match
     école
 No match
 
@@ -114,8 +104,7 @@ Subject length lower bound = 1
 /^[\xc8-\xc9]/
     École
  0: É
-    *** Failers 
-No match
+\= Expect no match
     école
 No match
 
index b99d6fd7d1f05dd93fe221e23016a120269e069c..b30fc5f1fff9daee59ef2e9f62a60fca2f4ebfb7 100644 (file)
@@ -8,8 +8,7 @@
 #forbid_utf
 
 /^[\w]+/
-    *** Failers
-No match
+\= Expect no match
     École
 No match
 
@@ -18,8 +17,7 @@ No match
  0: École
 
 /^[\w]+/
-    *** Failers
-No match
+\= Expect no match
     École
 No match
 
@@ -28,30 +26,26 @@ No match
  0: \xc9
 
 /^[\W]+/locale=fr_FR
-    *** Failers
- 0: *** 
+\= Expect no match
     École
 No match
 
 /[\b]/
     \b
  0: \x08
-    *** Failers
-No match
+\= Expect no match
     a
 No match
 
 /[\b]/locale=fr_FR
     \b
  0: \x08
-    *** Failers
-No match
+\= Expect no match
     a
 No match
 
 /^\w+/
-    *** Failers
-No match
+\= Expect no match
     École
 No match
 
@@ -66,18 +60,14 @@ No match
  2: cole
 
 /(.+)\b(.+)/locale=fr_FR
-    *** Failers
- 0: *** Failers
- 1: *** 
- 2: Failers
+\= Expect no match
     École
 No match
 
 /École/i
     École
  0: \xc9cole
-    *** Failers
-No match
+\= Expect no match
     école
 No match
 
@@ -114,8 +104,7 @@ Subject length lower bound = 1
 /^[\xc8-\xc9]/
     École
  0: É
-    *** Failers 
-No match
+\= Expect no match
     école
 No match
 
index e8090a9131868a82723e3fc99b35c806011aff5c..701d411ab8ec9db417693a0b7ff072bb3d98947d 100644 (file)
@@ -3,6 +3,7 @@
 # some of the property tests may differ because of different versions of
 # Unicode in use by PCRE2 and Perl.
 
+#newline_default lf anycrlf any
 #perltest
 
 /a.b/utf
@@ -12,8 +13,7 @@
  0: a\x{7f}b
     a\x{100}b
  0: a\x{100}b
-    *** Failers
-No match
+\= Expect no match
     a\nb
 No match
 
@@ -27,8 +27,7 @@ No match
     a\x{4000}\x{100}yb
  0: a\x{4000}\x{100}yb
  1: \x{4000}\x{100}y
-    *** Failers
-No match
+\= Expect no match
     a\x{4000}b
 No match
     ac\ncb
@@ -104,8 +103,7 @@ No match
     a\x{1234}\x{4321}\x{3412}b
  0: a\x{1234}\x{4321}\x{3412}b
  1: \x{1234}\x{4321}\x{3412}
-    *** Failers
-No match
+\= Expect no match
     a\x{1234}b
 No match
     ac\ncb
@@ -127,8 +125,7 @@ No match
     a\x{1234}\x{4321}\x{3412}\x{3421}b
  0: a\x{1234}\x{4321}\x{3412}\x{3421}b
  1: \x{1234}\x{4321}\x{3412}\x{3421}
-    *** Failers
-No match
+\= Expect no match
     a\x{1234}b
 No match
 
@@ -148,8 +145,7 @@ No match
     a\x{1234}\x{4321}\x{3412}\x{3421}b
  0: a\x{1234}\x{4321}\x{3412}\x{3421}b
  1: \x{1234}\x{4321}\x{3412}\x{3421}
-    *** Failers
-No match
+\= Expect no match
     a\x{1234}b
 No match
 
@@ -175,8 +171,7 @@ No match
     axxxxxbcdefghijb
  0: axxxxxb
  1: xxxxx
-    *** Failers
-No match
+\= Expect no match
     a\x{1234}b
 No match
     axxxxxxbcdefghijb
@@ -204,16 +199,14 @@ No match
     axxxxxbcdefghijb
  0: axxxxxb
  1: xxxxx
-    *** Failers
-No match
+\= Expect no match
     a\x{1234}b
 No match
     axxxxxxbcdefghijb
 No match
 
 /^[a\x{c0}]/utf
-    *** Failers
-No match
+\= Expect no match
     \x{100}
 No match
 
@@ -232,8 +225,7 @@ No match
 /(?:\x{100}){3}b/utf
     \x{100}\x{100}\x{100}b
  0: \x{100}\x{100}\x{100}b
-    *** Failers
-No match
+\= Expect no match
     \x{100}\x{100}b
 No match
 
@@ -242,8 +234,7 @@ No match
  0: \x{ab}
     \xc2\xab
  0: \x{ab}
-    *** Failers
-No match
+\= Expect no match
     \x00{ab}
 No match
 
@@ -254,8 +245,7 @@ No match
     \x{256}XYZ
  0: X
  1: \x{256}
-    *** Failers
-No match
+\= Expect no match
     XYZ
 No match
 
@@ -379,8 +369,7 @@ No match
 /\D+/utf
     12abcd34
  0: abcd
-    *** Failers
- 0: *** Failers
+\= Expect no match
     1234
 No match
 
@@ -389,8 +378,7 @@ No match
  0: abc
     12ab34
  0: ab
-    *** Failers
- 0: ***
+\= Expect no match
     1234
 No match
     12a34
@@ -401,8 +389,7 @@ No match
  0: ab
     12ab34
  0: ab
-    *** Failers
- 0: **
+\= Expect no match
     1234
 No match
     12a34
@@ -411,16 +398,13 @@ No match
 /\d+/utf
     12abcd34
  0: 12
-    *** Failers
-No match
 
 /\d{2,3}/utf
     12abcd34
  0: 12
     1234abcd
  0: 123
-    *** Failers
-No match
+\= Expect no match
     1.4
 No match
 
@@ -429,16 +413,14 @@ No match
  0: 12
     1234abcd
  0: 12
-    *** Failers
-No match
+\= Expect no match
     1.4
 No match
 
 /\S+/utf
     12abcd34
  0: 12abcd34
-    *** Failers
- 0: ***
+\= Expect no match
     \    \
 No match
 
@@ -447,8 +429,7 @@ No match
  0: 12a
     1234abcd
  0: 123
-    *** Failers
- 0: ***
+\= Expect no match
     \     \
 No match
 
@@ -457,8 +438,7 @@ No match
  0: 12
     1234abcd
  0: 12
-    *** Failers
- 0: **
+\= Expect no match
     \     \
 No match
 
@@ -466,8 +446,6 @@ No match
     12>      <34
  0: >      <
  0+ 34
-    *** Failers
-No match
 
 />\s{2,3}</utf,aftertext
     ab>  <cd
@@ -476,8 +454,7 @@ No match
     ab>   <ce
  0: >   <
  0+ ce
-    *** Failers
-No match
+\= Expect no match
     ab>    <cd
 No match
 
@@ -488,16 +465,14 @@ No match
     ab>   <ce
  0: >   <
  0+ ce
-    *** Failers
-No match
+\= Expect no match
     ab>    <cd
 No match
 
 /\w+/utf
     12      34
  0: 12
-    *** Failers
- 0: Failers
+\= Expect no match
     +++=*!
 No match
 
@@ -506,8 +481,7 @@ No match
  0: ab
     abcd ce
  0: abc
-    *** Failers
- 0: Fai
+\= Expect no match
     a.b.c
 No match
 
@@ -516,16 +490,14 @@ No match
  0: ab
     abcd ce
  0: ab
-    *** Failers
- 0: Fa
+\= Expect no match
     a.b.c
 No match
 
 /\W+/utf
     12====34
  0: ====
-    *** Failers
- 0: *** 
+\= Expect no match
     abcd
 No match
 
@@ -534,8 +506,7 @@ No match
  0: ===
     ab==cd
  0: ==
-    *** Failers
- 0: ***
+\= Expect no match
     a.b.c
 No match
 
@@ -544,8 +515,7 @@ No match
  0: ==
     ab==cd
  0: ==
-    *** Failers
- 0: **
+\= Expect no match
     a.b.c
 No match
 
@@ -556,8 +526,6 @@ No match
  0: \x{100}
     \x{100}Z
  0: \x{100}
-    *** Failers
-No match
 
 /[Z\x{100}]/utf
     Z\x{100}
@@ -566,126 +534,103 @@ No match
  0: \x{100}
     \x{100}Z
  0: \x{100}
-    *** Failers
-No match
 
 /[\x{100}\x{200}]/utf
-   ab\x{100}cd
+    ab\x{100}cd
  0: \x{100}
-   ab\x{200}cd
+    ab\x{200}cd
  0: \x{200}
-   *** Failers
-No match
 
 /[\x{100}-\x{200}]/utf
-   ab\x{100}cd
+    ab\x{100}cd
  0: \x{100}
-   ab\x{200}cd
+    ab\x{200}cd
  0: \x{200}
-   ab\x{111}cd
+    ab\x{111}cd
  0: \x{111}
-   *** Failers
-No match
 
 /[z-\x{200}]/utf
-   ab\x{100}cd
+    ab\x{100}cd
  0: \x{100}
-   ab\x{200}cd
+    ab\x{200}cd
  0: \x{200}
-   ab\x{111}cd
+    ab\x{111}cd
  0: \x{111}
-   abzcd
+    abzcd
  0: z
-   ab|cd
+    ab|cd
  0: |
-   *** Failers
-No match
 
 /[Q\x{100}\x{200}]/utf
-   ab\x{100}cd
+    ab\x{100}cd
  0: \x{100}
-   ab\x{200}cd
+    ab\x{200}cd
  0: \x{200}
-   Q?
+    Q?
  0: Q
-   *** Failers
-No match
 
 /[Q\x{100}-\x{200}]/utf
-   ab\x{100}cd
+    ab\x{100}cd
  0: \x{100}
-   ab\x{200}cd
+    ab\x{200}cd
  0: \x{200}
-   ab\x{111}cd
+    ab\x{111}cd
  0: \x{111}
-   Q?
+    Q?
  0: Q
-   *** Failers
-No match
 
 /[Qz-\x{200}]/utf
-   ab\x{100}cd
+    ab\x{100}cd
  0: \x{100}
-   ab\x{200}cd
+    ab\x{200}cd
  0: \x{200}
-   ab\x{111}cd
+    ab\x{111}cd
  0: \x{111}
-   abzcd
+    abzcd
  0: z
-   ab|cd
+    ab|cd
  0: |
-   Q?
+    Q?
  0: Q
-   *** Failers
-No match
 
 /[\x{100}\x{200}]{1,3}/utf
-   ab\x{100}cd
+    ab\x{100}cd
  0: \x{100}
-   ab\x{200}cd
+    ab\x{200}cd
  0: \x{200}
-   ab\x{200}\x{100}\x{200}\x{100}cd
+    ab\x{200}\x{100}\x{200}\x{100}cd
  0: \x{200}\x{100}\x{200}
-   *** Failers
-No match
 
 /[\x{100}\x{200}]{1,3}?/utf
-   ab\x{100}cd
+    ab\x{100}cd
  0: \x{100}
-   ab\x{200}cd
+    ab\x{200}cd
  0: \x{200}
-   ab\x{200}\x{100}\x{200}\x{100}cd
+    ab\x{200}\x{100}\x{200}\x{100}cd
  0: \x{200}
-   *** Failers
-No match
 
 /[Q\x{100}\x{200}]{1,3}/utf
-   ab\x{100}cd
+    ab\x{100}cd
  0: \x{100}
-   ab\x{200}cd
+    ab\x{200}cd
  0: \x{200}
-   ab\x{200}\x{100}\x{200}\x{100}cd
+    ab\x{200}\x{100}\x{200}\x{100}cd
  0: \x{200}\x{100}\x{200}
-   *** Failers
-No match
 
 /[Q\x{100}\x{200}]{1,3}?/utf
-   ab\x{100}cd
+    ab\x{100}cd
  0: \x{100}
-   ab\x{200}cd
+    ab\x{200}cd
  0: \x{200}
-   ab\x{200}\x{100}\x{200}\x{100}cd
+    ab\x{200}\x{100}\x{200}\x{100}cd
  0: \x{200}
-   *** Failers
-No match
 
 /(?<=[\x{100}\x{200}])X/utf
     abc\x{200}X
  0: X
     abc\x{100}X
  0: X
-    *** Failers
-No match
+\= Expect no match
     X
 No match
 
@@ -696,16 +641,14 @@ No match
  0: X
     abQX
  0: X
-    *** Failers
-No match
+\= Expect no match
     X
 No match
 
 /(?<=[\x{100}\x{200}]{3})X/utf
     abc\x{100}\x{200}\x{100}X
  0: X
-    *** Failers
-No match
+\= Expect no match
     abc\x{200}X
 No match
     X
@@ -718,8 +661,7 @@ No match
  0: \x{150}X
     \x{500}X
  0: \x{500}X
-    *** Failers
-No match
+\= Expect no match
     \x{100}X
 No match
     \x{200}X
@@ -732,8 +674,7 @@ No match
  0: \x{150}X
     \x{500}X
  0: \x{500}X
-    *** Failers
-No match
+\= Expect no match
     \x{100}X
 No match
     \x{200}X
@@ -746,8 +687,7 @@ No match
  0: AX
     \x{500}X
  0: \x{500}X
-    *** Failers
-No match
+\= Expect no match
     \x{100}X
 No match
     \x{150}X
@@ -762,8 +702,7 @@ No match
  0: Z
     \x{100}
  0: \x{100}
-    *** Failers
-No match
+\= Expect no match
     \x{102}
 No match
     y
@@ -788,22 +727,27 @@ No match
  0: \x{123}
 
 /^[ac]*b/utf
+\= Expect no match
   xb
 No match
 
 /^[ac\x{100}]*b/utf
+\= Expect no match
   xb
 No match
 
 /^[^x]*b/i,utf
+\= Expect no match
   xb
 No match
 
 /^[^x]*b/utf
+\= Expect no match
   xb
 No match
 
 /^\d*b/utf
+\= Expect no match
   xb
 No match
 
@@ -1077,10 +1021,12 @@ No match
  0: 
 
 /(abc)\1/i,utf
+\= Expect no match
    abc
 No match
 
 /(abc)\1/utf
+\= Expect no match
    abc
 No match
 
@@ -1233,30 +1179,35 @@ MK: a\x{a3}b
 /^\d*\w{4}/utf
     1234
  0: 1234
+\= Expect no match     
     123
 No match
 
 /^[^b]*\w{4}/utf
     aaaa
  0: aaaa
+\= Expect no match     
     aaa
 No match
 
 /^[^b]*\w{4}/i,utf
     aaaa
  0: aaaa
+\= Expect no match     
     aaa
 No match
 
 /^\x{100}*.{4}/utf
     \x{100}\x{100}\x{100}\x{100}
  0: \x{100}\x{100}\x{100}\x{100}
+\= Expect no match     
     \x{100}\x{100}\x{100}
 No match
 
 /^\x{100}*.{4}/i,utf
     \x{100}\x{100}\x{100}\x{100}
  0: \x{100}\x{100}\x{100}\x{100}
+\= Expect no match     
     \x{100}\x{100}\x{100}
 No match
 
@@ -1279,64 +1230,56 @@ No match
  0: \x{7f}\x{c0}\x{30f}\x{660}\x{66c}\x{f01}\x{1680}<
     \np\x{300}9!\$ < 
  0: \x{0a}p\x{300}9!$ <
-    ** Failers 
-No match
+\= Expect no match     
     ap\x{300}9!\$ < 
 No match
   
 /^\PC/utf
     X
  0: X
-    ** Failers 
- 0: *
+\= Expect no match     
     \x7f
 No match
   
 /^\PL/utf
     9
  0: 9
-    ** Failers 
- 0: *
+\= Expect no match     
     \x{c0}
 No match
   
 /^\PM/utf
     X
  0: X
-    ** Failers 
- 0: *
+\= Expect no match     
     \x{30f}
 No match
   
 /^\PN/utf
     X
  0: X
-    ** Failers 
- 0: *
+\= Expect no match     
     \x{660}
 No match
   
 /^\PP/utf
     X
  0: X
-    ** Failers 
-No match
+\= Expect no match 
     \x{66c}
 No match
   
 /^\PS/utf
     X
  0: X
-    ** Failers 
- 0: *
+\= Expect no match 
     \x{f01}
 No match
   
 /^\PZ/utf
     X
  0: X
-    ** Failers 
- 0: *
+\= Expect no match 
     \x{1680}
 No match
     
@@ -1345,40 +1288,35 @@ No match
  0: \x{17}
     \x{09f} 
  0: \x{9f}
-    ** Failers
-No match
+\= Expect no match
     \x{0600} 
 No match
   
 /^\p{Cf}/utf
     \x{601}
  0: \x{601}
-    ** Failers
-No match
+\= Expect no match
     \x{09f} 
 No match
   
 /^\p{Cn}/utf
     \x{e0000}
  0: \x{e0000}
-    ** Failers
-No match
+\= Expect no match
     \x{09f} 
 No match
   
 /^\p{Co}/utf
     \x{f8ff}
  0: \x{f8ff}
-    ** Failers
-No match
+\= Expect no match
     \x{09f} 
 No match
   
 /^\p{Ll}/utf
     a
  0: a
-    ** Failers 
-No match
+\= Expect no match 
     Z
 No match
     \x{e000}  
@@ -1387,8 +1325,7 @@ No match
 /^\p{Lm}/utf
     \x{2b0}
  0: \x{2b0}
-    ** Failers
-No match
+\= Expect no match
     a 
 No match
   
@@ -1405,8 +1342,7 @@ No match
  0: \x{4db4}
     \x{4db5}     
  0: \x{4db5}
-    ** Failers
-No match
+\= Expect no match
     a 
 No match
     \x{2b0}
@@ -1417,8 +1353,7 @@ No match
 /^\p{Lt}/utf
     \x{1c5}
  0: \x{1c5}
-    ** Failers
-No match
+\= Expect no match
     a 
 No match
     \x{2b0}
@@ -1427,16 +1362,14 @@ No match
 /^\p{Lu}/utf
     A
  0: A
-    ** Failers
-No match
+\= Expect no match
     \x{2b0}
 No match
   
 /^\p{Mc}/utf
     \x{903}
  0: \x{903}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{300}
@@ -1445,8 +1378,7 @@ No match
 /^\p{Me}/utf
     \x{488}
  0: \x{488}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{903}
@@ -1457,8 +1389,7 @@ No match
 /^\p{Mn}/utf
     \x{300}
  0: \x{300}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{903}
@@ -1471,16 +1402,14 @@ No match
  0: \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6}\x{6f7}\x{6f8}\x{6f9}
     \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d}\x{96e}\x{96f}\x{970}
  0: \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d}\x{96e}\x{96f}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
   
 /^\p{Nl}/utf
     \x{16ee}
  0: \x{16ee}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{966}
@@ -1491,8 +1420,7 @@ No match
  0: \x{b2}
     \x{b3}
  0: \x{b3}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{16ee}
@@ -1503,8 +1431,7 @@ No match
  0: _
     \x{203f}
  0: \x{203f}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     -
@@ -1517,8 +1444,7 @@ No match
  0: -
     \x{58a}
  0: \x{58a}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{203f}
@@ -1533,8 +1459,7 @@ No match
  0: }
     \x{f3b}
  0: \x{f3b}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{203f}
@@ -1553,8 +1478,7 @@ No match
  0: \x{bb}
     \x{2019}
  0: \x{2019}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{203f}
@@ -1565,8 +1489,7 @@ No match
  0: \x{ab}
     \x{2018}
  0: \x{2018}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{203f}
@@ -1577,8 +1500,7 @@ No match
  0: !
     \x{37e}
  0: \x{37e}
-    ** Failers
- 0: *
+\= Expect no match
     X
 No match
     \x{203f}
@@ -1593,8 +1515,7 @@ No match
  0: {
     \x{f3c}
  0: \x{f3c}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     )
@@ -1609,8 +1530,7 @@ No match
 /^\p{Sk}/utf
     \x{2c2}
  0: \x{2c2}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{9f2}
@@ -1619,8 +1539,7 @@ No match
 /^\p{Sm}+/utf
     +<|~\x{ac}\x{2044}
  0: +<|~\x{ac}\x{2044}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{9f2}
@@ -1631,8 +1550,7 @@ No match
  0: \x{a6}
     \x{482} 
  0: \x{482}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{9f2}
@@ -1641,8 +1559,7 @@ No match
 /^\p{Zl}/utf
     \x{2028}
  0: \x{2028}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{2029}
@@ -1651,83 +1568,80 @@ No match
 /^\p{Zp}/utf
     \x{2029}
  0: \x{2029}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{2028}
 No match
   
 /\p{Nd}+(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}\x{662}AB
  1: AB
   
 /\p{Nd}+?(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}\x{662}
  1: \x{661}\x{662}
   
 /\p{Nd}{2,}(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}\x{662}AB
  1: AB
   
 /\p{Nd}{2,}?(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}\x{662}A
  1: \x{662}A
   
 /\p{Nd}*(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}\x{662}AB
  1: AB
   
 /\p{Nd}*?(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}
  1: \x{660}\x{661}
   
 /\p{Nd}{2}(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}\x{662}A
  1: \x{662}A
   
 /\p{Nd}{2,3}(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}\x{662}AB
  1: AB
   
 /\p{Nd}{2,3}?(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}\x{662}A
  1: \x{662}A
   
 /\p{Nd}?(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}\x{662}
  1: \x{661}\x{662}
   
 /\p{Nd}??(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}
  1: \x{660}\x{661}
   
 /\p{Nd}*+(..)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}\x{662}AB
  1: AB
   
 /\p{Nd}*+(...)/utf
-      \x{660}\x{661}\x{662}ABC
+    \x{660}\x{661}\x{662}ABC
  0: \x{660}\x{661}\x{662}ABC
  1: ABC
   
 /\p{Nd}*+(....)/utf
-      ** Failers
- 0: ** F
- 1: ** F
-      \x{660}\x{661}\x{662}ABC
+\= Expect no match
+    \x{660}\x{661}\x{662}ABC
 No match
   
 /(?<=A\p{Nd})XYZ/utf
@@ -1737,8 +1651,7 @@ No match
  0: XYZ
     ABA\x{660}XYZpqr
  0: XYZ
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     XYZ     
@@ -1751,48 +1664,51 @@ No match
  0: XYZ
     XYZ 
  0: XYZ
-    ** Failers
-No match
+\= Expect no match
     WXYZ 
 No match
 
 /[\P{Nd}]+/utf
     abcd
  0: abcd
-    ** Failers
- 0: ** Failers
+\= Expect no match
     1234
 No match
 
 /\D+/utf
-    11111111111111111111111111111111111111111111111111111111111111111111111
-No match
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-     
-/\P{Nd}+/utf
+\= Expect no match
     11111111111111111111111111111111111111111111111111111111111111111111111
 No match
+     
+/\P{Nd}+/utf
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-
-/[\D]+/utf
+\= Expect no match
     11111111111111111111111111111111111111111111111111111111111111111111111
 No match
+
+/[\D]+/utf
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-
-/[\P{Nd}]+/utf
+\= Expect no match
     11111111111111111111111111111111111111111111111111111111111111111111111
 No match
+
+/[\P{Nd}]+/utf
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-
-/[\D\P{Nd}]+/utf
+\= Expect no match
     11111111111111111111111111111111111111111111111111111111111111111111111
 No match
+
+/[\D\P{Nd}]+/utf
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+    11111111111111111111111111111111111111111111111111111111111111111111111
+No match
 
 /\pL/utf
     a
@@ -1811,8 +1727,7 @@ No match
  0: A
     aZ
  0: Z
-    ** Failers
- 0: F
+\= Expect no match
     abc   
 No match
 
@@ -1821,16 +1736,14 @@ No match
  0: a
     Az
  0: z
-    ** Failers
- 0: a
+\= Expect no match
     ABC   
 No match
 
 /A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
  0: A\x{391}\x{10427}\x{ff3a}\x{1fb0}
-    ** Failers
-No match
+\= Expect no match
     a\x{391}\x{10427}\x{ff3a}\x{1fb0}   
 No match
     A\x{3b1}\x{10427}\x{ff3a}\x{1fb0}
@@ -1917,9 +1830,7 @@ No match
  2: A
 
 /^\X(.)/utf
-    *** Failers
- 0: **
- 1: *
+\= Expect no match
     A\x{300}\x{301}\x{302}
 No match
 
@@ -1964,16 +1875,14 @@ No match
 /^\p{Han}+/utf
     \x{2e81}\x{3007}\x{2f804}\x{31a0}
  0: \x{2e81}\x{3007}\x{2f804}
-    ** Failers
-No match
+\= Expect no match
     \x{2e7f}  
 No match
 
 /^\P{Katakana}+/utf
     \x{3105}
  0: \x{3105}
-    ** Failers
- 0: ** Failers
+\= Expect no match
     \x{30ff}  
 No match
 
@@ -1982,16 +1891,14 @@ No match
  0: \x{6e9}
     \x{060b}
  0: \x{60b}
-    ** Failers
-No match
+\= Expect no match
     X\x{06e9}   
 No match
 
 /^[\P{Yi}]/utf
     \x{2f800}
  0: \x{2f800}
-    ** Failers
- 0: *
+\= Expect no match
     \x{a014}
 No match
     \x{a4c6}   
@@ -2002,14 +1909,12 @@ No match
  0: AX
     \x{1234}XYZ 
  0: \x{1234}X
-    ** Failers
-No match
+\= Expect no match
     X  
 No match
     
 /^\P{Any}X/utf
-    ** Failers
-No match
+\= Expect no match
     AX
 No match
     
@@ -2020,16 +1925,14 @@ No match
  0: AX
     \x{1234}XYZ 
  0: \x{1234}X
-    ** Failers
-No match
+\= Expect no match
     ABXYZ   
 No match
 
 /^\P{Any}?X/utf
     XYZ
  0: X
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     \x{1234}XYZ 
@@ -2044,14 +1947,12 @@ No match
  0: \x{1234}X
     A\x{1234}XYZ
  0: A\x{1234}X
-    ** Failers
-No match
+\= Expect no match
     XYZ
 No match
 
 /^\P{Any}+X/utf
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     \x{1234}XYZ
@@ -2070,14 +1971,11 @@ No match
  0: \x{1234}X
     A\x{1234}XYZ
  0: A\x{1234}X
-    ** Failers
-No match
 
 /^\P{Any}*X/utf
     XYZ
  0: X
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     \x{1234}XYZ
@@ -2090,14 +1988,12 @@ No match
  0: AX
     \x{1234}XYZ 
  0: \x{1234}X
-    ** Failers
-No match
+\= Expect no match
     X  
 No match
     
 /^[\P{Any}]X/utf
-    ** Failers
-No match
+\= Expect no match
     AX
 No match
     
@@ -2108,16 +2004,14 @@ No match
  0: AX
     \x{1234}XYZ 
  0: \x{1234}X
-    ** Failers
-No match
+\= Expect no match
     ABXYZ   
 No match
 
 /^[\P{Any}]?X/utf
     XYZ
  0: X
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     \x{1234}XYZ 
@@ -2132,14 +2026,12 @@ No match
  0: \x{1234}X
     A\x{1234}XYZ
  0: A\x{1234}X
-    ** Failers
-No match
+\= Expect no match
     XYZ
 No match
 
 /^[\P{Any}]+X/utf
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     \x{1234}XYZ
@@ -2158,14 +2050,11 @@ No match
  0: \x{1234}X
     A\x{1234}XYZ
  0: A\x{1234}X
-    ** Failers
-No match
 
 /^[\P{Any}]*X/utf
     XYZ
  0: X
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     \x{1234}XYZ
@@ -2186,8 +2075,7 @@ No match
  0: \x{1234}\x{0a}\x{0d}\x{3456}x
 
 /^\P{Any}{3,5}?/utf
-    ** Failers
-No match
+\= Expect no match
     abcdefgh
 No match
     \x{1234}\n\r\x{3456}xyz 
@@ -2200,137 +2088,129 @@ No match
  0: aX
      \x{1c5}XY
  0: \x{1c5}X
-     ** Failers
-No match
-     \x{1bb}XY
+\= Expect no match
+    \x{1bb}XY
 No match
-     \x{2b0}XY
+    \x{2b0}XY
 No match
-     !XY      
+    !XY      
 No match
 
 /^[\p{L&}]X/utf
-     AXY
+    AXY
  0: AX
-     aXY
+    aXY
  0: aX
      \x{1c5}XY
  0: \x{1c5}X
-     ** Failers
-No match
-     \x{1bb}XY
+\= Expect no match
+    \x{1bb}XY
 No match
-     \x{2b0}XY
+    \x{2b0}XY
 No match
-     !XY      
+    !XY      
 No match
 
 /^\p{L&}+X/utf
-     AXY
+    AXY
  0: AX
-     aXY
+    aXY
  0: aX
-     AbcdeXyz 
+    AbcdeXyz 
  0: AbcdeX
-     \x{1c5}AbXY
+    \x{1c5}AbXY
  0: \x{1c5}AbX
-     abcDEXypqreXlmn 
+    abcDEXypqreXlmn 
  0: abcDEXypqreX
-     ** Failers
-No match
-     \x{1bb}XY
+\= Expect no match
+    \x{1bb}XY
 No match
-     \x{2b0}XY
+    \x{2b0}XY
 No match
-     !XY      
+    !XY      
 No match
 
 /^[\p{L&}]+X/utf
-     AXY
+    AXY
  0: AX
-     aXY
+    aXY
  0: aX
-     AbcdeXyz 
+    AbcdeXyz 
  0: AbcdeX
-     \x{1c5}AbXY
+    \x{1c5}AbXY
  0: \x{1c5}AbX
-     abcDEXypqreXlmn 
+    abcDEXypqreXlmn 
  0: abcDEXypqreX
-     ** Failers
-No match
-     \x{1bb}XY
+\= Expect no match
+    \x{1bb}XY
 No match
-     \x{2b0}XY
+    \x{2b0}XY
 No match
-     !XY      
+    !XY      
 No match
 
 /^\p{L&}+?X/utf
-     AXY
+    AXY
  0: AX
-     aXY
+    aXY
  0: aX
-     AbcdeXyz 
+    AbcdeXyz 
  0: AbcdeX
-     \x{1c5}AbXY
+    \x{1c5}AbXY
  0: \x{1c5}AbX
-     abcDEXypqreXlmn 
+    abcDEXypqreXlmn 
  0: abcDEX
-     ** Failers
-No match
-     \x{1bb}XY
+\= Expect no match
+    \x{1bb}XY
 No match
-     \x{2b0}XY
+    \x{2b0}XY
 No match
-     !XY      
+    !XY      
 No match
 
 /^[\p{L&}]+?X/utf
-     AXY
+    AXY
  0: AX
-     aXY
+    aXY
  0: aX
-     AbcdeXyz 
+    AbcdeXyz 
  0: AbcdeX
-     \x{1c5}AbXY
+    \x{1c5}AbXY
  0: \x{1c5}AbX
-     abcDEXypqreXlmn 
+    abcDEXypqreXlmn 
  0: abcDEX
-     ** Failers
-No match
-     \x{1bb}XY
+\= Expect no match
+    \x{1bb}XY
 No match
-     \x{2b0}XY
+    \x{2b0}XY
 No match
-     !XY      
+    !XY      
 No match
 
 /^\P{L&}X/utf
-     !XY
+    !XY
  0: !X
-     \x{1bb}XY
+    \x{1bb}XY
  0: \x{1bb}X
-     \x{2b0}XY
+    \x{2b0}XY
  0: \x{2b0}X
-     ** Failers
-No match
-     \x{1c5}XY
+\= Expect no match
+    \x{1c5}XY
 No match
-     AXY      
+    AXY      
 No match
 
 /^[\P{L&}]X/utf
-     !XY
+    !XY
  0: !X
-     \x{1bb}XY
+    \x{1bb}XY
  0: \x{1bb}X
-     \x{2b0}XY
+    \x{2b0}XY
  0: \x{2b0}X
-     ** Failers
-No match
-     \x{1c5}XY
+\= Expect no match
+    \x{1c5}XY
 No match
-     AXY      
+    AXY      
 No match
 
 /^(\p{Z}[^\p{C}\p{Z}]+)*$/
@@ -2362,15 +2242,18 @@ No match
  0: abc\xc4
 
 /\X{1,3}\d/
-  \x8aBCD
+\= Expect no match
+    \x8aBCD
 No match
   
 /\X?\d/
-  \x8aBCD 
+\= Expect no match
+    \x8aBCD 
 No match
 
 /\P{L}?\d/
-  \x8aBCD 
+\= Expect no match
+    \x8aBCD 
 No match
 
 /[\PPP\x8a]{1,}\x80/
@@ -2410,8 +2293,7 @@ No match
  0: \x{6ef}
     \x{6fa}  
  0: \x{6fa}
-    ** Failers
-No match
+\= Expect no match
     \x{650}
 No match
     \x{651}  
@@ -2450,8 +2332,7 @@ No match
  0: \x{655}
     \x{200c} 
  0: \x{200c}
-    ** Failers
-No match
+\= Expect no match
     \x{64a}
 No match
     \x{656}     
@@ -2478,8 +2359,7 @@ No match
  0: \x{104a0}
     \x{104a9}
  0: \x{104a9}
-    ** Failers
-No match
+\= Expect no match
     \x{1049e}
 No match
     \x{1049f}
@@ -2500,8 +2380,7 @@ No match
 /\x{a77d}\x{1d79}/utf
     \x{a77d}\x{1d79}
  0: \x{a77d}\x{1d79}
-    ** Failers 
-No match
+\= Expect no match 
     \x{1d79}\x{a77d} 
 No match
 
@@ -2604,14 +2483,12 @@ No match
  0: .+\x{a1}
 
 /\p{Zs}*?\R/
-    ** Failers
-No match
+\= Expect no match
     a\xFCb   
 No match
 
 /\p{Zs}*\R/
-    ** Failers 
-No match
+\= Expect no match 
     a\xFCb   
 No match
 
@@ -2804,11 +2681,12 @@ No match
  0+ 
 
 /\X*Z/utf,no_start_optimize
-  A\x{300}
+\= Expect no match
+    A\x{300}
 No match
 
 /\X*(.)/utf,no_start_optimize
-  A\x{1111}\x{ae4c}\x{1169}
+    A\x{1111}\x{ae4c}\x{1169}
  0: A\x{1111}
  1: \x{1111}
 
@@ -3400,12 +3278,14 @@ No match
 /^\p{Any}*\d{4}/utf
     1234
  0: 1234
+\= Expect no match
     123 
 No match
 
 /^\X*\w{4}/utf
     1234
  0: 1234
+\= Expect no match
     123  
 No match
 
@@ -3454,8 +3334,7 @@ No match
  0: \x{e0001}
     \x{e0020}\x{e0030}\x{e0040}\x{e0050}\x{e0060}\x{e0070}\x{e007f}
  0: \x{e0020}\x{e0030}\x{e0040}\x{e0050}\x{e0060}\x{e0070}\x{e007f}
-    ** Failers
-No match
+\= Expect no match
     \x{09}
 No match
     \x{0a}
@@ -3532,8 +3411,7 @@ No match
  0: \x{e0001}
     \x{e0020}\x{e0030}\x{e0040}\x{e0050}\x{e0060}\x{e0070}\x{e007f}
  0: \x{e0020}\x{e0030}\x{e0040}\x{e0050}\x{e0060}\x{e0070}\x{e007f}
-    ** Failers
- 0: ** Failers
+\= Expect no match
     \x{09}
 No match
     \x{1D}
@@ -3562,8 +3440,7 @@ No match
  0: \x{a1}\x{a7}
     \x{37e} 
  0: \x{37e}
-    ** Failers
-No match
+\= Expect no match
     abcde  
 No match
 
@@ -3574,8 +3451,7 @@ No match
  0: \x{2028}\x{2029}\x{202f}\x{2065}
     \x{3000}\x{e0002}\x{e001f}\x{e0080}
  0: \x{3000}\x{e0002}\x{e001f}\x{e0080}
-    ** Failers
-No match
+\= Expect no match
     Letter:ABC
 No match
     Mark:\x{300}\x{1d172}\x{1d17b}
@@ -3614,8 +3490,7 @@ No match
  0: \x{09}\x{1d}\x{85}\x{2028}\x{2029}\x{2065}
     \x{e0002}\x{e001f}\x{e0080}
  0: \x{e0002}\x{e001f}\x{e0080}
-    ** Failers
-No match
+\= Expect no match
     Space: \x{a0}
 No match
     \x{1680}\x{2000}\x{2001}\x{2002}\x{2003}\x{2004}\x{2005}
@@ -3664,8 +3539,7 @@ No match
 /^[[:^punct:]]+$/utf,ucp
     abcde  
  0: abcde
-    ** Failers
-No match
+\= Expect no match
     \$+<=>^`|~
 No match
     !\"#%&'()*,-./:;?@[\\]_{}
@@ -3730,6 +3604,7 @@ No match
  2: \x{23a}\x{2c65}\x{23a}
 
 /^(\x{23a})\1*(....)/i,utf
+\= Expect no match
     \x{23a}\x{2c65}\x{2c65}\x{2c65}
 No match
     \x{23a}\x{23a}\x{2c65}\x{23a}
@@ -3741,14 +3616,91 @@ No match
 
 "[\S\V\H]"utf
 
-/\C\X*TӅ;\r
-{0,6}\v+\rF
-/utf
-    Ӆ\x0a
+/[^\p{Any}]*+x/utf
+    x
+ 0: x
+
+/[[:punct:]]/utf,ucp
+    \x{b4} 
+No match
+
+/[[:^ascii:]]/utf,ucp
+    \x{100}
+ 0: \x{100}
+    \x{200}
+ 0: \x{200}
+    \x{300}
+ 0: \x{300}
+    \x{37e}
+ 0: \x{37e}
+\= Expect no match     
+    aa
+No match
+    99
+No match
+    
+/[[:^ascii:]\w]/utf,ucp
+    aa
+ 0: a
+    99
+ 0: 9
+    gg
+ 0: g
+    \x{100}
+ 0: \x{100}
+    \x{200}
+ 0: \x{200}
+    \x{300}
+ 0: \x{300}
+    \x{37e}
+ 0: \x{37e}
+
+/[\w[:^ascii:]]/utf,ucp
+    aa
+ 0: a
+    99
+ 0: 9
+    gg
+ 0: g
+    \x{100}
+ 0: \x{100}
+    \x{200}
+ 0: \x{200}
+    \x{300}
+ 0: \x{300}
+    \x{37e}
+ 0: \x{37e}
+
+/[^[:ascii:]\W]/utf,ucp
+    \x{100}
+ 0: \x{100}
+    \x{200}
+ 0: \x{200}
+\= Expect no match     
+    aa
+No match
+    99
+No match
+    gg
+No match
+    \x{37e}
 No match
 
-/\C(\W?ſ)'?{{/utf
-    \\C(\\W?ſ)'?{{
+/[^[:^ascii:]\d]/utf,ucp
+    a
+ 0: a
+    ~
+ 0: ~
+    \a
+ 0: \x{07}
+    \x{7f}
+ 0: \x{7f}
+\= Expect no match
+    0
+No match
+    \x{389}
+No match
+    \x{20ac}
 No match
 
 # End of testinput4
index a99c12b8bfc477c26d312bef87050482e801672f..f19ad8ca5c45e8ddcfb9529df09c4f01f5e9c87b 100644 (file)
 # test 4.
 
 /^[\p{Arabic}]/utf
-    ** Failers
-No match
+\= Expect no match
     \x{061c}
 No match
     
 /^[[:graph:]]+$/utf,ucp
-    ** Failers
-No match
+\= Expect no match
     \x{61c}
 No match
     \x{2066}
@@ -31,8 +29,7 @@ No match
 No match
 
 /^[[:print:]]+$/utf,ucp
-    ** Failers
- 0: ** Failers
+\= Expect no match
     \x{61c}
 No match
     \x{2066}
@@ -76,6 +73,7 @@ No match
  0: A\x{85}\x{2005}Z
     
 /^[[:graph:]]+$/utf,ucp
+\= Expect no match
     \x{180e}
 No match
 
@@ -88,6 +86,7 @@ No match
  0: \x{09}\x{0a}\x{1d} \x{85}\x{a0}\x{61c}\x{1680}\x{180e}
 
 /^[[:^print:]]+$/utf,ucp
+\= Expect no match
     \x{180e}
 No match
 
@@ -182,10 +181,6 @@ Subject length lower bound = 3
     \x{212ab}\x{212ab}\x{212ab}\x{861}
  0: \x{212ab}\x{212ab}\x{212ab}
 
-/(?<=\C)X/utf
-Failed: error 136 at offset 6: \C is not allowed in a lookbehind assertion
-    Should produce an error diagnostic
-    
 /^[ab]/IB,utf
 ------------------------------------------------------------------
         Bra
@@ -200,8 +195,7 @@ Overall options: anchored utf
 Subject length lower bound = 1
     bar
  0: b
-    *** Failers
-No match
+\= Expect no match
     c
 No match
     \x{ff}
@@ -227,8 +221,7 @@ Subject length lower bound = 1
  0: \x{ff}
     \x{100}  
  0: \x{100}
-    *** Failers 
- 0: *
+\= Expect no match 
     aaa
 No match
   
@@ -251,8 +244,7 @@ No match
     \x{100}\x{100}"12" 
  0: \x{100}\x{100}"12"
  1: "12"
-    *** Failers 
-No match
+\= Expect no match 
     \x{100}\x{100}abcd
 No match
 
@@ -303,8 +295,7 @@ Failed: error 108 at offset 15: range out of order in character class
  0: \x{100}
     \x{104}
  0: \x{104}
-    *** Failers
-No match
+\= Expect no match
     \x{105}
 No match
     \x{ff}    
@@ -581,8 +572,7 @@ Matched, but too many substrings
  0: a\x{2028}b
     a\x{2029}b 
  0: a\x{2029}b
-    ** Failers
-No match
+\= Expect no match
     a\n\rb    
 No match
 
@@ -623,8 +613,7 @@ No match
  0: a\x{0a}\x{0d}b
     a\n\r\x{85}\x0cb 
  0: a\x{0a}\x{0d}\x{85}\x{0c}b
-    ** Failers
-No match
+\= Expect no match
     ab  
 No match
 
@@ -643,8 +632,7 @@ No match
  0: a\x{0a}\x{0d}\x{0a}\x{0d}b
     a\n\n\r\nb 
  0: a\x{0a}\x{0a}\x{0d}\x{0a}b
-    ** Failers
-No match
+\= Expect no match
     a\n\n\n\rb
 No match
     a\r
@@ -655,8 +643,7 @@ No match
  0: X X\x{0a}
     X\x09X\x0b
  0: X\x{09}X\x{0b}
-    ** Failers
-No match
+\= Expect no match
     \x{a0} X\x0a   
 No match
     
@@ -667,8 +654,7 @@ No match
  0: \x{09} \x{a0}\x{0a}\x{0b}\x{0c}\x{0d}
     \x09\x20\x{a0}\x0a\x0b\x0c
  0: \x{09} \x{a0}\x{0a}\x{0b}\x{0c}
-    ** Failers 
-No match
+\= Expect no match 
     \x09\x20\x{a0}\x0a\x0b
 No match
      
@@ -677,8 +663,7 @@ No match
  0: \x{3001}\x{3000}\x{2030}\x{2028}
     X\x{180e}X\x{85}
  0: X\x{180e}X\x{85}
-    ** Failers
-No match
+\= Expect no match
     \x{2009} X\x0a   
 No match
     
@@ -689,8 +674,7 @@ No match
  0: \x{09}\x{205f}\x{a0}\x{0a}\x{2029}\x{0c}\x{2028}
     \x09\x20\x{202f}\x0a\x0b\x0c
  0: \x{09} \x{202f}\x{0a}\x{0b}\x{0c}
-    ** Failers 
-No match
+\= Expect no match 
     \x09\x{200a}\x{a0}\x{2028}\x0b
 No match
      
@@ -755,8 +739,7 @@ Subject length lower bound = 3
  0: a\x{0a}b
     a\r\nb
  0: a\x{0d}\x{0a}b
-    ** Failers
-No match
+\= Expect no match
     a\x{85}b
 No match
     a\x0bb     
@@ -793,8 +776,7 @@ Subject length lower bound = 2
  0: a\x{0a}b
     a\r\nb
  0: a\x{0d}\x{0a}b
-    ** Failers
-No match
+\= Expect no match
     a\x{85}b
 No match
     a\x0bb     
@@ -817,14 +799,11 @@ Subject length lower bound = 2
  0: a\x{85}b
     a\x0bb     
  0: a\x{0b}b
-    ** Failers 
-No match
  
 /.*a.*=.b.*/utf,newline=any
     QQQ\x{2029}ABCaXYZ=!bPQR
  0: ABCaXYZ=!bPQR
-    ** Failers
-No match
+\= Expect no match
     a\x{2029}b
 No match
     \x61\xe2\x80\xa9\x62 
@@ -838,8 +817,7 @@ Failed: error 130 at offset 3: unknown POSIX class name
  0: a\x{1234}b
     a\nb 
  0: a\x{0a}b
-    ** Failers
-No match
+\= Expect no match
     ab  
 No match
     
@@ -848,8 +826,7 @@ No match
  0: aXb
     a\nX\nX\x{1234}b 
  0: a\x{0a}X\x{0a}X\x{1234}b
-    ** Failers
-No match
+\= Expect no match
     ab  
 No match
 
@@ -935,6 +912,7 @@ Partial match: X\x{123}\x{123}\x{123}
 Partial match: X\x{123}\x{123}\x{123}\x{123}
     
 /X\x{123}{2,4}b/utf
+\= Expect no match
     Xx\=ps
 No match
     X\x{123}x\=ps
@@ -947,6 +925,7 @@ No match
 No match
     
 /X\x{123}{2,4}?b/utf
+\= Expect no match
     Xx\=ps
 No match
     X\x{123}x\=ps
@@ -959,6 +938,7 @@ No match
 No match
     
 /X\x{123}{2,4}+b/utf
+\= Expect no match
     Xx\=ps
 No match
     X\x{123}x\=ps
@@ -1745,6 +1725,7 @@ Last code unit = 'y'
 Subject length lower bound = 2
 
 /(?<!^)ETA/utf
+\= Expect no match
     ETA
 No match
 
@@ -1874,8 +1855,7 @@ Subject length lower bound = 1
  0: 12-34
     12+\x{661}-34  
  0: 12+\x{661}-34
-    ** Failers
-No match
+\= Expect no match
     abcd  
 No match
 
@@ -1995,8 +1975,7 @@ No match
 /^\p{Cs}/utf
     \x{dfff}\=no_utf_check
  0: \x{dfff}
-    ** Failers
-No match
+\= Expect no match
     \x{09f} 
 No match
   
@@ -2021,8 +2000,7 @@ No match
  0: $\x{a2}\x{a3}\x{a4}\x{a5}
     \x{9f2}
  0: \x{9f2}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{2c2}
@@ -2039,8 +2017,7 @@ No match
  0: \x{2000}
     \x{2001}     
  0: \x{2001}
-    ** Failers
-No match
+\= Expect no match
     \x{2028}
 No match
     \x{200d} 
@@ -2052,16 +2029,14 @@ No match
 /\p{^Lu}/i,utf
     1234
  0: 1
-    ** Failers
- 0: *
+\= Expect no match
     ABC 
 No match
 
 /\P{Lu}/i,utf
     1234
  0: 1
-    ** Failers
- 0: *
+\= Expect no match
     ABC 
 No match
 
@@ -2070,8 +2045,7 @@ No match
  0: a
     Az
  0: z
-    ** Failers
- 0: a
+\= Expect no match
     ABC   
 No match
 
@@ -2080,8 +2054,7 @@ No match
  0: A
     a\x{10a0}B 
  0: \x{10a0}
-    ** Failers 
- 0: F
+\= Expect no match 
     a
 No match
     \x{1d00}  
@@ -2092,8 +2065,7 @@ No match
  0: A
     aZ
  0: Z
-    ** Failers
- 0: F
+\= Expect no match
     abc   
 No match
 
@@ -2182,16 +2154,14 @@ No match
  0: \x{a6c}
     \x{10a7}   
  0: \x{10a7}
-    ** Failers
-No match
+\= Expect no match
     _ABC   
 No match
 
 /^\p{Xan}+/utf
     ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  0: ABCD1234\x{6ca}\x{a6c}\x{10a7}
-    ** Failers
-No match
+\= Expect no match
     _ABC   
 No match
 
@@ -2222,16 +2192,14 @@ No match
  0: \x{a6c}
     \x{10a7}   
  0: \x{10a7}
-    ** Failers
-No match
+\= Expect no match
     _ABC   
 No match
  
 /^[\p{Xan}]+/utf
     ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  0: ABCD1234\x{6ca}\x{a6c}\x{10a7}
-    ** Failers
-No match
+\= Expect no match
     _ABC   
 No match
 
@@ -2240,8 +2208,7 @@ No match
  0: >\x{1680}
     >\x{a0} 
  0: >\x{a0}
-    ** Failers
-No match
+\= Expect no match
     \x{0b} 
 No match
 
@@ -2278,8 +2245,7 @@ No match
  0: >\x{1680}
     >\x{a0} 
  0: >\x{a0}
-    ** Failers
-No match
+\= Expect no match
     \x{0b} 
 No match
 
@@ -2324,8 +2290,7 @@ No match
  0: \x{10a7}
     _ABC    
  0: _
-    ** Failers
-No match
+\= Expect no match
     [] 
 No match
 
@@ -2362,8 +2327,7 @@ No match
  0: \x{10a7}
     _ABC 
  0: _
-    ** Failers
-No match
+\= Expect no match
     []   
 No match
  
@@ -2630,8 +2594,7 @@ No match
 /\b...\B/utf
     abc_
  0: abc
-    ** Failers 
- 0: Fai
+\= Expect no match 
     \x{37e}abc\x{376} 
 No match
     \x{37e}\x{376}\x{371}\x{393}\x{394} 
@@ -2825,10 +2788,12 @@ No match
 # These behaved oddly in Perl, so they are kept in this test 
 
 /(\x{23a}\x{23a}\x{23a})?\1/i,utf
+\= Expect no match
     \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}
 No match
 
 /(ȺȺȺ)?\1/i,utf
+\= Expect no match
     ȺȺȺⱥⱥ
 No match
 
@@ -2843,10 +2808,12 @@ No match
  1: \x{23a}\x{23a}\x{23a}
 
 /(\x{23a}\x{23a}\x{23a})\1/i,utf
+\= Expect no match
     \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}
 No match
 
 /(ȺȺȺ)\1/i,utf
+\= Expect no match
     ȺȺȺⱥⱥ
 No match
 
@@ -2887,8 +2854,7 @@ No match
  0: \x{1bc0}
     \x{1bff}
  0: \x{1bff}
-    ** Failers
-No match
+\= Expect no match
     \x{1bf4}
 No match
     
@@ -2897,8 +2863,7 @@ No match
  0: \x{11000}
     \x{1106f}
  0: \x{1106f}
-    ** Failers
-No match
+\= Expect no match
     \x{1104e}
 No match
     
@@ -2907,8 +2872,7 @@ No match
  0: \x{840}
     \x{85e}
  0: \x{85e}
-    ** Failers
-No match
+\= Expect no match
     \x{85c}
 No match
     \x{85d}    
@@ -2933,14 +2897,10 @@ No match
 /^a\X41z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
     aX41z
  0: aX41z
-    *** Failers
-No match
+\= Expect no match
     aAz
 No match
 
-/(?<=ab\Cde)X/utf
-Failed: error 136 at offset 10: \C is not allowed in a lookbehind assertion
-
 /\X/
     a\=ps
  0: a
@@ -3138,8 +3098,7 @@ Subject length lower bound = 3
  0+ 
 
 /\x{3a3}++./i,utf,aftertext
-    ** Failers
-No match
+\= Expect no match
     \x{3a3}\x{3c3}\x{3c2}\x{3a3}\x{3c3}\x{3c2}
 No match
 
@@ -3179,24 +3138,29 @@ No match
         Ket
         End
 ------------------------------------------------------------------
+\= Expect no match
     ikt
 No match
 
 /is+t/i,utf
     iSs\x{17f}t
  0: iSs\x{17f}t
+\= Expect no match
     ikt
 No match
 
 /is+?t/i,utf
+\= Expect no match
     ikt
 No match
 
 /is?t/i,utf
+\= Expect no match
     ikt
 No match
 
 /is{2}t/i,utf
+\= Expect no match
     iskt
 No match
     
@@ -3211,80 +3175,70 @@ No match
  0: `
     \x{1234}abc
  0: \x{1234}
-    ** Failers
-No match
+\= Expect no match
     abc     
 No match
 
 /^\p{Xuc}+/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $@`\x{a0}\x{1234}\x{e000}
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^\p{Xuc}+?/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^\p{Xuc}+?\*/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $@`\x{a0}\x{1234}\x{e000}*
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^\p{Xuc}++/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $@`\x{a0}\x{1234}\x{e000}
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^\p{Xuc}{3,5}/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $@`\x{a0}\x{1234}
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^\p{Xuc}{3,5}?/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $@`
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^[\p{Xuc}]/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^[\p{Xuc}]+/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $@`\x{a0}\x{1234}\x{e000}
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^\P{Xuc}/utf
     abc
  0: a
-    ** Failers
- 0: *
+\= Expect no match
     $abc
 No match
     @abc
@@ -3297,8 +3251,7 @@ No match
 /^[\P{Xuc}]/utf
     abc
  0: a
-    ** Failers
- 0: *
+\= Expect no match
     $abc
 No match
     @abc
@@ -3843,7 +3796,7 @@ No match
         End
 ------------------------------------------------------------------
 
-/\D+\X \d+\X \S+\X \s+\X \W+\X \w+\X \C+\X \R+\X \H+\X \h+\X \V+\X \v+\X a+\X \n+\X .+\X/Bx
+/\D+\X \d+\X \S+\X \s+\X \W+\X \w+\X \R+\X \H+\X \h+\X \V+\X \v+\X a+\X \n+\X .+\X/Bx
 ------------------------------------------------------------------
         Bra
         \D+
@@ -3858,8 +3811,6 @@ No match
         extuni
         \w+
         extuni
-        AllAny+
-        extuni
         \R+
         extuni
         \H+
@@ -3898,7 +3849,7 @@ No match
         End
 ------------------------------------------------------------------
 
-/\X+\D \X+\d \X+\S \X+\s \X+\W \X+\w \X+. \X+\C \X+\R \X+\H \X+\h \X+\V \X+\v \X+\X \X+\Z \X+\z \X+$/Bx
+/\X+\D \X+\d \X+\S \X+\s \X+\W \X+\w \X+. \X+\R \X+\H \X+\h \X+\V \X+\v \X+\X \X+\Z \X+\z \X+$/Bx
 ------------------------------------------------------------------
         Bra
         extuni+
@@ -3916,8 +3867,6 @@ No match
         extuni+
         Any
         extuni+
-        AllAny
-        extuni+
         \R
         extuni+
         \H
@@ -4003,12 +3952,9 @@ Subject length lower bound = 1
  1: 123X\x{1234}Z123
 
 /(?<=abc)(|def)/g,utf,replace=<$0>
-      123abcáyzabcdef789abcሴqr
+    123abcáyzabcdef789abcሴqr
  4: 123abc<>\x{e1}yzabc<><def>789abc<>\x{1234}qr
 
-/[^\xff]((?1))/utf,debug
-Failed: error 140 at offset 11: recursion could loop indefinitely
-
 /[A-`]/iB,utf
 ------------------------------------------------------------------
         Bra
@@ -4050,4 +3996,169 @@ Failed: error 122 at offset 1227: unmatched closing parenthesis
 
 /$(&.+[\p{Me}].\s\xdcC*?(?(<y>))(?<!^)$C((;*?(R))+(?(R)){0,6}?|){12\x8a\X*?\x8a\x0b\xd1^9\3*+(\xc1,\k'P'\xb4)\xcc(z\z(?JJ)(?'X'8};(\x0b\xd1^9\?'3*+(\xc1.]k+\x0b'Pm'\xb4\xcc4'\xd1'(?'X'))?-%--\x95$9*\4'|\xd1(''%\x95*$9)#(?'R')3\x07?('P\xed')\\x16:;()\x1e\x10*:(?<y>)\xd1+!~:(?)''(d'E:yD!\s(?'R'\x1e;\x10:U))|')g!\xb0*){29+))#(?'P'})*?/
 
+"(*UTF)(*UCP)(.UTF).+X(\V+;\^(\D|)!999}(?(?C{7(?C')\H*\S*/^\x5\xa\\xd3\x85n?(;\D*(?m).[^mH+((*UCP)(*U:F)})(?!^)(?'"
+Failed: error 124 at offset 113: letter or underscore expected after (?< or (?'
+
+/[\pS#moq]/
+    =
+ 0: =
+
+/(*:a\x{12345}b\t(d\)c)xxx/utf,alt_verbnames,mark
+    cxxxz
+ 0: xxx
+MK: a\x{12345}b\x{09}(d)c
+
+/abcd/utf,replace=x\x{824}y\o{3333}z(\Q12\$34$$\x34\E5$$),substitute_extended
+    abcd
+ 1: x\x{824}y\x{6db}z(12\$34$$\x345$)
+
+/a(\x{e0}\x{101})(\x{c0}\x{102})/utf,replace=a\u$1\U$1\E$1\l$2\L$2\Eab\U\x{e0}\x{101}\L\x{d0}\x{160}\EDone,substitute_extended
+    a\x{e0}\x{101}\x{c0}\x{102}
+ 1: a\x{c0}\x{101}\x{c0}\x{100}\x{e0}\x{101}\x{e0}\x{102}\x{e0}\x{103}ab\x{c0}\x{100}\x{f0}\x{161}Done
+
+/((?<digit>\d)|(?<letter>\p{L}))/g,substitute_extended,replace=<${digit:+digit; :not digit; }${letter:+letter:not a letter}>
+    ab12cde
+ 7: <not digit; letter><not digit; letter><digit; not a letter><digit; not a letter><not digit; letter><not digit; letter><not digit; letter>
+
+/[\W\p{Any}]/B
+------------------------------------------------------------------
+        Bra
+        [\x00-/:-@[-^`{-\xff\p{Any}]
+        Ket
+        End
+------------------------------------------------------------------
+    abc
+ 0: a
+    123 
+ 0: 1
+
+/[\W\pL]/B
+------------------------------------------------------------------
+        Bra
+        [\x00-/:-@[-^`{-\xff\p{L}]
+        Ket
+        End
+------------------------------------------------------------------
+    abc
+ 0: a
+\= Expect no match
+    123     
+No match
+
+/(*UCP)(*UTF)[[:>:]]X/B
+------------------------------------------------------------------
+        Bra
+        \b
+        AssertB
+        Reverse
+        prop Xwd
+        Ket
+        X
+        Ket
+        End
+------------------------------------------------------------------
+
+/abc/utf,replace=xyz
+    abc\=zero_terminate
+ 1: xyz
+
+/a[[:punct:]b]/ucp,bincode
+------------------------------------------------------------------
+        Bra
+        a
+        [b[:punct:]]
+        Ket
+        End
+------------------------------------------------------------------
+
+/a[[:punct:]b]/utf,ucp,bincode
+------------------------------------------------------------------
+        Bra
+        a
+        [b[:punct:]]
+        Ket
+        End
+------------------------------------------------------------------
+
+/a[b[:punct:]]/utf,ucp,bincode
+------------------------------------------------------------------
+        Bra
+        a
+        [b[:punct:]]
+        Ket
+        End
+------------------------------------------------------------------
+
+/[[:^ascii:]]/utf,ucp,bincode
+------------------------------------------------------------------
+        Bra
+        [\x80-\xff] (neg)
+        Ket
+        End
+------------------------------------------------------------------
+
+/[[:^ascii:]\w]/utf,ucp,bincode
+------------------------------------------------------------------
+        Bra
+        [\x80-\xff\p{Xwd}\x{100}-\x{10ffff}]
+        Ket
+        End
+------------------------------------------------------------------
+
+/[\w[:^ascii:]]/utf,ucp,bincode
+------------------------------------------------------------------
+        Bra
+        [\x80-\xff\p{Xwd}\x{100}-\x{10ffff}]
+        Ket
+        End
+------------------------------------------------------------------
+
+/[^[:ascii:]\W]/utf,ucp,bincode
+------------------------------------------------------------------
+        Bra
+        [^\x00-\x7f\P{Xwd}]
+        Ket
+        End
+------------------------------------------------------------------
+    \x{de}
+ 0: \x{de}
+    \x{200}
+ 0: \x{200}
+\= Expect no match     
+    \x{300}
+No match
+    \x{37e}
+No match
+
+/[[:^ascii:]a]/utf,ucp,bincode
+------------------------------------------------------------------
+        Bra
+        [a\x80-\xff] (neg)
+        Ket
+        End
+------------------------------------------------------------------
+
+/L(?#(|++<!(2)?/B,utf,no_auto_possess,auto_callout
+------------------------------------------------------------------
+        Bra
+        Callout 255 0 14
+        L?
+        Callout 255 14 0
+        Ket
+        End
+------------------------------------------------------------------
+
+/L(?#(|++<!(2)?/B,utf,ucp,auto_callout
+------------------------------------------------------------------
+        Bra
+        Callout 255 0 14
+        L?+
+        Callout 255 14 0
+        Ket
+        End
+------------------------------------------------------------------
+
+/(*UTF)C\x09((?<!'(?x)!*H? #\xcc\x9a[^$]/
+Failed: error 114 at offset 39: missing closing parenthesis
+
 # End of testinput5 
index 0fef1246e25e33101d53ba92c018bb672683b13d..9ae092b35bd3dfcb1a017434308d23880fc3de77 100644 (file)
@@ -4,6 +4,7 @@
     
 #forbid_utf
 #subject dfa
+#newline_default lf anycrlf any
      
 /abc/
     abc
@@ -22,8 +23,7 @@
  0: abc
     abbbbbbc
  0: abbbbbbc
-    *** Failers 
-No match
+\= Expect no match 
     ac
 No match
     ab
@@ -78,8 +78,7 @@ Matched, but offsets vector is too small to show all matches
 /^abc/
     abcdef
  0: abc
-    *** Failers
-No match
+\= Expect no match
     xyzabc
 No match
     xyz\nabc    
@@ -90,16 +89,14 @@ No match
  0: abc
     xyz\nabc    
  0: abc
-    *** Failers
-No match
+\= Expect no match
     xyzabc
 No match
     
 /\Aabc/
     abcdef
  0: abc
-    *** Failers
-No match
+\= Expect no match
     xyzabc
 No match
     xyz\nabc    
@@ -108,8 +105,7 @@ No match
 /\Aabc/m
     abcdef
  0: abc
-    *** Failers
-No match
+\= Expect no match
     xyzabc
 No match
     xyz\nabc    
@@ -120,8 +116,7 @@ No match
  0: abc
     xyzabc\=offset=3
  0: abc
-    *** Failers
-No match
+\= Expect no match
     xyzabc    
 No match
     xyzabc\=offset=2
@@ -132,8 +127,7 @@ No match
  0: x9yzz
     x0y+z
  0: x0y+z
-    *** Failers
-No match
+\= Expect no match
     xyz
 No match
     xxy0z     
@@ -144,8 +138,7 @@ No match
  0: x yzz
     x y+z
  0: x y+z
-    *** Failers
-No match
+\= Expect no match
     xyz
 No match
     xxyyz
@@ -154,8 +147,7 @@ No match
 /x\wy\Wz/
     xxy+z
  0: xxy+z
-    *** Failers
-No match
+\= Expect no match
     xxy0z
 No match
     x+y+z         
@@ -166,8 +158,7 @@ No match
  0: x+y
     x-y
  0: x-y
-    *** Failers
-No match
+\= Expect no match
     x\ny
 No match
     
@@ -186,8 +177,7 @@ No match
  0: a+bc\x0adp+q
     x\nyp+q 
  0: x\x0ayp+q
-    *** Failers 
-No match
+\= Expect no match 
     a\nbc\ndp+q
 No match
     a+bc\ndp\nq
@@ -198,8 +188,7 @@ No match
 /a\d\z/
     ba0
  0: a0
-    *** Failers
-No match
+\= Expect no match
     ba0\n
 No match
     ba0\ncd   
@@ -208,8 +197,7 @@ No match
 /a\d\z/m
     ba0
  0: a0
-    *** Failers
-No match
+\= Expect no match
     ba0\n
 No match
     ba0\ncd   
@@ -220,8 +208,7 @@ No match
  0: a0
     ba0\n
  0: a0
-    *** Failers
-No match
+\= Expect no match
     ba0\ncd   
 No match
 
@@ -230,8 +217,7 @@ No match
  0: a0
     ba0\n
  0: a0
-    *** Failers
-No match
+\= Expect no match
     ba0\ncd   
 No match
 
@@ -240,8 +226,7 @@ No match
  0: a0
     ba0\n
  0: a0
-    *** Failers
-No match
+\= Expect no match
     ba0\ncd   
 No match
 
@@ -252,8 +237,6 @@ No match
  0: a0
     ba0\ncd   
  0: a0
-    *** Failers
-No match
 
 /abc/i
     abc
@@ -288,8 +271,7 @@ No match
  0: xxxyz
     axxxxyzq
  0: xxxyz
-    *** Failers
-No match
+\= Expect no match
     ax
 No match
     axx     
@@ -300,8 +282,7 @@ No match
  0: xxxyz
     axxxxyzq
  0: xxxyz
-    *** Failers
-No match
+\= Expect no match
     ax
 No match
     axx     
@@ -320,8 +301,7 @@ No match
  0: xxxyz
     axxxxyzq
  0: xxxyz
-    *** Failers
-No match
+\= Expect no match
     ax
 No match
     axx     
@@ -340,12 +320,7 @@ No match
  2: bcd
  3: bc
  4: b
-    *** Failers
- 0: *** F
- 1: *** 
- 2: ***
- 3: **
- 4: *
+\= Expect no match
     aaaaa   
 No match
 
@@ -359,13 +334,6 @@ No match
  2: bcd
  3: bc
  4: b
- 5: 
-    *** Failers
- 0: *** F
- 1: *** 
- 2: ***
- 3: **
- 4: *
  5: 
     aaaaa   
  0: 
@@ -384,10 +352,7 @@ No match
  0: bcdef
  1: bcde
  2: bcd
-    *** Failers
- 0: *** F
- 1: *** 
- 2: ***
+\= Expect no match
     axya
 No match
     axa
@@ -410,16 +375,14 @@ No match
 /\d+/
     ab1234c56
  0: 1234
-    *** Failers
-No match
+\= Expect no match
     xyz
 No match
     
 /\D+/
     ab123c56
  0: ab
-    *** Failers
- 0: *** Failers
+\= Expect no match
     789
 No match
     
@@ -428,8 +391,7 @@ No match
  0: 5A
     ABC
  0: A
-    *** Failers
-No match
+\= Expect no match
     XYZ
 No match
     
@@ -440,8 +402,6 @@ No match
  0: BA
     9ABC             
  0: A
-    *** Failers
-No match
 
 /a+/
     aaaa
@@ -458,8 +418,7 @@ No match
  0: abcdxyz
     axyz
  0: axyz
-    *** Failers
-No match
+\= Expect no match
     xyz
 No match
     
@@ -474,8 +433,7 @@ No match
  0: 12X
     123X
  0: 123X
-    *** Failers
-No match
+\= Expect no match
     X
 No match
     1X
@@ -492,8 +450,7 @@ No match
  0: c9
     d04
  0: d0
-    *** Failers
-No match
+\= Expect no match
     e45
 No match
     abcd      
@@ -516,8 +473,7 @@ No match
  0: abcd1
     1234  
  0: 1
-    *** Failers
-No match
+\= Expect no match
     e45
 No match
     abcd      
@@ -534,8 +490,7 @@ No match
  0: d0
     abcd1234
  0: abcd1
-    *** Failers
-No match
+\= Expect no match
     1234  
 No match
     e45
@@ -560,8 +515,7 @@ No match
  0: d0
     1234  
  0: 1
-    *** Failers
-No match
+\= Expect no match
     abcd1234
 No match
     e45
@@ -572,8 +526,7 @@ No match
  0: ab4
     bcd93
  0: bcd9
-    *** Failers
-No match
+\= Expect no match
     1234 
 No match
     a36 
@@ -590,16 +543,13 @@ No match
  0: abcabcabc4
     42xyz 
  0: 4
-    *** Failers
-No match
 
 /^(abc)+\d/
     abc45
  0: abc4
     abcabcabc45
  0: abcabcabc4
-    *** Failers
-No match
+\= Expect no match
     42xyz 
 No match
 
@@ -608,8 +558,7 @@ No match
  0: abc4
     42xyz 
  0: 4
-    *** Failers
-No match
+\= Expect no match
     abcabcabc45
 No match
 
@@ -618,8 +567,7 @@ No match
  0: abcabc4
     abcabcabc45
  0: abcabcabc4
-    *** Failers
-No match
+\= Expect no match
     abcabcabcabc45
 No match
     abc45
@@ -650,8 +598,7 @@ No match
  0: a(b)c
     a(b(c))d  
  0: a(b(c))d
-    *** Failers)
-No match
+\= Expect no match)
     a(b(c)d  
 No match
 
@@ -666,8 +613,7 @@ No match
 /^(?>a*)\d/
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9
-    *** Failers 
-No match
+\= Expect no match 
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 No match
 
@@ -684,8 +630,7 @@ No match
  0: <abc<>def>
     <abc<>      
  0: <>
-    *** Failers
-No match
+\= Expect no match
     <abc
 No match
 
@@ -694,8 +639,7 @@ No match
  0: abc:
     12                             
  0: 12
-    *** Failers                     
-No match
+\= Expect no match                     
     123                       
 No match
     xyz                        
@@ -706,8 +650,7 @@ No match
  0: abc:
     12         
  0: 12
-    *** Failers
-No match
+\= Expect no match
     123
 No match
     xyz    
@@ -716,8 +659,7 @@ No match
 /^(?=abc)\w{5}:$/
     abcde:                          
  0: abcde:
-    *** Failers                     
-No match
+\= Expect no match                     
     abc.. 
 No match
     123                       
@@ -728,8 +670,7 @@ No match
 /^(?!abc)\d\d$/
     12         
  0: 12
-    *** Failers
-No match
+\= Expect no match
     abcde:
 No match
     abc..  
@@ -744,8 +685,7 @@ No match
  0: 123
     wxy123z
  0: 123
-    *** Failers
-No match
+\= Expect no match
     123abc
 No match
 
@@ -754,8 +694,7 @@ No match
  0: 123
     mno123456 
  0: 123
-    *** Failers
-No match
+\= Expect no match
     abc12345
 No match
     wxy123z
@@ -841,8 +780,7 @@ No match
 /^abc/
     abcdef
  0: abc
-    *** Failers
-No match
+\= Expect no match
     abcdef\=notbol
 No match
 
@@ -856,8 +794,7 @@ No match
  1: 
     xyz\=notempty
  0: xyz
-    *** Failers
- 0: 
+\= Expect no match
     bcd\=notempty
 No match
     
@@ -866,8 +803,7 @@ No match
  0: xyz
     xyz\n
  0: xyz
-    *** Failers
-No match
+\= Expect no match
     xyz\=noteol
 No match
     xyz\n\=noteol
@@ -884,8 +820,7 @@ No match
  0: xyz
     xyz\n\=noteol
  0: xyz
-    *** Failers
-No match
+\= Expect no match
     xyz\=noteol
 No match
 
@@ -894,8 +829,7 @@ No match
  0: abc
     defabcxyz\=offset=3
  0: abc
-    *** Failers 
-No match
+\= Expect no match 
     defabcxyz
 No match
 
@@ -906,8 +840,7 @@ Partial match: ab
 Partial match: abcde
     abcdef\=ps
  0: abcdef
-    *** Failers
-No match
+\= Expect no match
     abx\=ps
 No match
 
@@ -928,8 +861,7 @@ Partial match: aaaa12345
  0: aa0z
     aaaa4444444444444z\=ps
  0: aaaa4444444444444z
-    *** Failers
-No match
+\= Expect no match
     az\=ps
 No match
     aaaaa\=ps
@@ -944,27 +876,20 @@ Partial match: abc
  0: def
    
 /(?<=foo)bar/
-   xyzfo\=ps
-No match
    foob\=ps,offset=2
 Partial match: foob
                <<<
    foobar...\=ps,dfa_restart,offset=4
  0: ar
-   xyzfo\=ps
-No match
    foobar\=offset=2
  0: bar
-   *** Failers
-No match
+\= Expect no match
    xyzfo\=ps
 No match
    obar\=dfa_restart
 No match
 
 /(ab*(cd|ef))+X/
-    adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\=ps,noteol
-No match
     lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\=ps,notbol,noteol
 Partial match: abbbbbbcdaefabbbbbbbefa
     cdabbbbbbbb\=ps,notbol,dfa_restart,noteol
@@ -973,14 +898,18 @@ Partial match: cdabbbbbbbb
 Partial match: efabbbbbbbbbbbbbbbb
     bbbbbbbbbbbbcdXyasdfadf\=ps,notbol,dfa_restart,noteol
  0: bbbbbbbbbbbbcdX
+\= Expect no match
+    adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\=ps,noteol
+No match
 
 /the quick brown fox/
     the quick brown fox
  0: the quick brown fox
-    The quick brown FOX
-No match
     What do you know about the quick brown fox?
  0: the quick brown fox
+\= Expect no match
+    The quick brown FOX
+No match
     What do you know about THE QUICK BROWN FOX?
 No match
 
@@ -1059,8 +988,7 @@ No match
  0: aaaabxyzpqrrrabbxyyyypqAzz
     >>>>abcxyzpqrrrabbxyyyypqAzz
  0: abcxyzpqrrrabbxyyyypqAzz
-    *** Failers
-No match
+\= Expect no match
     abxyzpqrrabbxyyyypqAzz
 No match
     abxyzpqrrrrabbxyyyypqAzz
@@ -1079,8 +1007,7 @@ No match
  0: abczz
     abcabczz
  0: abcabczz
-    *** Failers
-No match
+\= Expect no match
     zz
 No match
     abcabcabczz
@@ -1105,8 +1032,7 @@ No match
  0: abbbbbbbbbbbc
     bbbbbbbbbbbac
  0: bbbbbbbbbbbac
-    *** Failers
-No match
+\= Expect no match
     aaac
 No match
     abbbbbbbbbbbac
@@ -1129,8 +1055,7 @@ No match
  0: abbbbbbbbbbbc
     bbbbbbbbbbbac
  0: bbbbbbbbbbbac
-    *** Failers
-No match
+\= Expect no match
     aaac
 No match
     abbbbbbbbbbbac
@@ -1147,8 +1072,7 @@ No match
  0: bbabc
     bababc
  0: bababc
-    *** Failers
-No match
+\= Expect no match
     bababbc
 No match
     babababc
@@ -1161,8 +1085,7 @@ No match
  0: bbabc
     bababc
  0: bababc
-    *** Failers
-No match
+\= Expect no match
     bababbc
 No match
     babababc
@@ -1185,8 +1108,7 @@ No match
  0: d
     ething
  0: e
-    *** Failers
-No match
+\= Expect no match
     fthing
 No match
     [thing
@@ -1203,8 +1125,7 @@ No match
  0: d
     ething
  0: e
-    *** Failers
-No match
+\= Expect no match
     athing
 No match
     fthing
@@ -1217,8 +1138,7 @@ No match
  0: [
     \\thing
  0: \
-    *** Failers
- 0: *
+\= Expect no match
     athing
 No match
     bthing
@@ -1237,8 +1157,7 @@ No match
  0: a
     fthing
  0: f
-    *** Failers
- 0: *
+\= Expect no match
     ]thing
 No match
     cthing
@@ -1281,8 +1200,7 @@ No match
  0: 10
     100
  0: 100
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
 
@@ -1299,8 +1217,7 @@ No match
  0: xxx0
     xxx1234
  0: xxx1234
-    *** Failers
-No match
+\= Expect no match
     xxx
 No match
 
@@ -1311,12 +1228,11 @@ No match
  0: xx123
     123456
  0: 123456
-    *** Failers
-No match
-    123
-No match
     x1234
  0: x1234
+\= Expect no match
+    123
+No match
 
 /^.+?[0-9][0-9][0-9]$/
     x123
@@ -1325,18 +1241,16 @@ No match
  0: xx123
     123456
  0: 123456
-    *** Failers
-No match
-    123
-No match
     x1234
  0: x1234
+\= Expect no match
+    123
+No match
 
 /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
     abc!pqr=apquxz.ixr.zzz.ac.uk
  0: abc!pqr=apquxz.ixr.zzz.ac.uk
-    *** Failers
-No match
+\= Expect no match
     !pqr=apquxz.ixr.zzz.ac.uk
 No match
     abc!=apquxz.ixr.zzz.ac.uk
@@ -1349,7 +1263,8 @@ No match
 /:/
     Well, we need a colon: somewhere
  0: :
-    *** Fail if we don't
+\= Expect no match
+    No match without a colon
 No match
 
 /([\da-f:]+)$/i
@@ -1369,8 +1284,7 @@ No match
  0: def
     Any old stuff
  0: ff
-    *** Failers
-No match
+\= Expect no match
     0zzz
 No match
     gzzz
@@ -1385,8 +1299,7 @@ No match
  0: .1.2.3
     A.12.123.0
  0: A.12.123.0
-    *** Failers
-No match
+\= Expect no match
     .1.2.3333
 No match
     1.2.3
@@ -1399,8 +1312,7 @@ No match
  0: 1 IN SOA non-sp1 non-sp2(
     1    IN    SOA    non-sp1    non-sp2   (
  0: 1    IN    SOA    non-sp1    non-sp2   (
-    *** Failers
-No match
+\= Expect no match
     1IN SOA non-sp1 non-sp2(
 No match
 
@@ -1417,8 +1329,7 @@ No match
  0: sxk.zzz.ac.uk.
     x-.y-.
  0: x-.y-.
-    *** Failers
-No match
+\= Expect no match
     -abc.peq.
 No match
 
@@ -1431,8 +1342,7 @@ No match
  0: *.c3-b.c
     *.c-a.b-c
  0: *.c-a.b-c
-    *** Failers
-No match
+\= Expect no match
     *.0
 No match
     *.a-
@@ -1469,22 +1379,18 @@ No match
  0: "abcd" ;
     \"\" ; rhubarb
  0: "" ; rhubarb
-    *** Failers
-No match
+\= Expect no match
     \"1234\" : things
 No match
 
 /^$/
     \
  0: 
-    *** Failers
-No match
 
 /   ^    a   (?# begins with a)  b\sc (?# then b c) $ (?# then end)/x
     ab c
  0: ab c
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
     ab cde
@@ -1493,8 +1399,7 @@ No match
 /(?x)   ^    a   (?# begins with a)  b\sc (?# then b c) $ (?# then end)/
     ab c
  0: ab c
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
     ab cde
@@ -1505,8 +1410,7 @@ No match
  0: a bcd
     a b d
  0: a b d
-    *** Failers
-No match
+\= Expect no match
     abcd
 No match
     ab d
@@ -1621,8 +1525,7 @@ No match
  0: 12345678ab
     12345678__
  0: 12345678__
-    *** Failers
-No match
+\= Expect no match
     1234567
 No match
 
@@ -1635,8 +1538,7 @@ No match
  0: 12345
     aaaaa
  0: aaaaa
-    *** Failers
-No match
+\= Expect no match
     123456
 No match
 
@@ -1664,8 +1566,7 @@ No match
  0: From abcd  Mon Sep 01 12:33
     From abcd  Mon Sep  1 12:33:02 1997
  0: From abcd  Mon Sep  1 12:33
-    *** Failers
-No match
+\= Expect no match
     From abcd  Sep 01 12:33:02 1997
 No match
 
@@ -1696,8 +1597,7 @@ No match
 /^(\D*)(?=\d)(?!123)/
     abc456
  0: abc
-    *** Failers
-No match
+\= Expect no match
     abc123
 No match
 
@@ -1723,16 +1623,14 @@ No match
 /(?!^)abc/
     the abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
 
 /(?=^)abc/
     abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     the abc
 No match
 
@@ -1988,8 +1886,7 @@ No match
     A missing angle <user\@some.where
  0: user@some.where
  1: user@some
-    *** Failers
-No match
+\= Expect no match
     The quick brown fox
 No match
 
@@ -2593,8 +2490,7 @@ No match
     A missing angle <user\@some.where
  0: user@some.where
  1: user@some
-    *** Failers
-No match
+\= Expect no match
     The quick brown fox
 No match
 
@@ -2627,8 +2523,7 @@ No match
  0: A\x00\x00Z
     An A\0\x0\0Z
  0: A\x00\x00\x00Z
-    *** Failers
-No match
+\= Expect no match
     A\0Z
 No match
     A\0\x0\0\x0Z
@@ -2645,8 +2540,7 @@ No match
  0: \x0d
     \tabc
  0: \x09
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
 
@@ -2662,8 +2556,7 @@ No match
  0: abbbc
     abbc
  0: abbc
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
     abbbbbc
@@ -2684,8 +2577,7 @@ No match
 /^[W-c]+$/
     WXY_^abc
  0: WXY_^abc
-    *** Failers
-No match
+\= Expect no match
     wxy
 No match
 
@@ -2714,8 +2606,7 @@ No match
 /^abc$/
     abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     qqq\nabc
 No match
     abc\nzzz
@@ -2728,8 +2619,7 @@ No match
  0: abc
     abc\n 
  0: abc
-    *** Failers
-No match
+\= Expect no match
     qqq\nabc
 No match
     abc\nzzz
@@ -2742,8 +2632,7 @@ No match
  0: abc\x0adef
 
 /\A(.)*\Z/m
-    *** Failers
- 0: *** Failers
+\= Expect no match
     abc\ndef
 No match
 
@@ -2756,24 +2645,21 @@ No match
 /[-az]+/
     az-
  0: az-
-    *** Failers
- 0: a
+\= Expect no match
     b
 No match
 
 /[az-]+/
     za-
  0: za-
-    *** Failers
- 0: a
+\= Expect no match
     b
 No match
 
 /[a\-z]+/
     a-z
  0: a-z
-    *** Failers
- 0: a
+\= Expect no match
     b
 No match
 
@@ -2784,16 +2670,14 @@ No match
 /[\d-]+/
     12-34
  0: 12-34
-    *** Failers
-No match
+\= Expect no match
     aaa
 No match
 
 /[\d-z]+/
     12-34z
  0: 12-34z
-    *** Failers
-No match
+\= Expect no match
     aaa
 No match
 
@@ -2804,8 +2688,7 @@ No match
 /\x20Z/
     the Zoo
  0:  Z
-    *** Failers
-No match
+\= Expect no match
     Zulu
 No match
 
@@ -2828,8 +2711,7 @@ No match
 /^a.b/newline=lf
     a\rb
  0: a\x0db
-    *** Failers
-No match
+\= Expect no match
     a\nb
 No match
 
@@ -2838,8 +2720,7 @@ No match
  0: abc
     abc\n
  0: abc
-    *** Failers
-No match
+\= Expect no match
     abc\ndef
 No match
 
@@ -2918,13 +2799,7 @@ No match
  1: baNOTc
     bacccd
  0: baccc
-    *** Failers
- 0: *** Failers
- 1: *** Failer
- 2: *** Faile
- 3: *** Fail
- 4: *** Fai
- 5: *** Fa
+\= Expect no match
     anything
 No match
     b\bc   
@@ -2955,8 +2830,7 @@ No match
 /[^k]$/
     abc
  0: c
-    *** Failers
- 0: s
+\= Expect no match
     abk   
 No match
    
@@ -2967,8 +2841,7 @@ No match
  0: bc
     kabc 
  0: abc
-    *** Failers
- 0: ers
+\= Expect no match
     abk
 No match
     akb
@@ -2981,8 +2854,7 @@ No match
  0: 12345678@a.b.c.d
     123456789\@x.y.z
  0: 123456789@x.y.z
-    *** Failers
-No match
+\= Expect no match
     12345678\@x.y.uk
 No match
     1234567\@a.b.c.d       
@@ -3038,8 +2910,7 @@ No match
  1: .23
     1.875000282
  0: .875
-    *** Failers 
-No match
+\= Expect no match 
     1.235 
 No match
     
@@ -3134,8 +3005,7 @@ Matched, but offsets vector is too small to show all matches
 /^(\D*)(?=\d)(?!123)/
     ABC445
  0: ABC
-    *** Failers
-No match
+\= Expect no match
     ABC123
 No match
     
@@ -3144,8 +3014,7 @@ No match
  0: W46]
     -46]789
  0: -46]
-    *** Failers
-No match
+\= Expect no match
     Wall
 No match
     Zebra
@@ -3174,8 +3043,7 @@ No match
  0: ]
     \\backslash 
  0: \
-    *** Failers
-No match
+\= Expect no match
     -46]789
 No match
     well
@@ -3188,10 +3056,12 @@ No match
 /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
   word cat dog elephant mussel cow horse canary baboon snake shark otherword
  0: word cat dog elephant mussel cow horse canary baboon snake shark otherword
+\= Expect no match
   word cat dog elephant mussel cow horse canary baboon snake shark
 No match
 
 /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
+\= Expect no match
   word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
 No match
 
@@ -3267,25 +3137,25 @@ No match
  8: 
 
 /^(a){1,1}/
-    bcd
-No match
     abc
  0: a
     aab  
  0: a
-
-/^(a){1,2}/
+\= Expect no match
     bcd
 No match
+
+/^(a){1,2}/
     abc
  0: a
     aab  
  0: aa
  1: a
-
-/^(a){1,3}/
+\= Expect no match
     bcd
 No match
+
+/^(a){1,3}/
     abc
  0: a
     aab
@@ -3295,10 +3165,11 @@ No match
  0: aaa
  1: aa
  2: a
-
-/^(a){1,}/
+\= Expect no match
     bcd
 No match
+
+/^(a){1,}/
     abc
  0: a
     aab
@@ -3317,6 +3188,9 @@ No match
  5: aaa
  6: aa
  7: a
+\= Expect no match
+    bcd
+No match
 
 /.*\.gif/
     borfle\nbib.gif\nno
@@ -3381,8 +3255,7 @@ No match
  0: 1234X
     BarFoo 
  0: B
-    *** Failers
-No match
+\= Expect no match
     abcde\nBar  
 No match
 
@@ -3399,8 +3272,7 @@ No match
  0: abcde\x0a1234X
     BarFoo 
  0: B
-    *** Failers
-No match
+\= Expect no match
     abcde\nBar  
 No match
 
@@ -3417,8 +3289,7 @@ No match
  0: abcde\x0a1234X
     BarFoo 
  0: B
-    *** Failers 
-No match
+\= Expect no match 
     abcde\nBar  
 No match
 
@@ -3427,14 +3298,12 @@ No match
  0: abcde\x0a1234X
     BarFoo 
  0: B
-    *** Failers 
-No match
+\= Expect no match 
     abcde\nBar  
 No match
 
 /^.*B/
-    **** Failers
-No match
+\= Expect no match
     abc\nB
 No match
      
@@ -3485,32 +3354,28 @@ No match
 /^[abcdefghijklmnopqrstuvwxy0123456789]/
     n
  0: n
-    *** Failers 
-No match
+\= Expect no match 
     z 
 No match
 
 /abcde{0,0}/
     abcd
  0: abcd
-    *** Failers
-No match
+\= Expect no match
     abce  
 No match
 
 /ab[cd]{0,0}e/
     abe
  0: abe
-    *** Failers
-No match
+\= Expect no match
     abcde 
 No match
     
 /ab(c){0,0}d/
     abd
  0: abd
-    *** Failers
-No match
+\= Expect no match
     abcd   
 No match
 
@@ -3521,16 +3386,14 @@ No match
  0: ab
     abbbb
  0: abbbb
-    *** Failers
- 0: a
+\= Expect no match
     bbbbb    
 No match
     
 /ab\d{0}e/
     abe
  0: abe
-    *** Failers
-No match
+\= Expect no match
     ab1e   
 No match
     
@@ -3584,8 +3447,7 @@ No match
 /a.b/
     acb
  0: acb
-    *** Failers 
-No match
+\= Expect no match 
     a\nb   
 No match
     
@@ -3626,10 +3488,11 @@ No match
  0: bbbbbac
     
 /(?!\A)x/m
-    x\nb\n
-No match
     a\bx\n  
  0: x
+\= Expect no match
+    x\nb\n
+No match
     
 /\x0{ab}/
     \0{ab} 
@@ -3652,8 +3515,7 @@ No match
  0: foo
     rfoosh
  0: foo
-    *** Failers
-No match
+\= Expect no match
     barfoo
 No match
     towbarfoo
@@ -3662,8 +3524,7 @@ No match
 /\w{3}(?<!bar)foo/
     catfood
  0: catfoo
-    *** Failers
-No match
+\= Expect no match
     foo
 No match
     barfoo
@@ -3674,8 +3535,7 @@ No match
 /(?<=(foo)a)bar/
     fooabar
  0: bar
-    *** Failers
-No match
+\= Expect no match
     bar
 No match
     foobbar
@@ -3684,8 +3544,7 @@ No match
 /\Aabc\z/m
     abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     abc\n   
 No match
     qqq\nabc
@@ -3696,6 +3555,7 @@ No match
 No match
 
 "(?>.*/)foo"
+\= Expect no match
     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
 No match
 
@@ -3708,16 +3568,14 @@ No match
  0: .230003938
     1.875000282
  0: .875000282
-    *** Failers 
-No match
+\= Expect no match 
     1.235 
 No match
 
 /^((?>\w+)|(?>\s+))*$/
     now is the time for all good men to come to the aid of the party
  0: now is the time for all good men to come to the aid of the party
-    *** Failers
-No match
+\= Expect no match
     this is not a line with only words and spaces!
 No match
     
@@ -3737,8 +3595,7 @@ No match
 /((?>\d+))(\w)/
     12345a
  0: 12345a
-    *** Failers
-No match
+\= Expect no match
     12345+ 
 No match
 
@@ -3786,8 +3643,7 @@ No match
  0: (abc)
     (abc(def)xyz)
  0: (abc(def)xyz)
-    *** Failers
-No match
+\= Expect no match
     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa   
 No match
 
@@ -3796,8 +3652,7 @@ No match
  0: ab
     Ab
  0: Ab
-    *** Failers 
-No match
+\= Expect no match 
     aB
 No match
     AB
@@ -3806,8 +3661,7 @@ No match
 /(a (?x)b c)d e/
     a bcd e
  0: a bcd e
-    *** Failers
-No match
+\= Expect no match
     a b cd e
 No match
     abcd e   
@@ -3818,8 +3672,7 @@ No match
 /(a b(?x)c d (?-x)e f)/
     a bcde f
  0: a bcde f
-    *** Failers
-No match
+\= Expect no match
     abcdef  
 No match
 
@@ -3828,8 +3681,7 @@ No match
  0: abc
     aBc
  0: aBc
-    *** Failers
-No match
+\= Expect no match
     abC
 No match
     aBC  
@@ -3848,8 +3700,7 @@ No match
  0: abc
     aBc
  0: aBc
-    *** Failers 
-No match
+\= Expect no match 
     ABC
 No match
     abC
@@ -3862,8 +3713,7 @@ No match
  0: aBc
     aBBc
  0: aBBc
-    *** Failers 
-No match
+\= Expect no match 
     aBC
 No match
     aBBC
@@ -3874,8 +3724,7 @@ No match
  0: abcd
     abCd
  0: abCd
-    *** Failers
-No match
+\= Expect no match
     aBCd
 No match
     abcD     
@@ -3888,8 +3737,7 @@ No match
  0: more than MILLION
     more \n than Million 
  0: more \x0a than Million
-    *** Failers
-No match
+\= Expect no match
     MORE THAN MILLION    
 No match
     more \n than \n million 
@@ -3902,8 +3750,7 @@ No match
  0: more than MILLION
     more \n than Million 
  0: more \x0a than Million
-    *** Failers
-No match
+\= Expect no match
     MORE THAN MILLION    
 No match
     more \n than \n million 
@@ -3916,8 +3763,7 @@ No match
  0: aBbc
     aBBc 
  0: aBBc
-    *** Failers
-No match
+\= Expect no match
     Abc
 No match
     abAb    
@@ -3930,8 +3776,7 @@ No match
  0: abc
     aBc
  0: aBc
-    *** Failers
-No match
+\= Expect no match
     Ab 
 No match
     abC
@@ -3944,8 +3789,7 @@ No match
  0: xxc
     aBxxc
  0: xxc
-    *** Failers
-No match
+\= Expect no match
     Abxxc
 No match
     ABxxc
@@ -3958,8 +3802,7 @@ No match
  0: abc:
     12
  0: 12
-    *** Failers
-No match
+\= Expect no match
     123
 No match
     xyz    
@@ -3970,8 +3813,7 @@ No match
  0: abc:
     12
  0: 12
-    *** Failers
-No match
+\= Expect no match
     123
 No match
     xyz    
@@ -3986,8 +3828,7 @@ No match
  0: cat
     focat   
  0: cat
-    *** Failers
-No match
+\= Expect no match
     foocat  
 No match
 
@@ -4000,8 +3841,7 @@ No match
  0: cat
     focat   
  0: cat
-    *** Failers
-No match
+\= Expect no match
     foocat  
 No match
 
@@ -4182,8 +4022,7 @@ No match
  0: 12-sep-98
     12-09-98
  0: 12-09-98
-    *** Failers
-No match
+\= Expect no match
     sep-12-98
 No match
         
@@ -4212,8 +4051,7 @@ No match
  0: bbx
     BBx
  0: BBx
-    *** Failers
-No match
+\= Expect no match
     abcX
 No match
     aBCX
@@ -4238,8 +4076,7 @@ No match
  0: f
     France
  0: F
-    *** Failers
-No match
+\= Expect no match
     Africa     
 No match
 
@@ -4256,8 +4093,7 @@ No match
  0: z
     Zambesi
  0: Z
-    *** Failers
-No match
+\= Expect no match
     aCD  
 No match
     XY  
@@ -4266,8 +4102,7 @@ No match
 /(?<=foo\n)^bar/m
     foo\nbar
  0: bar
-    *** Failers
-No match
+\= Expect no match
     bar
 No match
     baz\nbar   
@@ -4280,16 +4115,14 @@ No match
  0: baz
     koobarbaz 
  0: baz
-    *** Failers
-No match
+\= Expect no match
     baz
 No match
     foobarbaz 
 No match
 
-/The following tests are taken from the Perl 5.005 test suite; some of them/
-/are compatible with 5.004, but I'd rather not have to sort them out./
-No match
+# The following tests are taken from the Perl 5.005 test suite; some of them
+# are compatible with 5.004, but I'd rather not have to sort them out.
 
 /abc/
     abc
@@ -4298,8 +4131,7 @@ No match
  0: abc
     ababc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     xbc
 No match
     axc
@@ -4334,8 +4166,7 @@ No match
 /ab+bc/
     abbc
  0: abbc
-    *** Failers
-No match
+\= Expect no match
     abc
 No match
     abq
@@ -4358,8 +4189,7 @@ No match
  0: abbbbc
 
 /ab{4,5}bc/
-    *** Failers
-No match
+\= Expect no match
     abq
 No match
     abbbbc
@@ -4388,8 +4218,7 @@ No match
 /^abc$/
     abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     abbbbc
 No match
     abcc
@@ -4404,10 +4233,9 @@ No match
 /abc$/
     aabc
  0: abc
-    *** Failers
-No match
     aabc
  0: abc
+\= Expect no match
     aabcd
 No match
 
@@ -4432,8 +4260,7 @@ No match
 /a[bc]d/
     abd
  0: abd
-    *** Failers
-No match
+\= Expect no match
     axyzd
 No match
     abc
@@ -4466,8 +4293,7 @@ No match
 /a[^bc]d/
     aed
  0: aed
-    *** Failers
-No match
+\= Expect no match
     abd
 No match
     abd
@@ -4480,10 +4306,9 @@ No match
 /a[^]b]c/
     adc
  0: adc
-    *** Failers
-No match
     a-c
  0: a-c
+\= Expect no match
     a]c
 No match
 
@@ -4496,8 +4321,7 @@ No match
  0: a
 
 /\by\b/
-    *** Failers
-No match
+\= Expect no match
     xy
 No match
     yz
@@ -4506,8 +4330,7 @@ No match
 No match
 
 /\Ba\B/
-    *** Failers
- 0: a
+\= Expect no match
     a-
 No match
     -a
@@ -4534,10 +4357,7 @@ No match
 /\W/
     -
  0: -
-    *** Failers
- 0: *
-    -
- 0: -
+\= Expect no match
     a
 No match
 
@@ -4548,10 +4368,7 @@ No match
 /a\Sb/
     a-b
  0: a-b
-    *** Failers
-No match
-    a-b
- 0: a-b
+\= Expect no match
     a b
 No match
 
@@ -4562,10 +4379,7 @@ No match
 /\D/
     -
  0: -
-    *** Failers
- 0: *
-    -
- 0: -
+\= Expect no match
     1
 No match
 
@@ -4576,10 +4390,7 @@ No match
 /[\W]/
     -
  0: -
-    *** Failers
- 0: *
-    -
- 0: -
+\= Expect no match
     a
 No match
 
@@ -4590,10 +4401,7 @@ No match
 /a[\S]b/
     a-b
  0: a-b
-    *** Failers
-No match
-    a-b
- 0: a-b
+\= Expect no match
     a b
 No match
 
@@ -4604,10 +4412,7 @@ No match
 /[\D]/
     -
  0: -
-    *** Failers
- 0: *
-    -
- 0: -
+\= Expect no match
     1
 No match
 
@@ -4634,6 +4439,9 @@ No match
  0: a((b
 
 /a\\b/
+    a\\b
+ 0: a\b
+\= Expect no match
     a\b
 No match
 
@@ -4695,14 +4503,11 @@ No match
  0: cde
 
 /abc/
-    *** Failers
-No match
+\= Expect no match
     b
 No match
-    
 
 /a*/
-    
 
 /([abc])*d/
     abbbcd
@@ -4774,8 +4579,7 @@ No match
  0: adcdcde
 
 /a[bcd]+dcdcde/
-    *** Failers
-No match
+\= Expect no match
     abcde
 No match
     adcdcde
@@ -4804,8 +4608,7 @@ No match
  0: ij
     reffgz
  0: effgz
-    *** Failers
-No match
+\= Expect no match
     effg
 No match
     bcdd
@@ -4820,8 +4623,7 @@ No match
  0: a
 
 /multiple words of text/
-    *** Failers
-No match
+\= Expect no match
     aa
 No match
     uh-uh
@@ -4860,8 +4662,7 @@ No match
  0: ABC
     ABABC
  0: ABC
-    *** Failers
-No match
+\= Expect no match
     aaxabxbaxbbx
 No match
     XBC
@@ -4894,8 +4695,7 @@ No match
  0: ABBC
 
 /ab+bc/i
-    *** Failers
-No match
+\= Expect no match
     ABC
 No match
     ABQ
@@ -4920,8 +4720,7 @@ No match
  0: ABBBBC
 
 /ab{4,5}?bc/i
-    *** Failers
-No match
+\= Expect no match
     ABQ
 No match
     ABBBBC
@@ -4950,8 +4749,7 @@ No match
 /^abc$/i
     ABC
  0: ABC
-    *** Failers
-No match
+\= Expect no match
     ABBBBC
 No match
     ABCC
@@ -4986,10 +4784,9 @@ No match
  0: AXYZC
 
 /a.*c/i
-    *** Failers
-No match
     AABC
  0: AABC
+\= Expect no match
     AXYZD
 No match
 
@@ -5000,8 +4797,7 @@ No match
 /a[b-d]e/i
     ACE
  0: ACE
-    *** Failers
-No match
+\= Expect no match
     ABC
 No match
     ABD
@@ -5034,8 +4830,7 @@ No match
 /a[^-b]c/i
     ADC
  0: ADC
-    *** Failers
-No match
+\= Expect no match
     ABD
 No match
     A-C
@@ -5056,8 +4851,7 @@ No match
  0: EF
 
 /$b/i
-    *** Failers
-No match
+\= Expect no match
     A]C
 No match
     B
@@ -5074,6 +4868,7 @@ No match
  0: A((B
 
 /a\\b/i
+\= Expect no match
     A\=notbol
 No match
 
@@ -5152,7 +4947,6 @@ No match
 /abc/i
 
 /a*/i
-    
 
 /([abc])*d/i
     ABBBCD
@@ -5189,6 +4983,7 @@ No match
  0: HIJ
 
 /^(ab|cd)e/i
+\= Expect no match
     ABCDE
 No match
 
@@ -5250,8 +5045,7 @@ No match
  0: IJ
     REFFGZ
  0: EFFGZ
-    *** Failers
-No match
+\= Expect no match
     ADCDCDE
 No match
     EFFG
@@ -5276,8 +5070,7 @@ No match
  0: C
 
 /multiple words of text/i
-    *** Failers
-No match
+\= Expect no match
     AA
 No match
     UH-UH
@@ -5423,8 +5216,7 @@ No match
 /(?<=a)b/
     ab
  0: b
-    *** Failers
-No match
+\= Expect no match
     cb
 No match
     b
@@ -5489,8 +5281,7 @@ No match
  0: Ab
 
 /(?:(?i)a)b/
-    *** Failers
-No match
+\= Expect no match
     cb
 No match
     aB
@@ -5515,8 +5306,7 @@ No match
  0: Ab
 
 /(?i:a)b/
-    *** Failers
-No match
+\= Expect no match
     aB
 No match
     aB
@@ -5541,10 +5331,9 @@ No match
  0: aB
 
 /(?:(?-i)a)b/i
-    *** Failers
-No match
     aB
  0: aB
+\= Expect no match
     Ab
 No match
 
@@ -5559,8 +5348,7 @@ No match
  0: aB
 
 /(?:(?-i)a)b/i
-    *** Failers
-No match
+\= Expect no match
     Ab
 No match
     AB
@@ -5585,8 +5373,7 @@ No match
  0: aB
 
 /(?-i:a)b/i
-    *** Failers
-No match
+\= Expect no match
     AB
 No match
     Ab
@@ -5603,8 +5390,7 @@ No match
  0: aB
 
 /(?-i:a)b/i
-    *** Failers
-No match
+\= Expect no match
     Ab
 No match
     AB
@@ -5613,8 +5399,7 @@ No match
 /((?-i:a))b/i
 
 /((?-i:a.))b/i
-    *** Failers
-No match
+\= Expect no match
     AB
 No match
     a\nB
@@ -5650,8 +5435,7 @@ No match
  0: aaac
 
 /(?<![cd])b/
-    *** Failers
-No match
+\= Expect no match
     B\nB
 No match
     dbcb
@@ -5672,8 +5456,7 @@ No match
  0: b
 
 /^(?:a?b?)*$/
-    *** Failers
-No match
+\= Expect no match
     dbcb
 No match
     a--
@@ -5718,8 +5501,7 @@ No match
 /^b/
 
 /()^b/
-    *** Failers
-No match
+\= Expect no match
     a\nb\nc\n
 No match
     a\nb\nc\n
@@ -5736,8 +5518,7 @@ No match
  0: a
 
 /(?(?=a)b|a)/
-    *** Failers
-No match
+\= Expect no match
     a
 No match
     a
@@ -5774,8 +5555,7 @@ No match
  0: abcd
     xy:z:::abcd
  0: xy:z:::abcd
-    *** Failers
- 0: Failers
+\= Expect no match
     abcd:
 No match
     abcd:
@@ -5821,8 +5601,7 @@ No match
  5: abc
 
 /a\Z/
-    *** Failers
-No match
+\= Expect no match
     aaab
 No match
     a\nb\n
@@ -5841,26 +5620,25 @@ No match
 /b\z/
     a\nb
  0: b
-    *** Failers
-No match
     
 /(?>.*)(?<=(abcd|wxyz))/
     alphabetabcd
  0: alphabetabcd
     endingwxyz
  0: endingwxyz
-    *** Failers
-No match
+\= Expect no match
     a rather long string that doesn't end with one of them
 No match
 
 /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/
     word cat dog elephant mussel cow horse canary baboon snake shark otherword
  0: word cat dog elephant mussel cow horse canary baboon snake shark otherword
+\= Expect no match
     word cat dog elephant mussel cow horse canary baboon snake shark
 No match
   
 /word (?>[a-zA-Z0-9]+ ){0,30}otherword/
+\= Expect no match
     word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
 No match
 
@@ -5869,8 +5647,7 @@ No match
  0: foo
     123999foo 
  0: foo
-    *** Failers
-No match
+\= Expect no match
     123abcfoo
 No match
     
@@ -5879,8 +5656,7 @@ No match
  0: foo
     123999foo 
  0: foo
-    *** Failers
-No match
+\= Expect no match
     123abcfoo
 No match
 
@@ -5889,8 +5665,7 @@ No match
  0: foo
     123456foo 
  0: foo
-    *** Failers
-No match
+\= Expect no match
     123999foo  
 No match
     
@@ -5899,8 +5674,7 @@ No match
  0: foo
     123456foo 
  0: foo
-    *** Failers
-No match
+\= Expect no match
     123999foo  
 No match
 
@@ -5948,8 +5722,7 @@ No match
  0: -
     0digit
  0: 0
-    *** Failers
-No match
+\= Expect no match
     bcdef    
 No match
     
@@ -5978,7 +5751,8 @@ No match
  0: x
 
 /(?!^)x/m
-  a\nxb\n
+\= Expect no match
+    a\nxb\n
 No match
 
 /abc\Qabc\Eabc/
@@ -5992,8 +5766,7 @@ No match
 /   abc\Q abc\Eabc/x
     abc abcabc
  0: abc abcabc
-    *** Failers
-No match
+\= Expect no match
     abcabcabc  
 No match
     
@@ -6033,8 +5806,7 @@ No match
 /\Gabc/
     abc
  0: abc
-    *** Failers
-No match
+\= Expect no match
     xyzabc  
 No match
 
@@ -6052,8 +5824,7 @@ No match
 /a(?x: b c )d/
     XabcdY
  0: abcd
-    *** Failers 
-No match
+\= Expect no match 
     Xa b c d Y 
 No match
 
@@ -6066,8 +5837,7 @@ No match
 /(?i)AB(?-i)C/
     XabCY
  0: abC
-    *** Failers
-No match
+\= Expect no match
     XabcY  
 No match
 
@@ -6076,8 +5846,7 @@ No match
  0: abCE
     DE
  0: DE
-    *** Failers
-No match
+\= Expect no match
     abcE
 No match
     abCe  
@@ -6098,12 +5867,12 @@ No match
  0: d
     ] 
  0: ]
-    *** Failers
- 0: a
+\= Expect no match
     b     
 No match
 
 /(a+)*b/
+\= Expect no match
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
 No match
     
@@ -6150,22 +5919,21 @@ Failed: error -40: backreference condition or recursion test is not supported fo
 /line\nbreak/firstline
     this is a line\nbreak
  0: line\x0abreak
-    ** Failers 
-No match
+\= Expect no match 
     line one\nthis is a line\nbreak in the second line 
 No match
 
 /line\nbreak/m,firstline
     this is a line\nbreak
  0: line\x0abreak
-    ** Failers 
-No match
+\= Expect no match 
     line one\nthis is a line\nbreak in the second line 
 No match
 
 /1234/
     123\=ps
 Partial match: 123
+\= Expect no match 
     a4\=ps,dfa_restart
 No match
 
@@ -6238,8 +6006,7 @@ Subject length lower bound = 3
  0: abc
     xyz\r\nabc
  0: abc
-    ** Failers
-No match
+\= Expect no match
     xyz\rabc
 No match
     xyzabc\r
@@ -6260,8 +6027,7 @@ Last code unit = 'c'
 Subject length lower bound = 3
     xyz\r\nabclf>
  0: abc
-    ** Failers
-No match
+\= Expect no match
     xyz\nabclf
 No match
     xyz\rabclf
@@ -6276,8 +6042,7 @@ Last code unit = 'c'
 Subject length lower bound = 3
     xyz\rabc
  0: abc
-    ** Failers
-No match
+\= Expect no match
     xyz\nabc
 No match
     xyz\r\nabc
@@ -6387,50 +6152,49 @@ Subject length lower bound = 5
  3: a
 
 /(a|)*\d/
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-No match
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
-
-/(?>a|)*\d/
+\= Expect no match
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 No match
+
+/(?>a|)*\d/
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
-
-/(?:a|)*\d/
+\= Expect no match
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 No match
+
+/(?:a|)*\d/
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
+\= Expect no match
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+No match
 
 /^a.b/newline=lf
     a\rb
  0: a\x0db
-    ** Failers
-No match
+\= Expect no match
     a\nb
 No match
 
 /^a.b/newline=cr
     a\nb
  0: a\x0ab
-    ** Failers
-No match
+\= Expect no match
     a\rb
 No match
 
 /^a.b/newline=anycrlf
     a\x85b
  0: a\x85b
-    ** Failers
-No match
+\= Expect no match
     a\rb
 No match
 
 /^a.b/newline=any
-    ** Failers
-No match
+\= Expect no match
     a\nb
 No match
     a\rb
@@ -6471,8 +6235,7 @@ No match
  0: a\x0cb
     a\x85b   
  0: a\x85b
-    ** Failers
-No match
+\= Expect no match
     a\n\rb    
 No match
 
@@ -6513,8 +6276,7 @@ No match
  0: a\x0a\x0db
     a\n\r\x85\x0cb 
  0: a\x0a\x0d\x85\x0cb
-    ** Failers
-No match
+\= Expect no match
     ab  
 No match
     
@@ -6533,8 +6295,7 @@ No match
  0: a\x0a\x0d\x0a\x0db
     a\n\n\r\nb 
  0: a\x0a\x0a\x0d\x0ab
-    ** Failers
-No match
+\= Expect no match
     a\n\n\n\rb
 No match
     a\r
@@ -6543,8 +6304,7 @@ No match
 /.+foo/
     afoo
  0: afoo
-    ** Failers 
-No match
+\= Expect no match 
     \r\nfoo 
 No match
     \nfoo 
@@ -6555,16 +6315,14 @@ No match
  0: afoo
     \nfoo 
  0: \x0afoo
-    ** Failers 
-No match
+\= Expect no match 
     \r\nfoo 
 No match
 
 /.+foo/newline=any
     afoo
  0: afoo
-    ** Failers 
-No match
+\= Expect no match 
     \nfoo 
 No match
     \r\nfoo 
@@ -6583,16 +6341,14 @@ No match
  0: 
     abc\n\rxyz  
  0: 
-    ** Failers 
-No match
+\= Expect no match 
     abc\r\nxyz
 No match
 
 /^X/m
     XABC
  0: X
-    ** Failers 
-No match
+\= Expect no match 
     XABC\=notbol
 No match
 
@@ -6639,8 +6395,7 @@ No match
  0: abcabc
     xyzabc 
  0: xyzabc
-    ** Failers 
-No match
+\= Expect no match 
     xyzxyz 
 No match
  
@@ -6649,8 +6404,7 @@ No match
  0: X X\x0a
     X\x09X\x0b
  0: X\x09X\x0b
-    ** Failers
-No match
+\= Expect no match
     \xa0 X\x0a   
 No match
     
@@ -6661,8 +6415,7 @@ No match
  0: \x09 \xa0\x0a\x0b\x0c\x0d
     \x09\x20\xa0\x0a\x0b\x0c
  0: \x09 \xa0\x0a\x0b\x0c
-    ** Failers 
-No match
+\= Expect no match 
     \x09\x20\xa0\x0a\x0b
 No match
      
@@ -6682,8 +6435,7 @@ No match
  0: XNNNYZ
     >  X NYQZ
  0:   X NYQZ
-    ** Failers
-No match
+\= Expect no match
     >XYZ   
 No match
     >  X NY Z
@@ -6696,6 +6448,7 @@ No match
  0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
 
 /.+A/newline=crlf
+\= Expect no match
     \r\nA
 No match
     
@@ -6723,8 +6476,7 @@ Subject length lower bound = 3
  0: a\x0ab
     a\r\nb
  0: a\x0d\x0ab
-    ** Failers
-No match
+\= Expect no match
     a\x85b
 No match
     a\x0bb     
@@ -6759,8 +6511,7 @@ Subject length lower bound = 2
  0: a\x0ab
     a\r\nb
  0: a\x0d\x0ab
-    ** Failers
-No match
+\= Expect no match
     a\x85b
 No match
     a\x0bb     
@@ -6795,12 +6546,11 @@ Subject length lower bound = 4
  0: a\x0a\x0d\x0db
     a\r\n\r\n\r\n\r\nb
  0: a\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0ab
-    ** Failers
+\= Expect no match
+    a\x0b\x0bb     
 No match
     a\x85\x85b
 No match
-    a\x0b\0bb     
-No match
 
 /a\R{2,4}b/I,bsr=unicode
 Capturing subpattern count = 0
@@ -6816,10 +6566,9 @@ Subject length lower bound = 4
  0: a\x0d\x0a\x0a\x0d\x0db
     a\x85\x85b
  0: a\x85\x85b
-    a\x0b\0bb     
-No match
-    ** Failers 
-No match
+    a\x0b\x0bb     
+ 0: a\x0b\x0bb
+\= Expect no match 
     a\r\r\r\r\rb 
 No match
     
@@ -6828,20 +6577,17 @@ No match
  0: abc
 
 /a[]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
-    ** Failers
-No match
+\= Expect no match
     ab
 No match
 
 /a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
-    ** Failers
-No match
+\= Expect no match
     ab 
 No match
 
 /a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
-    ** Failers
-No match
+\= Expect no match
     ab 
 No match
 
@@ -6850,8 +6596,7 @@ No match
  0: aXb
     a\nb 
  0: a\x0ab
-    ** Failers
-No match
+\= Expect no match
     ab  
 No match
     
@@ -6860,16 +6605,14 @@ No match
  0: aXb
     a\nX\nXb 
  0: a\x0aX\x0aXb
-    ** Failers
-No match
+\= Expect no match
     ab  
 No match
 
 /X$/dollar_endonly
     X
  0: X
-    ** Failers 
-No match
+\= Expect no match 
     X\n 
 No match
 
@@ -6894,8 +6637,7 @@ No match
  +2    ^ ^     z
  +3    ^  ^    
  0: xyz
-  ** Failers 
-No match
+\= Expect no match 
   abc
 No match
   abcxypqr  
@@ -6912,20 +6654,7 @@ No match
  +2    ^ ^     z
  +3    ^  ^    
  0: xyz
-  ** Failers 
---->** Failers
- +0 ^              x
- +0  ^             x
- +0   ^            x
- +0    ^           x
- +0     ^          x
- +0      ^         x
- +0       ^        x
- +0        ^       x
- +0         ^      x
- +0          ^     x
- +0           ^    x
-No match
+\= Expect no match 
   abc
 --->abc
  +0 ^       x
@@ -7018,12 +6747,14 @@ Partial match: 123999
  0: 999Y
 
 /Z(*F)/
+\= Expect no match 
     Z\=ps
 No match
     ZA\=ps
 No match
     
 /Z(?!)/
+\= Expect no match 
     Z\=ps
 No match
     ZA\=ps
@@ -7056,6 +6787,7 @@ Partial match: dogs
 /Z(*F)Q|ZXY/
     Z\=ps
 Partial match: Z
+\= Expect no match 
     ZA\=ps
 No match
     X\=ps
@@ -7124,8 +6856,7 @@ Subject length lower bound = 3
  0: abc
     the quick xyz brown fox 
  0: xyz
-    ** Failers
-No match
+\= Expect no match
     thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd
 No match
 
@@ -7137,8 +6868,7 @@ Subject length lower bound = 0
  0: abc
     the quick xyz brown fox
  0: xyz
-    ** Failers
-No match
+\= Expect no match
     thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd
 No match
 
@@ -7184,8 +6914,7 @@ Partial match: abcde
  0: BC
     CCD
  0: CC
-    ** Failers
-No match
+\= Expect no match
     CAD   
 No match
 
@@ -7194,8 +6923,7 @@ No match
  0: CC
     BCD 
  0: BC
-    ** Failers
-No match
+\= Expect no match
     ABCD
 No match
     CAD
@@ -7208,8 +6936,6 @@ No match
 Failed: error -42: pattern contains an item that is not supported for DFA matching
     
 /^(?=a(*SKIP)b|ac)/
-    ** Failers
-No match
     ac
 Failed: error -42: pattern contains an item that is not supported for DFA matching
     
@@ -7220,10 +6946,6 @@ Failed: error -42: pattern contains an item that is not supported for DFA matchi
 /^(?=a(*PRUNE)b)/
     ab  
 Failed: error -42: pattern contains an item that is not supported for DFA matching
-    ** Failers 
-No match
-    ac
-Failed: error -42: pattern contains an item that is not supported for DFA matching
 
 /^(?(?!a(*SKIP)b))/
     ac
@@ -7281,12 +7003,13 @@ Partial match: abc
 Partial match: abc
 
 /abc\B/
-    abc
-No match
     abc\=ps
 Partial match: abc
     abc\=ph
 Partial match: abc
+\= Expect no match 
+    abc
+No match
 
 /.+/
     abc\=offset=0
@@ -7295,18 +7018,19 @@ Partial match: abc
  0: bc
     abc\=offset=2
  0: c
-    abc\=offset=3
-No match
+\= Bad offsets
     abc\=offset=4
 Failed: error -33: bad offset value
     abc\=offset=-4 
 ** Invalid value in 'offset=-4'
+\= Expect no match 
+    abc\=offset=3
+No match
 
 /^(?:a)++\w/
      aaaab
  0: aaaab
-     ** Failers 
-No match
+\= Expect no match 
      aaaa 
 No match
      bbb 
@@ -7318,8 +7042,7 @@ No match
  1: aa
      aaaa 
  0: aa
-     ** Failers 
-No match
+\= Expect no match 
      bbb 
 No match
 
@@ -7328,16 +7051,14 @@ No match
  0: aaaab
      bbb 
  0: b
-     ** Failers 
-No match
+\= Expect no match 
      aaaa 
 No match
 
 /^(a)++\w/
      aaaab
  0: aaaab
-     ** Failers 
-No match
+\= Expect no match 
      aaaa 
 No match
      bbb 
@@ -7346,8 +7067,7 @@ No match
 /^(a|)++\w/
      aaaab
  0: aaaab
-     ** Failers 
-No match
+\= Expect no match 
      aaaa 
 No match
      bbb 
@@ -7357,8 +7077,7 @@ No match
     abcabcabc
  0: abc
  0+ abcabc
-    ** Failers
-No match
+\= Expect no match
     xyz  
 No match
     
@@ -7366,8 +7085,7 @@ No match
     abcabcabc
  0: abc
  0+ abcabc
-    ** Failers
-No match
+\= Expect no match
     xyz  
 No match
     
@@ -7375,8 +7093,7 @@ No match
     abcabcabc
  0: abc
  0+ abcabc
-    ** Failers
-No match
+\= Expect no match
     xyz  
 No match
     
@@ -7385,8 +7102,7 @@ No match
  0: xyz
 
 /(?=abc){1}xyz/
-    ** Failers
-No match
+\= Expect no match
     xyz 
 No match
     
@@ -7458,14 +7174,6 @@ Matched, but offsets vector is too small to show all matches
  2: aa
  3: a
 
-/ab\Cde/
-    abXde
- 0: abXde
-    
-/(?<=ab\Cde)X/
-    abZdeX
- 0: X
-
 /^\R/
     \r\=ps
  0: \x0d
@@ -7922,6 +7630,7 @@ Callout (5): 'x\x00z'
 /(?(?!)a|b)/
     bbb
  0: b
+\= Expect no match
     aaa 
 No match
 
@@ -7938,4 +7647,30 @@ No match
  0: 
  0: 
 
+/abc/use_offset_limit
+    1234abcde\=offset_limit=100
+ 0: abc
+    1234abcde\=offset_limit=9
+ 0: abc
+    1234abcde\=offset_limit=4
+ 0: abc
+    1234abcde\=offset_limit=4,offset=4
+ 0: abc
+\= Expect no match
+    1234abcde\=offset_limit=4,offset=5
+No match
+    1234abcde\=offset_limit=3
+No match
+
+/(?<=abc)/use_offset_limit
+    1234abc\=offset_limit=7
+ 0: 
+\= Expect no match
+    1234abc\=offset_limit=6
+No match
+
+/abcd/null_context
+    abcd\=null_context
+ 0: abcd
+
 # End of testinput6
index a7f6a62bb5a4458bd5af85a0e1171ddbacc4427e..f804185169ab58d6de9d001541b5becf7eac6eba 100644 (file)
@@ -3,6 +3,7 @@
 # used to force DFA matching for all tests.
 
 #subject dfa
+#newline_default LF any anyCRLF
 
 /\x{100}ab/utf
   \x{100}ab
@@ -21,8 +22,7 @@
  0: a\x{100}b
     a\x{100}\x{100}b  
  0: a\x{100}\x{100}b
-    *** Failers 
-No match
+\= Expect no match 
     ab
 No match
      
@@ -33,16 +33,14 @@ No match
  0: X
     \x{300}Xoanon 
  0: X
-    *** Failers 
-No match
+\= Expect no match 
     YXoanon  
 No match
     
 /\BX/utf
     YXoanon
  0: X
-    *** Failers
-No match
+\= Expect no match
     Xoanon
 No match
     +Xoanon    
@@ -57,16 +55,14 @@ No match
  0: X
     FAX 
  0: X
-    *** Failers 
-No match
+\= Expect no match 
     Xoanon  
 No match
     
 /X\B/utf
     Xoanon  
  0: X
-    *** Failers
-No match
+\= Expect no match
     X+oanon
 No match
     ZX\x{300}oanon 
@@ -87,8 +83,7 @@ No match
  0: \x{123}\x{123}4
     \x{400}\x{401}\x{402}6  
  0: \x{400}\x{401}\x{402}6
-    *** Failers
-No match
+\= Expect no match
     d99
 No match
     \x{123}\x{122}4   
@@ -105,8 +100,7 @@ No match
  0: a\x{7f}b
     a\x{100}b 
  0: a\x{100}b
-    *** Failers
-No match
+\= Expect no match
     a\nb  
 No match
 
@@ -117,8 +111,7 @@ No match
  0: a\x{4000}\x{7f}yb
     a\x{4000}\x{100}yb 
  0: a\x{4000}\x{100}yb
-    *** Failers
-No match
+\= Expect no match
     a\x{4000}b 
 No match
     ac\ncb 
@@ -181,8 +174,7 @@ No match
  0: a\x{1234}\x{4321}yb
     a\x{1234}\x{4321}\x{3412}b 
  0: a\x{1234}\x{4321}\x{3412}b
-    *** Failers
-No match
+\= Expect no match
     a\x{1234}b 
 No match
     ac\ncb 
@@ -200,8 +192,7 @@ No match
  1: axxxxb
     a\x{1234}\x{4321}\x{3412}\x{3421}b 
  0: a\x{1234}\x{4321}\x{3412}\x{3421}b
-    *** Failers
-No match
+\= Expect no match
     a\x{1234}b 
 No match
 
@@ -217,8 +208,7 @@ No match
  1: axxxxb
     a\x{1234}\x{4321}\x{3412}\x{3421}b 
  0: a\x{1234}\x{4321}\x{3412}\x{3421}b
-    *** Failers
-No match
+\= Expect no match
     a\x{1234}b 
 No match
 
@@ -237,8 +227,7 @@ No match
  0: axbxxb
     axxxxxbcdefghijb 
  0: axxxxxb
-    *** Failers
-No match
+\= Expect no match
     a\x{1234}b 
 No match
     axxxxxxbcdefghijb 
@@ -259,16 +248,14 @@ No match
  0: axbxxb
     axxxxxbcdefghijb 
  0: axxxxxb
-    *** Failers
-No match
+\= Expect no match
     a\x{1234}b 
 No match
     axxxxxxbcdefghijb 
 No match
 
 /^[a\x{c0}]/utf
-    *** Failers
-No match
+\= Expect no match
     \x{100}
 No match
 
@@ -287,8 +274,7 @@ No match
 /(?:\x{100}){3}b/utf
     \x{100}\x{100}\x{100}b
  0: \x{100}\x{100}\x{100}b
-    *** Failers 
-No match
+\= Expect no match 
     \x{100}\x{100}b
 No match
 
@@ -297,8 +283,7 @@ No match
  0: \x{ab}
     \xc2\xab
  0: \x{ab}
-    *** Failers 
-No match
+\= Expect no match 
     \x00{ab}
 No match
 
@@ -307,8 +292,7 @@ No match
  0: X
     \x{256}XYZ 
  0: X
-    *** Failers
-No match
+\= Expect no match
     XYZ 
 No match
 
@@ -467,8 +451,7 @@ Matched, but offsets vector is too small to show all matches
 /\D+/utf
     12abcd34
  0: abcd
-    *** Failers
- 0: *** Failers
+\= Expect no match
     1234  
 No match
 
@@ -477,8 +460,7 @@ No match
  0: abc
     12ab34
  0: ab
-    *** Failers  
- 0: ***
+\= Expect no match  
     1234
 No match
     12a34  
@@ -490,9 +472,7 @@ No match
  1: ab
     12ab34
  0: ab
-    *** Failers  
- 0: ***
- 1: **
+\= Expect no match  
     1234
 No match
     12a34  
@@ -501,16 +481,13 @@ No match
 /\d+/utf
     12abcd34
  0: 12
-    *** Failers
-No match
 
 /\d{2,3}/utf
     12abcd34
  0: 12
     1234abcd
  0: 123
-    *** Failers  
-No match
+\= Expect no match  
     1.4 
 No match
 
@@ -520,16 +497,14 @@ No match
     1234abcd
  0: 123
  1: 12
-    *** Failers  
-No match
+\= Expect no match  
     1.4 
 No match
 
 /\S+/utf
     12abcd34
  0: 12abcd34
-    *** Failers
- 0: ***
+\= Expect no match
     \    \ 
 No match
 
@@ -538,8 +513,7 @@ No match
  0: 12a
     1234abcd
  0: 123
-    *** Failers
- 0: ***
+\= Expect no match
     \     \  
 No match
 
@@ -550,25 +524,20 @@ No match
     1234abcd
  0: 123
  1: 12
-    *** Failers
- 0: ***
- 1: **
+\= Expect no match
     \     \  
 No match
 
 />\s+</utf
     12>      <34
  0: >      <
-    *** Failers
-No match
 
 />\s{2,3}</utf
     ab>  <cd
  0: >  <
     ab>   <ce
  0: >   <
-    *** Failers
-No match
+\= Expect no match
     ab>    <cd 
 No match
 
@@ -577,16 +546,14 @@ No match
  0: >  <
     ab>   <ce
  0: >   <
-    *** Failers
-No match
+\= Expect no match
     ab>    <cd 
 No match
 
 /\w+/utf
     12      34
  0: 12
-    *** Failers
- 0: Failers
+\= Expect no match
     +++=*! 
 No match
 
@@ -595,8 +562,7 @@ No match
  0: ab
     abcd ce
  0: abc
-    *** Failers
- 0: Fai
+\= Expect no match
     a.b.c
 No match
 
@@ -606,17 +572,14 @@ No match
     abcd ce
  0: abc
  1: ab
-    *** Failers
- 0: Fai
- 1: Fa
+\= Expect no match
     a.b.c
 No match
 
 /\W+/utf
     12====34
  0: ====
-    *** Failers
- 0: *** 
+\= Expect no match
     abcd 
 No match
 
@@ -625,8 +588,7 @@ No match
  0: ===
     ab==cd
  0: ==
-    *** Failers
- 0: ***
+\= Expect no match
     a.b.c
 No match
 
@@ -636,9 +598,7 @@ No match
  1: ==
     ab==cd
  0: ==
-    *** Failers
- 0: ***
- 1: **
+\= Expect no match
     a.b.c
 No match
 
@@ -649,8 +609,6 @@ No match
  0: \x{100}
     \x{100}Z
  0: \x{100}
-    *** Failers 
-No match
 
 /[Z\x{100}]/utf
     Z\x{100}
@@ -659,16 +617,12 @@ No match
  0: \x{100}
     \x{100}Z
  0: \x{100}
-    *** Failers 
-No match
 
 /[\x{100}\x{200}]/utf
    ab\x{100}cd
  0: \x{100}
    ab\x{200}cd
  0: \x{200}
-   *** Failers  
-No match
 
 /[\x{100}-\x{200}]/utf
    ab\x{100}cd
@@ -677,8 +631,6 @@ No match
  0: \x{200}
    ab\x{111}cd 
  0: \x{111}
-   *** Failers  
-No match
 
 /[z-\x{200}]/utf
    ab\x{100}cd
@@ -691,8 +643,6 @@ No match
  0: z
    ab|cd  
  0: |
-   *** Failers  
-No match
 
 /[Q\x{100}\x{200}]/utf
    ab\x{100}cd
@@ -701,8 +651,6 @@ No match
  0: \x{200}
    Q? 
  0: Q
-   *** Failers  
-No match
 
 /[Q\x{100}-\x{200}]/utf
    ab\x{100}cd
@@ -713,8 +661,6 @@ No match
  0: \x{111}
    Q? 
  0: Q
-   *** Failers  
-No match
 
 /[Qz-\x{200}]/utf
    ab\x{100}cd
@@ -729,8 +675,6 @@ No match
  0: |
    Q? 
  0: Q
-   *** Failers  
-No match
 
 /[\x{100}\x{200}]{1,3}/utf
    ab\x{100}cd
@@ -739,8 +683,6 @@ No match
  0: \x{200}
    ab\x{200}\x{100}\x{200}\x{100}cd
  0: \x{200}\x{100}\x{200}
-   *** Failers  
-No match
 
 /[\x{100}\x{200}]{1,3}?/utf
    ab\x{100}cd
@@ -751,8 +693,6 @@ No match
  0: \x{200}\x{100}\x{200}
  1: \x{200}\x{100}
  2: \x{200}
-   *** Failers  
-No match
 
 /[Q\x{100}\x{200}]{1,3}/utf
    ab\x{100}cd
@@ -761,8 +701,6 @@ No match
  0: \x{200}
    ab\x{200}\x{100}\x{200}\x{100}cd
  0: \x{200}\x{100}\x{200}
-   *** Failers  
-No match
 
 /[Q\x{100}\x{200}]{1,3}?/utf
    ab\x{100}cd
@@ -773,16 +711,13 @@ No match
  0: \x{200}\x{100}\x{200}
  1: \x{200}\x{100}
  2: \x{200}
-   *** Failers  
-No match
 
 /(?<=[\x{100}\x{200}])X/utf
     abc\x{200}X
  0: X
     abc\x{100}X 
  0: X
-    *** Failers
-No match
+\= Expect no match
     X  
 No match
 
@@ -793,16 +728,14 @@ No match
  0: X
     abQX 
  0: X
-    *** Failers
-No match
+\= Expect no match
     X  
 No match
 
 /(?<=[\x{100}\x{200}]{3})X/utf
     abc\x{100}\x{200}\x{100}X
  0: X
-    *** Failers
-No match
+\= Expect no match
     abc\x{200}X
 No match
     X  
@@ -815,8 +748,7 @@ No match
  0: \x{150}X
     \x{500}X 
  0: \x{500}X
-    *** Failers
-No match
+\= Expect no match
     \x{100}X
 No match
     \x{200}X   
@@ -829,8 +761,7 @@ No match
  0: \x{150}X
     \x{500}X 
  0: \x{500}X
-    *** Failers
-No match
+\= Expect no match
     \x{100}X
 No match
     \x{200}X   
@@ -843,8 +774,7 @@ No match
  0: AX
     \x{500}X 
  0: \x{500}X
-    *** Failers
-No match
+\= Expect no match
     \x{100}X
 No match
     \x{150}X
@@ -859,8 +789,7 @@ No match
  0: Z
     \x{100}
  0: \x{100}
-    *** Failers
-No match
+\= Expect no match
     \x{102}
 No match
     y    
@@ -885,23 +814,28 @@ No match
  0: \x{123}
 
 /^[ac]*b/utf
-  xb
+\= Expect no match
+    xb
 No match
 
 /^[ac\x{100}]*b/utf
-  xb
+\= Expect no match
+    xb
 No match
 
 /^[^x]*b/i,utf
-  xb
+\= Expect no match
+    xb
 No match
 
 /^[^x]*b/utf
-  xb
+\= Expect no match
+    xb
 No match
   
 /^\d*b/utf
-  xb 
+\= Expect no match
+    xb 
 No match
 
 /(|a)/g,utf
@@ -967,8 +901,7 @@ No match
  0: a\x{2028}b
     a\x{2029}b 
  0: a\x{2029}b
-    ** Failers
-No match
+\= Expect no match
     a\n\rb    
 No match
 
@@ -1009,8 +942,7 @@ No match
  0: a\x{0a}\x{0d}b
     a\n\r\x{85}\x0cb 
  0: a\x{0a}\x{0d}\x{85}\x{0c}b
-    ** Failers
-No match
+\= Expect no match
     ab  
 No match
 
@@ -1029,8 +961,7 @@ No match
  0: a\x{0a}\x{0d}\x{0a}\x{0d}b
     a\n\n\r\nb 
  0: a\x{0a}\x{0a}\x{0d}\x{0a}b
-    ** Failers
-No match
+\= Expect no match
     a\n\n\n\rb
 No match
     a\r
@@ -1059,8 +990,7 @@ No match
  0: X X\x{0a}
     X\x09X\x0b
  0: X\x{09}X\x{0b}
-    ** Failers
-No match
+\= Expect no match
     \x{a0} X\x0a   
 No match
     
@@ -1073,8 +1003,7 @@ No match
  1: \x{09} \x{a0}\x{0a}\x{0b}\x{0c}
     \x09\x20\x{a0}\x0a\x0b\x0c
  0: \x{09} \x{a0}\x{0a}\x{0b}\x{0c}
-    ** Failers 
-No match
+\= Expect no match 
     \x09\x20\x{a0}\x0a\x0b
 No match
      
@@ -1083,8 +1012,7 @@ No match
  0: \x{3001}\x{3000}\x{2030}\x{2028}
     X\x{180e}X\x{85}
  0: X\x{180e}X\x{85}
-    ** Failers
-No match
+\= Expect no match
     \x{2009} X\x0a   
 No match
     
@@ -1097,8 +1025,7 @@ No match
  1: \x{09}\x{205f}\x{a0}\x{0a}\x{2029}\x{0c}
     \x09\x20\x{202f}\x0a\x0b\x0c
  0: \x{09} \x{202f}\x{0a}\x{0b}\x{0c}
-    ** Failers 
-No match
+\= Expect no match 
     \x09\x{200a}\x{a0}\x{2028}\x0b
 No match
      
@@ -1115,8 +1042,7 @@ Subject length lower bound = 3
  0: a\x{0a}b
     a\r\nb
  0: a\x{0d}\x{0a}b
-    ** Failers
-No match
+\= Expect no match
     a\x{85}b
 No match
     a\x0bb     
@@ -1153,8 +1079,7 @@ Subject length lower bound = 2
  0: a\x{0a}b
     a\r\nb
  0: a\x{0d}\x{0a}b
-    ** Failers
-No match
+\= Expect no match
     a\x{85}b
 No match
     a\x0bb     
@@ -1216,13 +1141,6 @@ Partial match: abcde
     the cat\=ph
 Partial match: the cat
 
-/ab\Cde/utf
-    abXde
-Failed: error -42: pattern contains an item that is not supported for DFA matching
-
-/(?<=ab\Cde)X/utf
-Failed: error 136 at offset 10: \C is not allowed in a lookbehind assertion
-
 /./newline=crlf,utf
     \r\=ps
  0: \x{0d}
@@ -1269,8 +1187,7 @@ Partial match: \x{0d}\x{0d}\x{0d}
 /\pL\P{Nd}/utf
     AB
  0: AB
-    *** Failers
- 0: Fa
+\= Expect no match
     A0
 No match
     00
@@ -1283,8 +1200,7 @@ No match
  0: A\x{300}B
     A\x{300}\x{301}\x{302}BC
  0: A\x{300}\x{301}\x{302}B
-    *** Failers
- 0: **
+\= Expect no match
     \x{300}
 No match
 
@@ -1295,8 +1211,7 @@ No match
  0: A\x{300}B\x{300}\x{301}
     A\x{300}\x{301}\x{302}BC
  0: A\x{300}\x{301}\x{302}B
-    *** Failers
- 0: **
+\= Expect no match
     \x{300}
 No match
 
@@ -1305,16 +1220,13 @@ No match
  0: abcd
     a
  0: a
-    *** Failers
-No match
 
 /^\PL+/utf
     1234
  0: 1234
     =
  0: =
-    *** Failers
- 0: *** 
+\= Expect no match
     abcd
 No match
 
@@ -1327,8 +1239,6 @@ No match
  0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}
     a
  0: a
-    *** Failers
- 0: *** Failers
     \x{300}\x{301}\x{302}
  0: \x{300}\x{301}\x{302}
 
@@ -1341,20 +1251,17 @@ No match
  0: A\x{300}abc
     \x{300}abc
  0: \x{300}abc
-    *** Failers
-No match
 
 /^\X?abc/utf
     abc
  0: abc
     A\x{300}abc
  0: A\x{300}abc
-    *** Failers
-No match
-    A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz
-No match
     \x{300}abc
  0: \x{300}abc
+\= Expect no match
+    A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz
+No match
 
 /\X*abc/utf
     abc
@@ -1365,8 +1272,6 @@ No match
  0: A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abc
     \x{300}abc
  0: \x{300}abc
-    *** Failers
-No match
 
 /^\X*abc/utf
     abc
@@ -1375,8 +1280,6 @@ No match
  0: A\x{300}abc
     A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz
  0: A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abc
-    *** Failers
-No match
     \x{300}abc
  0: \x{300}abc
 
@@ -1385,8 +1288,7 @@ No match
  0: A=b
     =c
  0: =c
-    *** Failers
-No match
+\= Expect no match
     1=2
 No match
     AAAA=b
@@ -1397,8 +1299,7 @@ No match
  0: AAAA=b
     =c
  0: =c
-    *** Failers
-No match
+\= Expect no match
     1=2
 No match
 
@@ -1407,8 +1308,7 @@ No match
  0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X
     A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X
  0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X
-    *** Failers
-No match
+\= Expect no match
     X
 No match
     A\x{300}\x{301}\x{302}X
@@ -1421,64 +1321,56 @@ No match
  0: \x{7f}\x{c0}\x{30f}\x{660}\x{66c}\x{f01}\x{1680}<
     \np\x{300}9!\$ <
  0: \x{0a}p\x{300}9!$ <
-    ** Failers
-No match
+\= Expect no match
     ap\x{300}9!\$ <
 No match
   
 /^\PC/utf
     X
  0: X
-    ** Failers
- 0: *
+\= Expect no match
     \x7f
 No match
   
 /^\PL/utf
     9
  0: 9
-    ** Failers
- 0: *
+\= Expect no match
     \x{c0}
 No match
   
 /^\PM/utf
     X
  0: X
-    ** Failers
- 0: *
+\= Expect no match
     \x{30f}
 No match
   
 /^\PN/utf
     X
  0: X
-    ** Failers
- 0: *
+\= Expect no match
     \x{660}
 No match
   
 /^\PP/utf
     X
  0: X
-    ** Failers
-No match
+\= Expect no match
     \x{66c}
 No match
   
 /^\PS/utf
     X
  0: X
-    ** Failers
- 0: *
+\= Expect no match
     \x{f01}
 No match
   
 /^\PZ/utf
     X
  0: X
-    ** Failers
- 0: *
+\= Expect no match
     \x{1680}
 No match
     
@@ -1487,8 +1379,7 @@ No match
  0: \x{17}
     \x{09f}
  0: \x{9f}
-    ** Failers
-No match
+\= Expect no match
     \x{0600}
 No match
   
@@ -1507,38 +1398,33 @@ No match
  0: \x{2068}
     \x{2069}
  0: \x{2069}
-    ** Failers
-No match
+\= Expect no match
     \x{09f}
 No match
   
 /^\p{Cn}/utf
-    ** Failers
-No match
+\= Expect no match
     \x{09f}
 No match
   
 /^\p{Co}/utf
     \x{f8ff}
  0: \x{f8ff}
-    ** Failers
-No match
+\= Expect no match
     \x{09f}
 No match
   
 /^\p{Cs}/utf
     \x{dfff}\=no_utf_check
  0: \x{dfff}
-    ** Failers
-No match
+\= Expect no match
     \x{09f}
 No match
   
 /^\p{Ll}/utf
     a
  0: a
-    ** Failers
-No match
+\= Expect no match
     Z
 No match
     \x{e000}
@@ -1547,16 +1433,14 @@ No match
 /^\p{Lm}/utf
     \x{2b0}
  0: \x{2b0}
-    ** Failers
-No match
+\= Expect no match
     a
 No match
   
 /^\p{Lo}/utf
     \x{1bb}
  0: \x{1bb}
-    ** Failers
-No match
+\= Expect no match
     a
 No match
     \x{2b0}
@@ -1565,8 +1449,7 @@ No match
 /^\p{Lt}/utf
     \x{1c5}
  0: \x{1c5}
-    ** Failers
-No match
+\= Expect no match
     a
 No match
     \x{2b0}
@@ -1575,16 +1458,14 @@ No match
 /^\p{Lu}/utf
     A
  0: A
-    ** Failers
-No match
+\= Expect no match
     \x{2b0}
 No match
   
 /^\p{Mc}/utf
     \x{903}
  0: \x{903}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{300}
@@ -1593,8 +1474,7 @@ No match
 /^\p{Me}/utf
     \x{488}
  0: \x{488}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{903}
@@ -1607,8 +1487,7 @@ No match
  0: \x{300}
     \x{1a1b}
  0: \x{1a1b}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{903}
@@ -1654,16 +1533,14 @@ Matched, but offsets vector is too small to show all matches
  7: \x{966}\x{967}\x{968}
  8: \x{966}\x{967}
  9: \x{966}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
   
 /^\p{Nl}/utf
     \x{16ee}
  0: \x{16ee}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{966}
@@ -1674,8 +1551,7 @@ No match
  0: \x{b2}
     \x{b3}
  0: \x{b3}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{16ee}
@@ -1686,8 +1562,7 @@ No match
  0: _
     \x{203f}
  0: \x{203f}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     -
@@ -1700,8 +1575,7 @@ No match
  0: -
     \x{58a}
  0: \x{58a}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{203f}
@@ -1720,8 +1594,7 @@ No match
  0: \x{2309}
     \x{230b}
  0: \x{230b}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{203f}
@@ -1740,8 +1613,7 @@ No match
  0: \x{bb}
     \x{2019}
  0: \x{2019}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{203f}
@@ -1752,8 +1624,7 @@ No match
  0: \x{ab}
     \x{2018}
  0: \x{2018}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{203f}
@@ -1764,8 +1635,7 @@ No match
  0: !
     \x{37e}
  0: \x{37e}
-    ** Failers
- 0: *
+\= Expect no match
     X
 No match
     \x{203f}
@@ -1784,8 +1654,7 @@ No match
  0: \x{2308}
     \x{230a}
  0: \x{230a}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     )
@@ -1802,8 +1671,7 @@ No match
  0: $\x{a2}\x{a3}\x{a4}\x{a5}
     \x{9f2}
  0: \x{9f2}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{2c2}
@@ -1812,8 +1680,7 @@ No match
 /^\p{Sk}/utf
     \x{2c2}
  0: \x{2c2}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{9f2}
@@ -1822,8 +1689,7 @@ No match
 /^\p{Sm}+/utf
     +<|~\x{ac}\x{2044}
  0: +<|~\x{ac}\x{2044}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{9f2}
@@ -1834,8 +1700,7 @@ No match
  0: \x{a6}
     \x{482}
  0: \x{482}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{9f2}
@@ -1844,8 +1709,7 @@ No match
 /^\p{Zl}/utf
     \x{2028}
  0: \x{2028}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{2029}
@@ -1854,8 +1718,7 @@ No match
 /^\p{Zp}/utf
     \x{2029}
  0: \x{2029}
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     \x{2028}
@@ -1872,8 +1735,7 @@ No match
  0: \x{2000}
     \x{2001}
  0: \x{2001}
-    ** Failers
-No match
+\= Expect no match
     \x{2028}
 No match
     \x{200d}
@@ -1948,8 +1810,7 @@ No match
  0: \x{660}\x{661}\x{662}ABC
   
 /\p{Nd}*+(....)/utf
-      ** Failers
- 0: ** F
+\= Expect no match
       \x{660}\x{661}\x{662}ABC
 No match
   
@@ -1958,8 +1819,7 @@ No match
  0: A
     a\x{10a0}B
  0: \x{10a0}
-    ** Failers
- 0: F
+\= Expect no match
     a
 No match
     \x{1d00}
@@ -1968,16 +1828,14 @@ No match
 /\p{^Lu}/i,utf
     1234
  0: 1
-    ** Failers
- 0: *
+\= Expect no match
     ABC
 No match
 
 /\P{Lu}/i,utf
     1234
  0: 1
-    ** Failers
- 0: *
+\= Expect no match
     ABC
 No match
 
@@ -1988,8 +1846,7 @@ No match
  0: XYZ
     ABA\x{660}XYZpqr
  0: XYZ
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     XYZ
@@ -2002,8 +1859,7 @@ No match
  0: XYZ
     XYZ
  0: XYZ
-    ** Failers
-No match
+\= Expect no match
     WXYZ
 No match
 
@@ -2018,22 +1874,18 @@ No match
  0: 12-34
     12+\x{661}-34
  0: 12+\x{661}-34
-    ** Failers
-No match
+\= Expect no match
     abcd
 No match
 
 /[\P{Nd}]+/utf
     abcd
  0: abcd
-    ** Failers
- 0: ** Failers
+\= Expect no match
     1234
 No match
 
 /\D+/utf,no_auto_possess
-    11111111111111111111111111111111111111111111111111111111111111111111111
-No match
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 Matched, but offsets vector is too small to show all matches
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -2051,10 +1903,11 @@ Matched, but offsets vector is too small to show all matches
 12: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 14: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-     
-/\P{Nd}+/utf,no_auto_possess
+\= Expect no match
     11111111111111111111111111111111111111111111111111111111111111111111111
 No match
+     
+/\P{Nd}+/utf,no_auto_possess
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 Matched, but offsets vector is too small to show all matches
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -2072,10 +1925,11 @@ Matched, but offsets vector is too small to show all matches
 12: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 14: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-
-/[\D]+/utf,no_auto_possess
+\= Expect no match
     11111111111111111111111111111111111111111111111111111111111111111111111
 No match
+
+/[\D]+/utf,no_auto_possess
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 Matched, but offsets vector is too small to show all matches
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -2093,10 +1947,11 @@ Matched, but offsets vector is too small to show all matches
 12: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 14: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-
-/[\P{Nd}]+/utf,no_auto_possess
+\= Expect no match
     11111111111111111111111111111111111111111111111111111111111111111111111
 No match
+
+/[\P{Nd}]+/utf,no_auto_possess
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 Matched, but offsets vector is too small to show all matches
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -2114,10 +1969,11 @@ Matched, but offsets vector is too small to show all matches
 12: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 14: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-
-/[\D\P{Nd}]+/utf,no_auto_possess
+\= Expect no match
     11111111111111111111111111111111111111111111111111111111111111111111111
 No match
+
+/[\D\P{Nd}]+/utf,no_auto_possess
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 Matched, but offsets vector is too small to show all matches
  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -2135,6 +1991,9 @@ Matched, but offsets vector is too small to show all matches
 12: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 14: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+\= Expect no match
+    11111111111111111111111111111111111111111111111111111111111111111111111
+No match
 
 /\pL/utf
     a
@@ -2153,8 +2012,7 @@ Matched, but offsets vector is too small to show all matches
  0: A
     aZ
  0: Z
-    ** Failers
- 0: F
+\= Expect no match
     abc
 No match
 
@@ -2163,8 +2021,7 @@ No match
  0: A
     aZ
  0: Z
-    ** Failers
- 0: F
+\= Expect no match
     abc
 No match
 
@@ -2173,8 +2030,7 @@ No match
  0: a
     Az
  0: z
-    ** Failers
- 0: a
+\= Expect no match
     ABC
 No match
 
@@ -2183,8 +2039,7 @@ No match
  0: a
     Az
  0: z
-    ** Failers
- 0: a
+\= Expect no match
     ABC
 No match
 
@@ -2203,8 +2058,7 @@ No match
 /A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
  0: A\x{391}\x{10427}\x{ff3a}\x{1fb0}
-    ** Failers
-No match
+\= Expect no match
     a\x{391}\x{10427}\x{ff3a}\x{1fb0}
 No match
     A\x{3b1}\x{10427}\x{ff3a}\x{1fb0}
@@ -2269,8 +2123,7 @@ No match
  0: \x{105}
     \x{109}
  0: \x{109}
-    ** Failers
-No match
+\= Expect no match
     \x{100}
 No match
     \x{10a}
@@ -2295,8 +2148,7 @@ No match
  0: \x{100}
     \x{101}
  0: \x{101}
-    ** Failers
-No match
+\= Expect no match
     \x{102}
 No match
     Y
@@ -2313,8 +2165,6 @@ No match
  0: A\x{300}
     A\x{300}\x{301}\x{302}BC
  0: A\x{300}\x{301}\x{302}
-    *** Failers
- 0: *
     \x{300}
  0: \x{300}
 
@@ -2359,8 +2209,7 @@ No match
  4: A
 
 /^\X(.)/utf
-    *** Failers
- 0: **
+\= Expect no match
     A\x{300}\x{301}\x{302}
 No match
 
@@ -2393,8 +2242,7 @@ No match
  0: 12X
     123X
  0: 123X
-    *** Failers
-No match
+\= Expect no match
     X
 No match
     1X
@@ -2411,16 +2259,14 @@ No match
 /^\p{Han}+/utf
     \x{2e81}\x{3007}\x{2f804}\x{31a0}
  0: \x{2e81}\x{3007}\x{2f804}
-    ** Failers
-No match
+\= Expect no match
     \x{2e7f}
 No match
 
 /^\P{Katakana}+/utf
     \x{3105}
  0: \x{3105}
-    ** Failers
- 0: ** Failers
+\= Expect no match
     \x{30ff}
 No match
 
@@ -2429,16 +2275,14 @@ No match
  0: \x{6e9}
     \x{060b}
  0: \x{60b}
-    ** Failers
-No match
+\= Expect no match
     X\x{06e9}
 No match
 
 /^[\P{Yi}]/utf
     \x{2f800}
  0: \x{2f800}
-    ** Failers
- 0: *
+\= Expect no match
     \x{a014}
 No match
     \x{a4c6}
@@ -2449,14 +2293,12 @@ No match
  0: AX
     \x{1234}XYZ
  0: \x{1234}X
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     
 /^\P{Any}X/utf
-    ** Failers
-No match
+\= Expect no match
     AX
 No match
     
@@ -2467,16 +2309,14 @@ No match
  0: AX
     \x{1234}XYZ
  0: \x{1234}X
-    ** Failers
-No match
+\= Expect no match
     ABXYZ
 No match
 
 /^\P{Any}?X/utf
     XYZ
  0: X
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     \x{1234}XYZ
@@ -2491,14 +2331,12 @@ No match
  0: \x{1234}X
     A\x{1234}XYZ
  0: A\x{1234}X
-    ** Failers
-No match
+\= Expect no match
     XYZ
 No match
 
 /^\P{Any}+X/utf
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     \x{1234}XYZ
@@ -2517,14 +2355,11 @@ No match
  0: \x{1234}X
     A\x{1234}XYZ
  0: A\x{1234}X
-    ** Failers
-No match
 
 /^\P{Any}*X/utf
     XYZ
  0: X
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     \x{1234}XYZ
@@ -2537,14 +2372,12 @@ No match
  0: AX
     \x{1234}XYZ
  0: \x{1234}X
-    ** Failers
-No match
+\= Expect no match
     X
 No match
     
 /^[\P{Any}]X/utf
-    ** Failers
-No match
+\= Expect no match
     AX
 No match
     
@@ -2555,16 +2388,14 @@ No match
  0: AX
     \x{1234}XYZ
  0: \x{1234}X
-    ** Failers
-No match
+\= Expect no match
     ABXYZ
 No match
 
 /^[\P{Any}]?X/utf
     XYZ
  0: X
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     \x{1234}XYZ
@@ -2579,14 +2410,12 @@ No match
  0: \x{1234}X
     A\x{1234}XYZ
  0: A\x{1234}X
-    ** Failers
-No match
+\= Expect no match
     XYZ
 No match
 
 /^[\P{Any}]+X/utf
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     \x{1234}XYZ
@@ -2605,14 +2434,11 @@ No match
  0: \x{1234}X
     A\x{1234}XYZ
  0: A\x{1234}X
-    ** Failers
-No match
 
 /^[\P{Any}]*X/utf
     XYZ
  0: X
-    ** Failers
-No match
+\= Expect no match
     AXYZ
 No match
     \x{1234}XYZ
@@ -2637,8 +2463,7 @@ No match
  0: \x{1234}\x{0a}\x{0d}\x{3456}x
 
 /^\P{Any}{3,5}?/utf
-    ** Failers
-No match
+\= Expect no match
     abcdefgh
 No match
     \x{1234}\n\r\x{3456}xyz
@@ -2651,8 +2476,7 @@ No match
  0: aX
      \x{1c5}XY
  0: \x{1c5}X
-     ** Failers
-No match
+\= Expect no match
      \x{1bb}XY
 No match
      \x{2b0}XY
@@ -2667,8 +2491,7 @@ No match
  0: aX
      \x{1c5}XY
  0: \x{1c5}X
-     ** Failers
-No match
+\= Expect no match
      \x{1bb}XY
 No match
      \x{2b0}XY
@@ -2688,8 +2511,7 @@ No match
      abcDEXypqreXlmn
  0: abcDEXypqreX
  1: abcDEX
-     ** Failers
-No match
+\= Expect no match
      \x{1bb}XY
 No match
      \x{2b0}XY
@@ -2709,8 +2531,7 @@ No match
      abcDEXypqreXlmn
  0: abcDEXypqreX
  1: abcDEX
-     ** Failers
-No match
+\= Expect no match
      \x{1bb}XY
 No match
      \x{2b0}XY
@@ -2730,8 +2551,7 @@ No match
      abcDEXypqreXlmn
  0: abcDEXypqreX
  1: abcDEX
-     ** Failers
-No match
+\= Expect no match
      \x{1bb}XY
 No match
      \x{2b0}XY
@@ -2751,8 +2571,7 @@ No match
      abcDEXypqreXlmn
  0: abcDEXypqreX
  1: abcDEX
-     ** Failers
-No match
+\= Expect no match
      \x{1bb}XY
 No match
      \x{2b0}XY
@@ -2767,8 +2586,7 @@ No match
  0: \x{1bb}X
      \x{2b0}XY
  0: \x{2b0}X
-     ** Failers
-No match
+\= Expect no match
      \x{1c5}XY
 No match
      AXY
@@ -2781,8 +2599,7 @@ No match
  0: \x{1bb}X
      \x{2b0}XY
  0: \x{2b0}X
-     ** Failers
-No match
+\= Expect no match
      \x{1c5}XY
 No match
      AXY
@@ -2804,7 +2621,7 @@ No match
     \x{c0}\x{e0}\x{116}\x{117}
  0: \x{c0}\x{e0}\x{116}\x{117}
 
-/Check property support in non-UTF-8 mode/
+# Check property support in non-UTF-8 mode
  
 /\p{L}{4}/
     123abcdefg
@@ -2825,8 +2642,7 @@ No match
 /\x{a77d}\x{1d79}/utf
     \x{a77d}\x{1d79}
  0: \x{a77d}\x{1d79}
-    ** Failers
-No match
+\= Expect no match
     \x{1d79}\x{a77d}
 No match
 
@@ -2841,16 +2657,14 @@ No match
  0: \x{a6c}
     \x{10a7}
  0: \x{10a7}
-    ** Failers
-No match
+\= Expect no match
     _ABC
 No match
 
 /^\p{Xan}+/utf
     ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  0: ABCD1234\x{6ca}\x{a6c}\x{10a7}
-    ** Failers
-No match
+\= Expect no match
     _ABC
 No match
 
@@ -2873,24 +2687,21 @@ No match
  0: \x{a6c}
     \x{10a7}
  0: \x{10a7}
-    ** Failers
-No match
+\= Expect no match
     _ABC
 No match
  
 /^[\p{Xan}]+/utf
     ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  0: ABCD1234\x{6ca}\x{a6c}\x{10a7}
-    ** Failers
-No match
+\= Expect no match
     _ABC
 No match
 
 /^>\p{Xsp}/utf
     >\x{1680}\x{2028}\x{0b}
  0: >\x{1680}
-    ** Failers
-No match
+\= Expect no match
     \x{0b}
 No match
 
@@ -2951,8 +2762,7 @@ No match
  0: >\x{1680}
     >\x{a0}
  0: >\x{a0}
-    ** Failers
-No match
+\= Expect no match
     \x{0b}
 No match
 
@@ -3006,8 +2816,7 @@ No match
  0: \x{10a7}
     _ABC
  0: _
-    ** Failers
-No match
+\= Expect no match
     []
 No match
 
@@ -3036,8 +2845,7 @@ No match
  0: \x{10a7}
     _ABC
  0: _
-    ** Failers
-No match
+\= Expect no match
     []
 No match
  
@@ -3064,8 +2872,7 @@ No match
 /\b...\B/utf
     abc_
  0: abc
-    ** Failers
- 0: Fai
+\= Expect no match
     \x{37e}abc\x{376}
 No match
     \x{37e}\x{376}\x{371}\x{393}\x{394}
@@ -3170,9 +2977,7 @@ Partial match: AA
     \x{1b04}\x{1b04}X
  0: \x{1b04}\x{1b04}
  0+ X
-    *These match up to the roman letters
- 0: *
- 0+ These match up to the roman letters
+\= These match up to the roman letters
     \x{1111}\x{1111}L,L
  0: \x{1111}\x{1111}
  0+ L,L
@@ -3203,9 +3008,7 @@ Partial match: AA
     \x{ad89}\x{11fe}\x{11fe}LVT, T, T
  0: \x{ad89}\x{11fe}\x{11fe}
  0+ LVT, T, T
-    *These match just the first codepoint (invalid sequence)
- 0: *
- 0+ These match just the first codepoint (invalid sequence)
+\= These match just the first codepoint (invalid sequence)
     \x{1111}\x{11fe}L, T
  0: \x{1111}
  0+ \x{11fe}L, T
@@ -3251,9 +3054,7 @@ Partial match: AA
     \x{11fe}\x{ad89}T, LVT
  0: \x{11fe}
  0+ \x{ad89}T, LVT
-    *Test extend and spacing mark
- 0: *
- 0+ Test extend and spacing mark
+\= Test extend and spacing mark
     \x{1111}\x{ae4c}\x{0711}L, LV, extend
  0: \x{1111}\x{ae4c}\x{711}
  0+ L, LV, extend
@@ -3263,9 +3064,7 @@ Partial match: AA
     \x{1111}\x{ae4c}\x{1b04}\x{0711}\x{1b04}L, LV, spacing mark, extend, spacing mark
  0: \x{1111}\x{ae4c}\x{1b04}\x{711}\x{1b04}
  0+ L, LV, spacing mark, extend, spacing mark
-    *Test CR, LF, and control
- 0: *
- 0+ Test CR, LF, and control
+\= Test CR, LF, and control
     \x0d\x{0711}CR, extend
  0: \x{0d}
  0+ \x{711}CR, extend
@@ -3284,9 +3083,7 @@ Partial match: AA
     \x09\x{1b04}Control, spacingmark
  0: \x{09}
  0+ \x{1b04}Control, spacingmark
-    *There are no Prepend characters, so we can't test Prepend, CR
- 0: *
- 0+ There are no Prepend characters, so we can't test Prepend, CR
+\= There are no Prepend characters, so we can't test Prepend, CR
     
 /^(?>\X{2})X/utf,aftertext
     \x{1111}\x{ae4c}\x{1111}\x{ae4c}X
@@ -3366,7 +3163,6 @@ Partial match: AA
     \x{00c5}\x{00e5}\x{212b}
  0: \x{c5}\x{e5}\x{212b}
 
-
 /\x{01c4}+/i,utf
     \x{01c4}\x{01c5}\x{01c6}
  0: \x{1c4}\x{1c5}\x{1c6}
@@ -3379,7 +3175,6 @@ Partial match: AA
     \x{01c4}\x{01c5}\x{01c6}
  0: \x{1c4}\x{1c5}\x{1c6}
 
-
 /\x{01c7}+/i,utf
     \x{01c7}\x{01c8}\x{01c9}
  0: \x{1c7}\x{1c8}\x{1c9}
@@ -3405,7 +3200,6 @@ Partial match: AA
     \x{01ca}\x{01cb}\x{01cc}
  0: \x{1ca}\x{1cb}\x{1cc}
 
-
 /\x{01f1}+/i,utf
     \x{01f1}\x{01f2}\x{01f3}
  0: \x{1f1}\x{1f2}\x{1f3}
@@ -3418,7 +3212,6 @@ Partial match: AA
     \x{01f1}\x{01f2}\x{01f3}
  0: \x{1f1}\x{1f2}\x{1f3}
 
-
 /\x{0345}+/i,utf
     \x{0345}\x{0399}\x{03b9}\x{1fbe}
  0: \x{345}\x{399}\x{3b9}\x{1fbe}
@@ -3435,7 +3228,6 @@ Partial match: AA
     \x{0345}\x{0399}\x{03b9}\x{1fbe}
  0: \x{345}\x{399}\x{3b9}\x{1fbe}
 
-
 /\x{0392}+/i,utf
     \x{0392}\x{03b2}\x{03d0}
  0: \x{392}\x{3b2}\x{3d0}
@@ -3461,7 +3253,6 @@ Partial match: AA
     \x{0395}\x{03b5}\x{03f5}
  0: \x{395}\x{3b5}\x{3f5}
 
-
 /\x{0398}+/i,utf
     \x{0398}\x{03b8}\x{03d1}\x{03f4}
  0: \x{398}\x{3b8}\x{3d1}\x{3f4}
@@ -3477,7 +3268,6 @@ Partial match: AA
 /\x{03f4}+/i,utf
     \x{0398}\x{03b8}\x{03d1}\x{03f4}
  0: \x{398}\x{3b8}\x{3d1}\x{3f4}
-    
 
 /\x{039a}+/i,utf
     \x{039a}\x{03ba}\x{03f0}
@@ -3491,7 +3281,6 @@ Partial match: AA
     \x{039a}\x{03ba}\x{03f0}
  0: \x{39a}\x{3ba}\x{3f0}
     
-
 /\x{03a0}+/i,utf
     \x{03a0}\x{03c0}\x{03d6}
  0: \x{3a0}\x{3c0}\x{3d6}
@@ -3504,7 +3293,6 @@ Partial match: AA
     \x{03a0}\x{03c0}\x{03d6}
  0: \x{3a0}\x{3c0}\x{3d6}
 
-
 /\x{03a1}+/i,utf
     \x{03a1}\x{03c1}\x{03f1}
  0: \x{3a1}\x{3c1}\x{3f1}
@@ -3517,7 +3305,6 @@ Partial match: AA
     \x{03a1}\x{03c1}\x{03f1}
  0: \x{3a1}\x{3c1}\x{3f1}
 
-
 /\x{03a3}+/i,utf
     \x{03A3}\x{03C2}\x{03C3}
  0: \x{3a3}\x{3c2}\x{3c3}
@@ -3529,7 +3316,6 @@ Partial match: AA
 /\x{03c3}+/i,utf
     \x{03A3}\x{03C2}\x{03C3}
  0: \x{3a3}\x{3c2}\x{3c3}
-    
 
 /\x{03a6}+/i,utf
     \x{03a6}\x{03c6}\x{03d5}
@@ -3543,7 +3329,6 @@ Partial match: AA
     \x{03a6}\x{03c6}\x{03d5}
  0: \x{3a6}\x{3c6}\x{3d5}
 
-
 /\x{03c9}+/i,utf
     \x{03c9}\x{03a9}\x{2126}
  0: \x{3c9}\x{3a9}\x{2126}
@@ -3556,7 +3341,6 @@ Partial match: AA
     \x{03c9}\x{03a9}\x{2126}
  0: \x{3c9}\x{3a9}\x{2126}
     
-
 /\x{1e60}+/i,utf
     \x{1e60}\x{1e61}\x{1e9b}
  0: \x{1e60}\x{1e61}\x{1e9b}
@@ -3569,7 +3353,6 @@ Partial match: AA
     \x{1e60}\x{1e61}\x{1e9b}
  0: \x{1e60}\x{1e61}\x{1e9b}
     
-
 /\x{1e9e}+/i,utf
     \x{1e9e}\x{00df}
  0: \x{1e9e}\x{df}
@@ -3578,7 +3361,6 @@ Partial match: AA
     \x{1e9e}\x{00df}
  0: \x{1e9e}\x{df}
     
-
 /\x{1f88}+/i,utf
     \x{1f88}\x{1f80}
  0: \x{1f88}\x{1f80}
@@ -3599,7 +3381,6 @@ Partial match: AA
     \x{004b}\x{006b}\x{212a}
  0: Kk\x{212a}
 
-
 /\x{0053}+/i,utf
     \x{0053}\x{0073}\x{017f}
  0: Ss\x{17f}
@@ -3613,24 +3394,29 @@ Partial match: AA
  0: Ss\x{17f}
 
 /ist/i,utf
+\= Expect no match
     ikt
 No match
 
 /is+t/i,utf
     iSs\x{17f}t
  0: iSs\x{17f}t
+\= Expect no match
     ikt
 No match
 
 /is+?t/i,utf
+\= Expect no match
     ikt
 No match
 
 /is?t/i,utf
+\= Expect no match
     ikt
 No match
 
 /is{2}t/i,utf
+\= Expect no match
     iskt
 No match
 
@@ -3643,16 +3429,14 @@ No match
  0: `
     \x{1234}abc
  0: \x{1234}
-    ** Failers
-No match
+\= Expect no match
     abc
 No match
 
 /^\p{Xuc}+/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $@`\x{a0}\x{1234}\x{e000}
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
@@ -3664,32 +3448,28 @@ No match
  3: $@`
  4: $@
  5: $
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^\p{Xuc}+?\*/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $@`\x{a0}\x{1234}\x{e000}*
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^\p{Xuc}++/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $@`\x{a0}\x{1234}\x{e000}
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^\p{Xuc}{3,5}/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $@`\x{a0}\x{1234}
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
@@ -3698,32 +3478,28 @@ No match
  0: $@`\x{a0}\x{1234}
  1: $@`\x{a0}
  2: $@`
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^[\p{Xuc}]/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^[\p{Xuc}]+/utf
     $@`\x{a0}\x{1234}\x{e000}**
  0: $@`\x{a0}\x{1234}\x{e000}
-    ** Failers
-No match
+\= Expect no match
     \x{9f}
 No match
 
 /^\P{Xuc}/utf
     abc
  0: a
-    ** Failers
- 0: *
+\= Expect no match
     $abc
 No match
     @abc
@@ -3736,8 +3512,7 @@ No match
 /^[\P{Xuc}]/utf
     abc
  0: a
-    ** Failers
- 0: *
+\= Expect no match
     $abc
 No match
     @abc
diff --git a/testdata/testoutput8-16 b/testdata/testoutput8-16
deleted file mode 100644 (file)
index 0f9fa6a..0000000
+++ /dev/null
@@ -1,852 +0,0 @@
-# These are a few representative patterns whose lengths and offsets are to be
-# shown when the link size is 2. This is just a doublecheck test to ensure the
-# sizes don't go horribly wrong when something is changed. The pattern contents
-# are all themselves checked in other tests. Unicode, including property
-# support, is required for these tests.
-
-#pattern fullbincode,memory
-
-/((?i)b)/
-Memory allocation (code space): 24
-------------------------------------------------------------------
-  0   9 Bra
-  2   5 CBra 1
-  5  /i b
-  7   5 Ket
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/(?s)(.*X|^B)/
-Memory allocation (code space): 38
-------------------------------------------------------------------
-  0  16 Bra
-  2   7 CBra 1
-  5     AllAny*
-  7     X
-  9   5 Alt
- 11     ^
- 12     B
- 14  12 Ket
- 16  16 Ket
- 18     End
-------------------------------------------------------------------
-
-/(?s:.*X|^B)/
-Memory allocation (code space): 36
-------------------------------------------------------------------
-  0  15 Bra
-  2   6 Bra
-  4     AllAny*
-  6     X
-  8   5 Alt
- 10     ^
- 11     B
- 13  11 Ket
- 15  15 Ket
- 17     End
-------------------------------------------------------------------
-
-/^[[:alnum:]]/
-Memory allocation (code space): 46
-------------------------------------------------------------------
-  0  20 Bra
-  2     ^
-  3     [0-9A-Za-z]
- 20  20 Ket
- 22     End
-------------------------------------------------------------------
-
-/#/Ix
-Memory allocation (code space): 10
-------------------------------------------------------------------
-  0   2 Bra
-  2   2 Ket
-  4     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-May match empty string
-Options: extended
-Subject length lower bound = 0
-
-/a#/Ix
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     a
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: extended
-First code unit = 'a'
-Subject length lower bound = 1
-
-/x?+/
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     x?+
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/x++/
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     x++
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/x{1,3}+/
-Memory allocation (code space): 20
-------------------------------------------------------------------
-  0   7 Bra
-  2     x
-  4     x{0,2}+
-  7   7 Ket
-  9     End
-------------------------------------------------------------------
-
-/(x)*+/
-Memory allocation (code space): 26
-------------------------------------------------------------------
-  0  10 Bra
-  2     Braposzero
-  3   5 CBraPos 1
-  6     x
-  8   5 KetRpos
- 10  10 Ket
- 12     End
-------------------------------------------------------------------
-
-/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
-Memory allocation (code space): 142
-------------------------------------------------------------------
-  0  68 Bra
-  2     ^
-  3  63 CBra 1
-  6   5 CBra 2
-  9     a+
- 11   5 Ket
- 13  21 CBra 3
- 16     [ab]+?
- 34  21 Ket
- 36  21 CBra 4
- 39     [bc]+
- 57  21 Ket
- 59   5 CBra 5
- 62     \w*+
- 64   5 Ket
- 66  63 Ket
- 68  68 Ket
- 70     End
-------------------------------------------------------------------
-
-"8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
-Memory allocation (code space): 1648
-------------------------------------------------------------------
-  0 821 Bra
-  2     8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
-820     \b
-821 821 Ket
-823     End
-------------------------------------------------------------------
-
-"\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
-Memory allocation (code space): 1628
-------------------------------------------------------------------
-  0 811 Bra
-  2     $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
-810     \b
-811 811 Ket
-813     End
-------------------------------------------------------------------
-
-/(a(?1)b)/
-Memory allocation (code space): 32
-------------------------------------------------------------------
-  0  13 Bra
-  2   9 CBra 1
-  5     a
-  7   2 Recurse
-  9     b
- 11   9 Ket
- 13  13 Ket
- 15     End
-------------------------------------------------------------------
-
-/(a(?1)+b)/
-Memory allocation (code space): 40
-------------------------------------------------------------------
-  0  17 Bra
-  2  13 CBra 1
-  5     a
-  7   4 Once
-  9   2 Recurse
- 11   4 KetRmax
- 13     b
- 15  13 Ket
- 17  17 Ket
- 19     End
-------------------------------------------------------------------
-
-/a(?P<name1>b|c)d(?P<longername2>e)/
-Memory allocation (code space): 54
-------------------------------------------------------------------
-  0  24 Bra
-  2     a
-  4   5 CBra 1
-  7     b
-  9   4 Alt
- 11     c
- 13   9 Ket
- 15     d
- 17   5 CBra 2
- 20     e
- 22   5 Ket
- 24  24 Ket
- 26     End
-------------------------------------------------------------------
-
-/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
-Memory allocation (code space): 64
-------------------------------------------------------------------
-  0  29 Bra
-  2  18 Bra
-  4     a
-  6  12 CBra 1
-  9     c
- 11   5 CBra 2
- 14     d
- 16   5 Ket
- 18  12 Ket
- 20  18 Ket
- 22   5 CBra 3
- 25     a
- 27   5 Ket
- 29  29 Ket
- 31     End
-------------------------------------------------------------------
-
-/(?P<a>a)...(?P=a)bbb(?P>a)d/
-Memory allocation (code space): 54
-------------------------------------------------------------------
-  0  24 Bra
-  2   5 CBra 1
-  5     a
-  7   5 Ket
-  9     Any
- 10     Any
- 11     Any
- 12     \1
- 14     bbb
- 20   2 Recurse
- 22     d
- 24  24 Ket
- 26     End
-------------------------------------------------------------------
-
-/abc(?C255)de(?C)f/
-Memory allocation (code space): 50
-------------------------------------------------------------------
-  0  22 Bra
-  2     abc
-  8     Callout 255 10 1
- 12     de
- 16     Callout 0 16 1
- 20     f
- 22  22 Ket
- 24     End
-------------------------------------------------------------------
-
-/abcde/auto_callout
-Memory allocation (code space): 78
-------------------------------------------------------------------
-  0  36 Bra
-  2     Callout 255 0 1
-  6     a
-  8     Callout 255 1 1
- 12     b
- 14     Callout 255 2 1
- 18     c
- 20     Callout 255 3 1
- 24     d
- 26     Callout 255 4 1
- 30     e
- 32     Callout 255 5 0
- 36  36 Ket
- 38     End
-------------------------------------------------------------------
-
-/\x{100}/utf
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{100}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\x{1000}/utf
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{1000}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\x{10000}/utf
-Memory allocation (code space): 16
-------------------------------------------------------------------
-  0   5 Bra
-  2     \x{10000}
-  5   5 Ket
-  7     End
-------------------------------------------------------------------
-
-/\x{100000}/utf
-Memory allocation (code space): 16
-------------------------------------------------------------------
-  0   5 Bra
-  2     \x{100000}
-  5   5 Ket
-  7     End
-------------------------------------------------------------------
-
-/\x{10ffff}/utf
-Memory allocation (code space): 16
-------------------------------------------------------------------
-  0   5 Bra
-  2     \x{10ffff}
-  5   5 Ket
-  7     End
-------------------------------------------------------------------
-
-/\x{110000}/utf
-Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
-
-/[\x{ff}]/utf
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{ff}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[\x{100}]/utf
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{100}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\x80/utf
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{80}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\xff/utf
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{ff}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
-Memory allocation (code space): 26
-------------------------------------------------------------------
-  0  10 Bra
-  2     A\x{2262}\x{391}.
- 10  10 Ket
- 12     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: utf
-First code unit = 'A'
-Last code unit = '.'
-Subject length lower bound = 4
-    
-/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
-Memory allocation (code space): 22
-------------------------------------------------------------------
-  0   8 Bra
-  2     \x{d55c}\x{ad6d}\x{c5b4}
-  8   8 Ket
- 10     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: utf
-First code unit = \x{d55c}
-Last code unit = \x{c5b4}
-Subject length lower bound = 3
-
-/\x{65e5}\x{672c}\x{8a9e}/I,utf
-Memory allocation (code space): 22
-------------------------------------------------------------------
-  0   8 Bra
-  2     \x{65e5}\x{672c}\x{8a9e}
-  8   8 Ket
- 10     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: utf
-First code unit = \x{65e5}
-Last code unit = \x{8a9e}
-Subject length lower bound = 3
-
-/[\x{100}]/utf
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{100}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[Z\x{100}]/utf
-Memory allocation (code space): 54
-------------------------------------------------------------------
-  0  24 Bra
-  2     [Z\x{100}]
- 24  24 Ket
- 26     End
-------------------------------------------------------------------
-
-/^[\x{100}\E-\Q\E\x{150}]/utf
-Memory allocation (code space): 26
-------------------------------------------------------------------
-  0  10 Bra
-  2     ^
-  3     [\x{100}-\x{150}]
- 10  10 Ket
- 12     End
-------------------------------------------------------------------
-
-/^[\QĀ\E-\QŐ\E]/utf
-Memory allocation (code space): 26
-------------------------------------------------------------------
-  0  10 Bra
-  2     ^
-  3     [\x{100}-\x{150}]
- 10  10 Ket
- 12     End
-------------------------------------------------------------------
-
-/^[\QĀ\E-\QŐ\E/utf
-Failed: error 106 at offset 13: missing terminating ] for character class
-
-/[\p{L}]/
-Memory allocation (code space): 24
-------------------------------------------------------------------
-  0   9 Bra
-  2     [\p{L}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/[\p{^L}]/
-Memory allocation (code space): 24
-------------------------------------------------------------------
-  0   9 Bra
-  2     [\P{L}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/[\P{L}]/
-Memory allocation (code space): 24
-------------------------------------------------------------------
-  0   9 Bra
-  2     [\P{L}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/[\P{^L}]/
-Memory allocation (code space): 24
-------------------------------------------------------------------
-  0   9 Bra
-  2     [\p{L}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/[abc\p{L}\x{0660}]/utf
-Memory allocation (code space): 60
-------------------------------------------------------------------
-  0  27 Bra
-  2     [a-c\p{L}\x{660}]
- 27  27 Ket
- 29     End
-------------------------------------------------------------------
-
-/[\p{Nd}]/utf
-Memory allocation (code space): 24
-------------------------------------------------------------------
-  0   9 Bra
-  2     [\p{Nd}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/[\p{Nd}+-]+/utf
-Memory allocation (code space): 58
-------------------------------------------------------------------
-  0  26 Bra
-  2     [+\-\p{Nd}]++
- 26  26 Ket
- 28     End
-------------------------------------------------------------------
-
-/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
-Memory allocation (code space): 32
-------------------------------------------------------------------
-  0  13 Bra
-  2  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
- 13  13 Ket
- 15     End
-------------------------------------------------------------------
-
-/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
-Memory allocation (code space): 32
-------------------------------------------------------------------
-  0  13 Bra
-  2     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
- 13  13 Ket
- 15     End
-------------------------------------------------------------------
-
-/[\x{105}-\x{109}]/i,utf
-Memory allocation (code space): 24
-------------------------------------------------------------------
-  0   9 Bra
-  2     [\x{104}-\x{109}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/( ( (?(1)0|) )*   )/x
-Memory allocation (code space): 52
-------------------------------------------------------------------
-  0  23 Bra
-  2  19 CBra 1
-  5     Brazero
-  6  13 SCBra 2
-  9   6 Cond
- 11   1 Cond ref
- 13     0
- 15   2 Alt
- 17   8 Ket
- 19  13 KetRmax
- 21  19 Ket
- 23  23 Ket
- 25     End
-------------------------------------------------------------------
-
-/(  (?(1)0|)*   )/x
-Memory allocation (code space): 42
-------------------------------------------------------------------
-  0  18 Bra
-  2  14 CBra 1
-  5     Brazero
-  6   6 SCond
-  8   1 Cond ref
- 10     0
- 12   2 Alt
- 14   8 KetRmax
- 16  14 Ket
- 18  18 Ket
- 20     End
-------------------------------------------------------------------
-
-/[a]/
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     a
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[a]/utf
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     a
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[\xaa]/
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{aa}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[\xaa]/utf
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{aa}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[^a]/
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     [^a]
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[^a]/utf
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     [^a]
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[^\xaa]/
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     [^\x{aa}]
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[^\xaa]/utf
-Memory allocation (code space): 14
-------------------------------------------------------------------
-  0   4 Bra
-  2     [^\x{aa}]
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-#pattern -memory
-
-/[^\d]/utf,ucp
-------------------------------------------------------------------
-  0   9 Bra
-  2     [^\p{Nd}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/[[:^alpha:][:^cntrl:]]+/utf,ucp
-------------------------------------------------------------------
-  0  13 Bra
-  2     [\P{L}\P{Cc}]++
- 13  13 Ket
- 15     End
-------------------------------------------------------------------
-
-/[[:^cntrl:][:^alpha:]]+/utf,ucp
-------------------------------------------------------------------
-  0  13 Bra
-  2     [\P{Cc}\P{L}]++
- 13  13 Ket
- 15     End
-------------------------------------------------------------------
-
-/[[:alpha:]]+/utf,ucp
-------------------------------------------------------------------
-  0  10 Bra
-  2     [\p{L}]++
- 10  10 Ket
- 12     End
-------------------------------------------------------------------
-
-/[[:^alpha:]\S]+/utf,ucp
-------------------------------------------------------------------
-  0  13 Bra
-  2     [\P{L}\P{Xsp}]++
- 13  13 Ket
- 15     End
-------------------------------------------------------------------
-
-/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
-------------------------------------------------------------------
-  0  60 Bra
-  2     abc
-  8   5 CBra 1
- 11     d
- 13   4 Alt
- 15     e
- 17   9 Ket
- 19     *THEN
- 20     x
- 22  12 CBra 2
- 25     123
- 31     *THEN
- 32     4
- 34  24 Alt
- 36     567
- 42   5 CBra 3
- 45     b
- 47   4 Alt
- 49     q
- 51   9 Ket
- 53     *THEN
- 54     xx
- 58  36 Ket
- 60  60 Ket
- 62     End
-------------------------------------------------------------------
-
-/(((a\2)|(a*)\g<-1>))*a?/
-------------------------------------------------------------------
-  0  39 Bra
-  2     Brazero
-  3  32 SCBra 1
-  6  27 Once
-  8  12 CBra 2
- 11   7 CBra 3
- 14     a
- 16     \2
- 18   7 Ket
- 20  11 Alt
- 22   5 CBra 4
- 25     a*
- 27   5 Ket
- 29  22 Recurse
- 31  23 Ket
- 33  27 Ket
- 35  32 KetRmax
- 37     a?+
- 39  39 Ket
- 41     End
-------------------------------------------------------------------
-
-/((?+1)(\1))/
-------------------------------------------------------------------
-  0  20 Bra
-  2  16 Once
-  4  12 CBra 1
-  7   9 Recurse
-  9   5 CBra 2
- 12     \1
- 14   5 Ket
- 16  12 Ket
- 18  16 Ket
- 20  20 Ket
- 22     End
-------------------------------------------------------------------
-
-"(?1)(?#?'){2}(a)"
-------------------------------------------------------------------
-  0  21 Bra
-  2   4 Once
-  4  14 Recurse
-  6   4 Ket
-  8   4 Once
- 10  14 Recurse
- 12   4 Ket
- 14   5 CBra 1
- 17     a
- 19   5 Ket
- 21  21 Ket
- 23     End
-------------------------------------------------------------------
-
-/.((?2)(?R)|\1|$)()/
-------------------------------------------------------------------
-  0  28 Bra
-  2     Any
-  3  18 Once
-  5   7 CBra 1
-  8  23 Recurse
- 10   0 Recurse
- 12   4 Alt
- 14     \1
- 16   3 Alt
- 18     $
- 19  14 Ket
- 21  18 Ket
- 23   3 CBra 2
- 26   3 Ket
- 28  28 Ket
- 30     End
-------------------------------------------------------------------
-
-/.((?3)(?R)()(?2)|\1|$)()/
-------------------------------------------------------------------
-  0  35 Bra
-  2     Any
-  3  25 Once
-  5  14 CBra 1
-  8  30 Recurse
- 10   0 Recurse
- 12   3 CBra 2
- 15   3 Ket
- 17  12 Recurse
- 19   4 Alt
- 21     \1
- 23   3 Alt
- 25     $
- 26  21 Ket
- 28  25 Ket
- 30   3 CBra 3
- 33   3 Ket
- 35  35 Ket
- 37     End
-------------------------------------------------------------------
-
-/(?1)()((((((\1++))\x85)+)|))/
-------------------------------------------------------------------
-  0  50 Bra
-  2   4 Recurse
-  4   3 CBra 1
-  7   3 Ket
-  9  39 CBra 2
- 12  32 CBra 3
- 15  27 CBra 4
- 18  22 CBra 5
- 21  15 CBra 6
- 24  10 CBra 7
- 27   5 Once
- 29     \1+
- 32   5 Ket
- 34  10 Ket
- 36  15 Ket
- 38     \x{85}
- 40  22 KetRmax
- 42  27 Ket
- 44   2 Alt
- 46  34 Ket
- 48  39 Ket
- 50  50 Ket
- 52     End
-------------------------------------------------------------------
-
-# Check the absolute limit on nesting (?| etc. This varies with code unit
-# width because the workspace is a different number of bytes. It will fail
-# in 8-bit and 16-bit but not in 32-bit.
-    
-/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
-)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
-/parens_nest_limit=1000,-fullbincode
-Failed: error 184 at offset 1540: (?| and/or (?J: or (?x: parentheses are too deeply nested
-
-# End of testinput8
diff --git a/testdata/testoutput8-16-2 b/testdata/testoutput8-16-2
new file mode 100644 (file)
index 0000000..05669bb
--- /dev/null
@@ -0,0 +1,1030 @@
+# There are two sorts of patterns in this test. A number of them are
+# representative patterns whose lengths and offsets are checked. This is just a
+# doublecheck test to ensure the sizes don't go horribly wrong when something
+# is changed. The operation of these patterns is checked in other tests.
+#
+# This file also contains tests whose output varies with code unit size and/or
+# link size. Unicode support is required for these tests. There are separate
+# output files for each code unit size and link size.
+
+#pattern fullbincode,memory
+
+/((?i)b)/
+Memory allocation (code space): 24
+------------------------------------------------------------------
+  0   9 Bra
+  2   5 CBra 1
+  5  /i b
+  7   5 Ket
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/(?s)(.*X|^B)/
+Memory allocation (code space): 38
+------------------------------------------------------------------
+  0  16 Bra
+  2   7 CBra 1
+  5     AllAny*
+  7     X
+  9   5 Alt
+ 11     ^
+ 12     B
+ 14  12 Ket
+ 16  16 Ket
+ 18     End
+------------------------------------------------------------------
+
+/(?s:.*X|^B)/
+Memory allocation (code space): 36
+------------------------------------------------------------------
+  0  15 Bra
+  2   6 Bra
+  4     AllAny*
+  6     X
+  8   5 Alt
+ 10     ^
+ 11     B
+ 13  11 Ket
+ 15  15 Ket
+ 17     End
+------------------------------------------------------------------
+
+/^[[:alnum:]]/
+Memory allocation (code space): 46
+------------------------------------------------------------------
+  0  20 Bra
+  2     ^
+  3     [0-9A-Za-z]
+ 20  20 Ket
+ 22     End
+------------------------------------------------------------------
+
+/#/Ix
+Memory allocation (code space): 10
+------------------------------------------------------------------
+  0   2 Bra
+  2   2 Ket
+  4     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+May match empty string
+Options: extended
+Subject length lower bound = 0
+
+/a#/Ix
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     a
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: extended
+First code unit = 'a'
+Subject length lower bound = 1
+
+/x?+/
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     x?+
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/x++/
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     x++
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/x{1,3}+/
+Memory allocation (code space): 20
+------------------------------------------------------------------
+  0   7 Bra
+  2     x
+  4     x{0,2}+
+  7   7 Ket
+  9     End
+------------------------------------------------------------------
+
+/(x)*+/
+Memory allocation (code space): 26
+------------------------------------------------------------------
+  0  10 Bra
+  2     Braposzero
+  3   5 CBraPos 1
+  6     x
+  8   5 KetRpos
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
+Memory allocation (code space): 142
+------------------------------------------------------------------
+  0  68 Bra
+  2     ^
+  3  63 CBra 1
+  6   5 CBra 2
+  9     a+
+ 11   5 Ket
+ 13  21 CBra 3
+ 16     [ab]+?
+ 34  21 Ket
+ 36  21 CBra 4
+ 39     [bc]+
+ 57  21 Ket
+ 59   5 CBra 5
+ 62     \w*+
+ 64   5 Ket
+ 66  63 Ket
+ 68  68 Ket
+ 70     End
+------------------------------------------------------------------
+
+"8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 1648
+------------------------------------------------------------------
+  0 821 Bra
+  2     8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+820     \b
+821 821 Ket
+823     End
+------------------------------------------------------------------
+
+"\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 1628
+------------------------------------------------------------------
+  0 811 Bra
+  2     $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+810     \b
+811 811 Ket
+813     End
+------------------------------------------------------------------
+
+/(a(?1)b)/
+Memory allocation (code space): 32
+------------------------------------------------------------------
+  0  13 Bra
+  2   9 CBra 1
+  5     a
+  7   2 Recurse
+  9     b
+ 11   9 Ket
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/(a(?1)+b)/
+Memory allocation (code space): 40
+------------------------------------------------------------------
+  0  17 Bra
+  2  13 CBra 1
+  5     a
+  7   4 Once
+  9   2 Recurse
+ 11   4 KetRmax
+ 13     b
+ 15  13 Ket
+ 17  17 Ket
+ 19     End
+------------------------------------------------------------------
+
+/a(?P<name1>b|c)d(?P<longername2>e)/
+Memory allocation (code space): 54
+------------------------------------------------------------------
+  0  24 Bra
+  2     a
+  4   5 CBra 1
+  7     b
+  9   4 Alt
+ 11     c
+ 13   9 Ket
+ 15     d
+ 17   5 CBra 2
+ 20     e
+ 22   5 Ket
+ 24  24 Ket
+ 26     End
+------------------------------------------------------------------
+
+/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
+Memory allocation (code space): 64
+------------------------------------------------------------------
+  0  29 Bra
+  2  18 Bra
+  4     a
+  6  12 CBra 1
+  9     c
+ 11   5 CBra 2
+ 14     d
+ 16   5 Ket
+ 18  12 Ket
+ 20  18 Ket
+ 22   5 CBra 3
+ 25     a
+ 27   5 Ket
+ 29  29 Ket
+ 31     End
+------------------------------------------------------------------
+
+/(?P<a>a)...(?P=a)bbb(?P>a)d/
+Memory allocation (code space): 54
+------------------------------------------------------------------
+  0  24 Bra
+  2   5 CBra 1
+  5     a
+  7   5 Ket
+  9     Any
+ 10     Any
+ 11     Any
+ 12     \1
+ 14     bbb
+ 20   2 Recurse
+ 22     d
+ 24  24 Ket
+ 26     End
+------------------------------------------------------------------
+
+/abc(?C255)de(?C)f/
+Memory allocation (code space): 50
+------------------------------------------------------------------
+  0  22 Bra
+  2     abc
+  8     Callout 255 10 1
+ 12     de
+ 16     Callout 0 16 1
+ 20     f
+ 22  22 Ket
+ 24     End
+------------------------------------------------------------------
+
+/abcde/auto_callout
+Memory allocation (code space): 78
+------------------------------------------------------------------
+  0  36 Bra
+  2     Callout 255 0 1
+  6     a
+  8     Callout 255 1 1
+ 12     b
+ 14     Callout 255 2 1
+ 18     c
+ 20     Callout 255 3 1
+ 24     d
+ 26     Callout 255 4 1
+ 30     e
+ 32     Callout 255 5 0
+ 36  36 Ket
+ 38     End
+------------------------------------------------------------------
+
+/\x{100}/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{1000}/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{1000}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{10000}/utf
+Memory allocation (code space): 16
+------------------------------------------------------------------
+  0   5 Bra
+  2     \x{10000}
+  5   5 Ket
+  7     End
+------------------------------------------------------------------
+
+/\x{100000}/utf
+Memory allocation (code space): 16
+------------------------------------------------------------------
+  0   5 Bra
+  2     \x{100000}
+  5   5 Ket
+  7     End
+------------------------------------------------------------------
+
+/\x{10ffff}/utf
+Memory allocation (code space): 16
+------------------------------------------------------------------
+  0   5 Bra
+  2     \x{10ffff}
+  5   5 Ket
+  7     End
+------------------------------------------------------------------
+
+/\x{110000}/utf
+Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
+
+/[\x{ff}]/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{ff}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[\x{100}]/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x80/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{80}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\xff/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{ff}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
+Memory allocation (code space): 26
+------------------------------------------------------------------
+  0  10 Bra
+  2     A\x{2262}\x{391}.
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = 'A'
+Last code unit = '.'
+Subject length lower bound = 4
+
+/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
+Memory allocation (code space): 22
+------------------------------------------------------------------
+  0   8 Bra
+  2     \x{d55c}\x{ad6d}\x{c5b4}
+  8   8 Ket
+ 10     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \x{d55c}
+Last code unit = \x{c5b4}
+Subject length lower bound = 3
+
+/\x{65e5}\x{672c}\x{8a9e}/I,utf
+Memory allocation (code space): 22
+------------------------------------------------------------------
+  0   8 Bra
+  2     \x{65e5}\x{672c}\x{8a9e}
+  8   8 Ket
+ 10     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \x{65e5}
+Last code unit = \x{8a9e}
+Subject length lower bound = 3
+
+/[\x{100}]/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[Z\x{100}]/utf
+Memory allocation (code space): 54
+------------------------------------------------------------------
+  0  24 Bra
+  2     [Z\x{100}]
+ 24  24 Ket
+ 26     End
+------------------------------------------------------------------
+
+/^[\x{100}\E-\Q\E\x{150}]/utf
+Memory allocation (code space): 26
+------------------------------------------------------------------
+  0  10 Bra
+  2     ^
+  3     [\x{100}-\x{150}]
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E]/utf
+Memory allocation (code space): 26
+------------------------------------------------------------------
+  0  10 Bra
+  2     ^
+  3     [\x{100}-\x{150}]
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E/utf
+Failed: error 106 at offset 13: missing terminating ] for character class
+
+/[\p{L}]/
+Memory allocation (code space): 24
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\p{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\p{^L}]/
+Memory allocation (code space): 24
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\P{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\P{L}]/
+Memory allocation (code space): 24
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\P{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\P{^L}]/
+Memory allocation (code space): 24
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\p{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[abc\p{L}\x{0660}]/utf
+Memory allocation (code space): 60
+------------------------------------------------------------------
+  0  27 Bra
+  2     [a-c\p{L}\x{660}]
+ 27  27 Ket
+ 29     End
+------------------------------------------------------------------
+
+/[\p{Nd}]/utf
+Memory allocation (code space): 24
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\p{Nd}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\p{Nd}+-]+/utf
+Memory allocation (code space): 58
+------------------------------------------------------------------
+  0  26 Bra
+  2     [+\-\p{Nd}]++
+ 26  26 Ket
+ 28     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
+Memory allocation (code space): 32
+------------------------------------------------------------------
+  0  13 Bra
+  2  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
+Memory allocation (code space): 32
+------------------------------------------------------------------
+  0  13 Bra
+  2     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/[\x{105}-\x{109}]/i,utf
+Memory allocation (code space): 24
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\x{104}-\x{109}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/( ( (?(1)0|) )*   )/x
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  23 Bra
+  2  19 CBra 1
+  5     Brazero
+  6  13 SCBra 2
+  9   6 Cond
+ 11   1 Cond ref
+ 13     0
+ 15   2 Alt
+ 17   8 Ket
+ 19  13 KetRmax
+ 21  19 Ket
+ 23  23 Ket
+ 25     End
+------------------------------------------------------------------
+
+/(  (?(1)0|)*   )/x
+Memory allocation (code space): 42
+------------------------------------------------------------------
+  0  18 Bra
+  2  14 CBra 1
+  5     Brazero
+  6   6 SCond
+  8   1 Cond ref
+ 10     0
+ 12   2 Alt
+ 14   8 KetRmax
+ 16  14 Ket
+ 18  18 Ket
+ 20     End
+------------------------------------------------------------------
+
+/[a]/
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     a
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[a]/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     a
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[\xaa]/
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{aa}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[\xaa]/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{aa}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^a]/
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^a]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^a]/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^a]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^\xaa]/
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^\x{aa}]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^\xaa]/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^\x{aa}]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+#pattern -memory
+
+/[^\d]/utf,ucp
+------------------------------------------------------------------
+  0   9 Bra
+  2     [^\p{Nd}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[[:^alpha:][:^cntrl:]]+/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  2     [\P{L}\P{Cc}]++
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/[[:^cntrl:][:^alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  2     [\P{Cc}\P{L}]++
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/[[:alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  10 Bra
+  2     [\p{L}]++
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/[[:^alpha:]\S]+/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  2     [\P{L}\P{Xsp}]++
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
+------------------------------------------------------------------
+  0  60 Bra
+  2     abc
+  8   5 CBra 1
+ 11     d
+ 13   4 Alt
+ 15     e
+ 17   9 Ket
+ 19     *THEN
+ 20     x
+ 22  12 CBra 2
+ 25     123
+ 31     *THEN
+ 32     4
+ 34  24 Alt
+ 36     567
+ 42   5 CBra 3
+ 45     b
+ 47   4 Alt
+ 49     q
+ 51   9 Ket
+ 53     *THEN
+ 54     xx
+ 58  36 Ket
+ 60  60 Ket
+ 62     End
+------------------------------------------------------------------
+
+/(((a\2)|(a*)\g<-1>))*a?/
+------------------------------------------------------------------
+  0  39 Bra
+  2     Brazero
+  3  32 SCBra 1
+  6  27 Once
+  8  12 CBra 2
+ 11   7 CBra 3
+ 14     a
+ 16     \2
+ 18   7 Ket
+ 20  11 Alt
+ 22   5 CBra 4
+ 25     a*
+ 27   5 Ket
+ 29  22 Recurse
+ 31  23 Ket
+ 33  27 Ket
+ 35  32 KetRmax
+ 37     a?+
+ 39  39 Ket
+ 41     End
+------------------------------------------------------------------
+
+/((?+1)(\1))/
+------------------------------------------------------------------
+  0  20 Bra
+  2  16 Once
+  4  12 CBra 1
+  7   9 Recurse
+  9   5 CBra 2
+ 12     \1
+ 14   5 Ket
+ 16  12 Ket
+ 18  16 Ket
+ 20  20 Ket
+ 22     End
+------------------------------------------------------------------
+
+"(?1)(?#?'){2}(a)"
+------------------------------------------------------------------
+  0  21 Bra
+  2   4 Once
+  4  14 Recurse
+  6   4 Ket
+  8   4 Once
+ 10  14 Recurse
+ 12   4 Ket
+ 14   5 CBra 1
+ 17     a
+ 19   5 Ket
+ 21  21 Ket
+ 23     End
+------------------------------------------------------------------
+
+/.((?2)(?R)|\1|$)()/
+------------------------------------------------------------------
+  0  28 Bra
+  2     Any
+  3  18 Once
+  5   7 CBra 1
+  8  23 Recurse
+ 10   0 Recurse
+ 12   4 Alt
+ 14     \1
+ 16   3 Alt
+ 18     $
+ 19  14 Ket
+ 21  18 Ket
+ 23   3 CBra 2
+ 26   3 Ket
+ 28  28 Ket
+ 30     End
+------------------------------------------------------------------
+
+/.((?3)(?R)()(?2)|\1|$)()/
+------------------------------------------------------------------
+  0  35 Bra
+  2     Any
+  3  25 Once
+  5  14 CBra 1
+  8  30 Recurse
+ 10   0 Recurse
+ 12   3 CBra 2
+ 15   3 Ket
+ 17  12 Recurse
+ 19   4 Alt
+ 21     \1
+ 23   3 Alt
+ 25     $
+ 26  21 Ket
+ 28  25 Ket
+ 30   3 CBra 3
+ 33   3 Ket
+ 35  35 Ket
+ 37     End
+------------------------------------------------------------------
+
+/(?1)()((((((\1++))\x85)+)|))/
+------------------------------------------------------------------
+  0  50 Bra
+  2   4 Recurse
+  4   3 CBra 1
+  7   3 Ket
+  9  39 CBra 2
+ 12  32 CBra 3
+ 15  27 CBra 4
+ 18  22 CBra 5
+ 21  15 CBra 6
+ 24  10 CBra 7
+ 27   5 Once
+ 29     \1+
+ 32   5 Ket
+ 34  10 Ket
+ 36  15 Ket
+ 38     \x{85}
+ 40  22 KetRmax
+ 42  27 Ket
+ 44   2 Alt
+ 46  34 Ket
+ 48  39 Ket
+ 50  50 Ket
+ 52     End
+------------------------------------------------------------------
+
+# Check the absolute limit on nesting (?| etc. This varies with code unit
+# width because the workspace is a different number of bytes. It will fail
+# with link size 2 in 8-bit and 16-bit but not in 32-bit.
+
+/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
+)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+/parens_nest_limit=1000,-fullbincode
+Failed: error 184 at offset 1540: (?| and/or (?J: or (?x: parentheses are too deeply nested
+
+# Use "expand" to create some very long patterns with nested parentheses, in
+# order to test workspace overflow. Again, this varies with code unit width,
+# and even with it fails in two modes, the error offset differs. It also varies
+# with link size - hence multiple tests with different values.
+
+/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
+Failed: error 186 at offset 594: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
+Failed: error 186 at offset 594: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{159}*THEN:\[A]{255}\[)]{160}/expand,-fullbincode
+Failed: error 186 at offset 594: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{199}*THEN:\[A]{255}\[)]{200}/expand,-fullbincode
+Failed: error 186 at offset 594: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{299}*THEN:\[A]{255}\[)]{300}/expand,-fullbincode
+Failed: error 186 at offset 594: regular expression is too complicated
+
+/(?(1)(?1)){8,}+()/debug
+------------------------------------------------------------------
+  0  79 Bra
+  2  70 Once
+  4   6 Cond
+  6   1 Cond ref
+  8  74 Recurse
+ 10   6 Ket
+ 12   6 Cond
+ 14   1 Cond ref
+ 16  74 Recurse
+ 18   6 Ket
+ 20   6 Cond
+ 22   1 Cond ref
+ 24  74 Recurse
+ 26   6 Ket
+ 28   6 Cond
+ 30   1 Cond ref
+ 32  74 Recurse
+ 34   6 Ket
+ 36   6 Cond
+ 38   1 Cond ref
+ 40  74 Recurse
+ 42   6 Ket
+ 44   6 Cond
+ 46   1 Cond ref
+ 48  74 Recurse
+ 50   6 Ket
+ 52   6 Cond
+ 54   1 Cond ref
+ 56  74 Recurse
+ 58   6 Ket
+ 60  10 SBraPos
+ 62   6 SCond
+ 64   1 Cond ref
+ 66  74 Recurse
+ 68   6 Ket
+ 70  10 KetRpos
+ 72  70 Ket
+ 74   3 CBra 1
+ 77   3 Ket
+ 79  79 Ket
+ 81     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcd
+ 0: 
+ 1: 
+
+/(?(1)|a(?1)b){2,}+()/debug
+------------------------------------------------------------------
+  0  43 Bra
+  2  34 Once
+  4   4 Cond
+  6   1 Cond ref
+  8   8 Alt
+ 10     a
+ 12  38 Recurse
+ 14     b
+ 16  12 Ket
+ 18  16 SBraPos
+ 20   4 SCond
+ 22   1 Cond ref
+ 24   8 Alt
+ 26     a
+ 28  38 Recurse
+ 30     b
+ 32  12 Ket
+ 34  16 KetRpos
+ 36  34 Ket
+ 38   3 CBra 1
+ 41   3 Ket
+ 43  43 Ket
+ 45     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcde
+No match
+
+/((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug
+------------------------------------------------------------------
+  0 133 Bra
+  2  41 CBra 1
+  5   2 Recurse
+  7  88 Recurse
+  9  93 Recurse
+ 11  98 Recurse
+ 13 103 Recurse
+ 15 108 Recurse
+ 17 113 Recurse
+ 19 118 Recurse
+ 21 123 Recurse
+ 23 123 Recurse
+ 25 118 Recurse
+ 27 113 Recurse
+ 29 108 Recurse
+ 31 103 Recurse
+ 33  98 Recurse
+ 35  93 Recurse
+ 37  88 Recurse
+ 39   2 Recurse
+ 41   0 Recurse
+ 43  41 Ket
+ 45  41 SCBra 1
+ 48   2 Recurse
+ 50  88 Recurse
+ 52  93 Recurse
+ 54  98 Recurse
+ 56 103 Recurse
+ 58 108 Recurse
+ 60 113 Recurse
+ 62 118 Recurse
+ 64 123 Recurse
+ 66 123 Recurse
+ 68 118 Recurse
+ 70 113 Recurse
+ 72 108 Recurse
+ 74 103 Recurse
+ 76  98 Recurse
+ 78  93 Recurse
+ 80  88 Recurse
+ 82   2 Recurse
+ 84   0 Recurse
+ 86  41 KetRmax
+ 88   3 CBra 2
+ 91   3 Ket
+ 93   3 CBra 3
+ 96   3 Ket
+ 98   3 CBra 4
+101   3 Ket
+103   3 CBra 5
+106   3 Ket
+108   3 CBra 6
+111   3 Ket
+113   3 CBra 7
+116   3 Ket
+118   3 CBra 8
+121   3 Ket
+123   3 CBra 9
+126   3 Ket
+128   3 CBra 10
+131   3 Ket
+133 133 Ket
+135     End
+------------------------------------------------------------------
+Capturing subpattern count = 10
+May match empty string
+Subject length lower bound = 0
+
+# End of testinput8
diff --git a/testdata/testoutput8-16-3 b/testdata/testoutput8-16-3
new file mode 100644 (file)
index 0000000..31884e1
--- /dev/null
@@ -0,0 +1,1026 @@
+# There are two sorts of patterns in this test. A number of them are
+# representative patterns whose lengths and offsets are checked. This is just a
+# doublecheck test to ensure the sizes don't go horribly wrong when something
+# is changed. The operation of these patterns is checked in other tests.
+#
+# This file also contains tests whose output varies with code unit size and/or
+# link size. Unicode support is required for these tests. There are separate
+# output files for each code unit size and link size.
+
+#pattern fullbincode,memory
+
+/((?i)b)/
+Memory allocation (code space): 32
+------------------------------------------------------------------
+  0  12 Bra
+  3   6 CBra 1
+  7  /i b
+  9   6 Ket
+ 12  12 Ket
+ 15     End
+------------------------------------------------------------------
+
+/(?s)(.*X|^B)/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0  20 Bra
+  3   8 CBra 1
+  7     AllAny*
+  9     X
+ 11   6 Alt
+ 14     ^
+ 15     B
+ 17  14 Ket
+ 20  20 Ket
+ 23     End
+------------------------------------------------------------------
+
+/(?s:.*X|^B)/
+Memory allocation (code space): 46
+------------------------------------------------------------------
+  0  19 Bra
+  3   7 Bra
+  6     AllAny*
+  8     X
+ 10   6 Alt
+ 13     ^
+ 14     B
+ 16  13 Ket
+ 19  19 Ket
+ 22     End
+------------------------------------------------------------------
+
+/^[[:alnum:]]/
+Memory allocation (code space): 50
+------------------------------------------------------------------
+  0  21 Bra
+  3     ^
+  4     [0-9A-Za-z]
+ 21  21 Ket
+ 24     End
+------------------------------------------------------------------
+
+/#/Ix
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   3 Bra
+  3   3 Ket
+  6     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+May match empty string
+Options: extended
+Subject length lower bound = 0
+
+/a#/Ix
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     a
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: extended
+First code unit = 'a'
+Subject length lower bound = 1
+
+/x?+/
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     x?+
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/x++/
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     x++
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/x{1,3}+/
+Memory allocation (code space): 24
+------------------------------------------------------------------
+  0   8 Bra
+  3     x
+  5     x{0,2}+
+  8   8 Ket
+ 11     End
+------------------------------------------------------------------
+
+/(x)*+/
+Memory allocation (code space): 34
+------------------------------------------------------------------
+  0  13 Bra
+  3     Braposzero
+  4   6 CBraPos 1
+  8     x
+ 10   6 KetRpos
+ 13  13 Ket
+ 16     End
+------------------------------------------------------------------
+
+/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
+Memory allocation (code space): 166
+------------------------------------------------------------------
+  0  79 Bra
+  3     ^
+  4  72 CBra 1
+  8   6 CBra 2
+ 12     a+
+ 14   6 Ket
+ 17  22 CBra 3
+ 21     [ab]+?
+ 39  22 Ket
+ 42  22 CBra 4
+ 46     [bc]+
+ 64  22 Ket
+ 67   6 CBra 5
+ 71     \w*+
+ 73   6 Ket
+ 76  72 Ket
+ 79  79 Ket
+ 82     End
+------------------------------------------------------------------
+
+"8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 1652
+------------------------------------------------------------------
+  0 822 Bra
+  3     8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+821     \b
+822 822 Ket
+825     End
+------------------------------------------------------------------
+
+"\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 1632
+------------------------------------------------------------------
+  0 812 Bra
+  3     $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+811     \b
+812 812 Ket
+815     End
+------------------------------------------------------------------
+
+/(a(?1)b)/
+Memory allocation (code space): 42
+------------------------------------------------------------------
+  0  17 Bra
+  3  11 CBra 1
+  7     a
+  9   3 Recurse
+ 12     b
+ 14  11 Ket
+ 17  17 Ket
+ 20     End
+------------------------------------------------------------------
+
+/(a(?1)+b)/
+Memory allocation (code space): 54
+------------------------------------------------------------------
+  0  23 Bra
+  3  17 CBra 1
+  7     a
+  9   6 Once
+ 12   3 Recurse
+ 15   6 KetRmax
+ 18     b
+ 20  17 Ket
+ 23  23 Ket
+ 26     End
+------------------------------------------------------------------
+
+/a(?P<name1>b|c)d(?P<longername2>e)/
+Memory allocation (code space): 68
+------------------------------------------------------------------
+  0  30 Bra
+  3     a
+  5   6 CBra 1
+  9     b
+ 11   5 Alt
+ 14     c
+ 16  11 Ket
+ 19     d
+ 21   6 CBra 2
+ 25     e
+ 27   6 Ket
+ 30  30 Ket
+ 33     End
+------------------------------------------------------------------
+
+/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
+Memory allocation (code space): 84
+------------------------------------------------------------------
+  0  38 Bra
+  3  23 Bra
+  6     a
+  8  15 CBra 1
+ 12     c
+ 14   6 CBra 2
+ 18     d
+ 20   6 Ket
+ 23  15 Ket
+ 26  23 Ket
+ 29   6 CBra 3
+ 33     a
+ 35   6 Ket
+ 38  38 Ket
+ 41     End
+------------------------------------------------------------------
+
+/(?P<a>a)...(?P=a)bbb(?P>a)d/
+Memory allocation (code space): 64
+------------------------------------------------------------------
+  0  28 Bra
+  3   6 CBra 1
+  7     a
+  9   6 Ket
+ 12     Any
+ 13     Any
+ 14     Any
+ 15     \1
+ 17     bbb
+ 23   3 Recurse
+ 26     d
+ 28  28 Ket
+ 31     End
+------------------------------------------------------------------
+
+/abc(?C255)de(?C)f/
+Memory allocation (code space): 62
+------------------------------------------------------------------
+  0  27 Bra
+  3     abc
+  9     Callout 255 10 1
+ 15     de
+ 19     Callout 0 16 1
+ 25     f
+ 27  27 Ket
+ 30     End
+------------------------------------------------------------------
+
+/abcde/auto_callout
+Memory allocation (code space): 106
+------------------------------------------------------------------
+  0  49 Bra
+  3     Callout 255 0 1
+  9     a
+ 11     Callout 255 1 1
+ 17     b
+ 19     Callout 255 2 1
+ 25     c
+ 27     Callout 255 3 1
+ 33     d
+ 35     Callout 255 4 1
+ 41     e
+ 43     Callout 255 5 0
+ 49  49 Ket
+ 52     End
+------------------------------------------------------------------
+
+/\x{100}/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     \x{100}
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/\x{1000}/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     \x{1000}
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/\x{10000}/utf
+Memory allocation (code space): 20
+------------------------------------------------------------------
+  0   6 Bra
+  3     \x{10000}
+  6   6 Ket
+  9     End
+------------------------------------------------------------------
+
+/\x{100000}/utf
+Memory allocation (code space): 20
+------------------------------------------------------------------
+  0   6 Bra
+  3     \x{100000}
+  6   6 Ket
+  9     End
+------------------------------------------------------------------
+
+/\x{10ffff}/utf
+Memory allocation (code space): 20
+------------------------------------------------------------------
+  0   6 Bra
+  3     \x{10ffff}
+  6   6 Ket
+  9     End
+------------------------------------------------------------------
+
+/\x{110000}/utf
+Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
+
+/[\x{ff}]/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     \x{ff}
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[\x{100}]/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     \x{100}
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/\x80/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     \x{80}
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/\xff/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     \x{ff}
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
+Memory allocation (code space): 30
+------------------------------------------------------------------
+  0  11 Bra
+  3     A\x{2262}\x{391}.
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = 'A'
+Last code unit = '.'
+Subject length lower bound = 4
+
+/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
+Memory allocation (code space): 26
+------------------------------------------------------------------
+  0   9 Bra
+  3     \x{d55c}\x{ad6d}\x{c5b4}
+  9   9 Ket
+ 12     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \x{d55c}
+Last code unit = \x{c5b4}
+Subject length lower bound = 3
+
+/\x{65e5}\x{672c}\x{8a9e}/I,utf
+Memory allocation (code space): 26
+------------------------------------------------------------------
+  0   9 Bra
+  3     \x{65e5}\x{672c}\x{8a9e}
+  9   9 Ket
+ 12     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \x{65e5}
+Last code unit = \x{8a9e}
+Subject length lower bound = 3
+
+/[\x{100}]/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     \x{100}
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[Z\x{100}]/utf
+Memory allocation (code space): 60
+------------------------------------------------------------------
+  0  26 Bra
+  3     [Z\x{100}]
+ 26  26 Ket
+ 29     End
+------------------------------------------------------------------
+
+/^[\x{100}\E-\Q\E\x{150}]/utf
+Memory allocation (code space): 32
+------------------------------------------------------------------
+  0  12 Bra
+  3     ^
+  4     [\x{100}-\x{150}]
+ 12  12 Ket
+ 15     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E]/utf
+Memory allocation (code space): 32
+------------------------------------------------------------------
+  0  12 Bra
+  3     ^
+  4     [\x{100}-\x{150}]
+ 12  12 Ket
+ 15     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E/utf
+Failed: error 106 at offset 13: missing terminating ] for character class
+
+/[\p{L}]/
+Memory allocation (code space): 30
+------------------------------------------------------------------
+  0  11 Bra
+  3     [\p{L}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[\p{^L}]/
+Memory allocation (code space): 30
+------------------------------------------------------------------
+  0  11 Bra
+  3     [\P{L}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[\P{L}]/
+Memory allocation (code space): 30
+------------------------------------------------------------------
+  0  11 Bra
+  3     [\P{L}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[\P{^L}]/
+Memory allocation (code space): 30
+------------------------------------------------------------------
+  0  11 Bra
+  3     [\p{L}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[abc\p{L}\x{0660}]/utf
+Memory allocation (code space): 66
+------------------------------------------------------------------
+  0  29 Bra
+  3     [a-c\p{L}\x{660}]
+ 29  29 Ket
+ 32     End
+------------------------------------------------------------------
+
+/[\p{Nd}]/utf
+Memory allocation (code space): 30
+------------------------------------------------------------------
+  0  11 Bra
+  3     [\p{Nd}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[\p{Nd}+-]+/utf
+Memory allocation (code space): 64
+------------------------------------------------------------------
+  0  28 Bra
+  3     [+\-\p{Nd}]++
+ 28  28 Ket
+ 31     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
+Memory allocation (code space): 36
+------------------------------------------------------------------
+  0  14 Bra
+  3  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 14  14 Ket
+ 17     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
+Memory allocation (code space): 36
+------------------------------------------------------------------
+  0  14 Bra
+  3     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 14  14 Ket
+ 17     End
+------------------------------------------------------------------
+
+/[\x{105}-\x{109}]/i,utf
+Memory allocation (code space): 30
+------------------------------------------------------------------
+  0  11 Bra
+  3     [\x{104}-\x{109}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/( ( (?(1)0|) )*   )/x
+Memory allocation (code space): 70
+------------------------------------------------------------------
+  0  31 Bra
+  3  25 CBra 1
+  7     Brazero
+  8  17 SCBra 2
+ 12   7 Cond
+ 15   1 Cond ref
+ 17     0
+ 19   3 Alt
+ 22  10 Ket
+ 25  17 KetRmax
+ 28  25 Ket
+ 31  31 Ket
+ 34     End
+------------------------------------------------------------------
+
+/(  (?(1)0|)*   )/x
+Memory allocation (code space): 56
+------------------------------------------------------------------
+  0  24 Bra
+  3  18 CBra 1
+  7     Brazero
+  8   7 SCond
+ 11   1 Cond ref
+ 13     0
+ 15   3 Alt
+ 18  10 KetRmax
+ 21  18 Ket
+ 24  24 Ket
+ 27     End
+------------------------------------------------------------------
+
+/[a]/
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     a
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[a]/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     a
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[\xaa]/
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     \x{aa}
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[\xaa]/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     \x{aa}
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[^a]/
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     [^a]
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[^a]/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     [^a]
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[^\xaa]/
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     [^\x{aa}]
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[^\xaa]/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0   5 Bra
+  3     [^\x{aa}]
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+#pattern -memory
+
+/[^\d]/utf,ucp
+------------------------------------------------------------------
+  0  11 Bra
+  3     [^\p{Nd}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[[:^alpha:][:^cntrl:]]+/utf,ucp
+------------------------------------------------------------------
+  0  15 Bra
+  3     [\P{L}\P{Cc}]++
+ 15  15 Ket
+ 18     End
+------------------------------------------------------------------
+
+/[[:^cntrl:][:^alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  15 Bra
+  3     [\P{Cc}\P{L}]++
+ 15  15 Ket
+ 18     End
+------------------------------------------------------------------
+
+/[[:alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  12 Bra
+  3     [\p{L}]++
+ 12  12 Ket
+ 15     End
+------------------------------------------------------------------
+
+/[[:^alpha:]\S]+/utf,ucp
+------------------------------------------------------------------
+  0  15 Bra
+  3     [\P{L}\P{Xsp}]++
+ 15  15 Ket
+ 18     End
+------------------------------------------------------------------
+
+/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
+------------------------------------------------------------------
+  0  70 Bra
+  3     abc
+  9   6 CBra 1
+ 13     d
+ 15   5 Alt
+ 18     e
+ 20  11 Ket
+ 23     *THEN
+ 24     x
+ 26  13 CBra 2
+ 30     123
+ 36     *THEN
+ 37     4
+ 39  28 Alt
+ 42     567
+ 48   6 CBra 3
+ 52     b
+ 54   5 Alt
+ 57     q
+ 59  11 Ket
+ 62     *THEN
+ 63     xx
+ 67  41 Ket
+ 70  70 Ket
+ 73     End
+------------------------------------------------------------------
+
+/(((a\2)|(a*)\g<-1>))*a?/
+------------------------------------------------------------------
+  0  52 Bra
+  3     Brazero
+  4  43 SCBra 1
+  8  36 Once
+ 11  15 CBra 2
+ 15   8 CBra 3
+ 19     a
+ 21     \2
+ 23   8 Ket
+ 26  15 Alt
+ 29   6 CBra 4
+ 33     a*
+ 35   6 Ket
+ 38  29 Recurse
+ 41  30 Ket
+ 44  36 Ket
+ 47  43 KetRmax
+ 50     a?+
+ 52  52 Ket
+ 55     End
+------------------------------------------------------------------
+
+/((?+1)(\1))/
+------------------------------------------------------------------
+  0  28 Bra
+  3  22 Once
+  6  16 CBra 1
+ 10  13 Recurse
+ 13   6 CBra 2
+ 17     \1
+ 19   6 Ket
+ 22  16 Ket
+ 25  22 Ket
+ 28  28 Ket
+ 31     End
+------------------------------------------------------------------
+
+"(?1)(?#?'){2}(a)"
+------------------------------------------------------------------
+  0  30 Bra
+  3   6 Once
+  6  21 Recurse
+  9   6 Ket
+ 12   6 Once
+ 15  21 Recurse
+ 18   6 Ket
+ 21   6 CBra 1
+ 25     a
+ 27   6 Ket
+ 30  30 Ket
+ 33     End
+------------------------------------------------------------------
+
+/.((?2)(?R)|\1|$)()/
+------------------------------------------------------------------
+  0  39 Bra
+  3     Any
+  4  25 Once
+  7  10 CBra 1
+ 11  32 Recurse
+ 14   0 Recurse
+ 17   5 Alt
+ 20     \1
+ 22   4 Alt
+ 25     $
+ 26  19 Ket
+ 29  25 Ket
+ 32   4 CBra 2
+ 36   4 Ket
+ 39  39 Ket
+ 42     End
+------------------------------------------------------------------
+
+/.((?3)(?R)()(?2)|\1|$)()/
+------------------------------------------------------------------
+  0  49 Bra
+  3     Any
+  4  35 Once
+  7  20 CBra 1
+ 11  42 Recurse
+ 14   0 Recurse
+ 17   4 CBra 2
+ 21   4 Ket
+ 24  17 Recurse
+ 27   5 Alt
+ 30     \1
+ 32   4 Alt
+ 35     $
+ 36  29 Ket
+ 39  35 Ket
+ 42   4 CBra 3
+ 46   4 Ket
+ 49  49 Ket
+ 52     End
+------------------------------------------------------------------
+
+/(?1)()((((((\1++))\x85)+)|))/
+------------------------------------------------------------------
+  0  69 Bra
+  3   6 Recurse
+  6   4 CBra 1
+ 10   4 Ket
+ 13  53 CBra 2
+ 17  43 CBra 3
+ 21  36 CBra 4
+ 25  29 CBra 5
+ 29  20 CBra 6
+ 33  13 CBra 7
+ 37   6 Once
+ 40     \1+
+ 43   6 Ket
+ 46  13 Ket
+ 49  20 Ket
+ 52     \x{85}
+ 54  29 KetRmax
+ 57  36 Ket
+ 60   3 Alt
+ 63  46 Ket
+ 66  53 Ket
+ 69  69 Ket
+ 72     End
+------------------------------------------------------------------
+
+# Check the absolute limit on nesting (?| etc. This varies with code unit
+# width because the workspace is a different number of bytes. It will fail
+# with link size 2 in 8-bit and 16-bit but not in 32-bit.
+
+/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
+)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+/parens_nest_limit=1000,-fullbincode
+
+# Use "expand" to create some very long patterns with nested parentheses, in
+# order to test workspace overflow. Again, this varies with code unit width,
+# and even with it fails in two modes, the error offset differs. It also varies
+# with link size - hence multiple tests with different values.
+
+/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{159}*THEN:\[A]{255}\[)]{160}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{199}*THEN:\[A]{255}\[)]{200}/expand,-fullbincode
+Failed: error 186 at offset 1147: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{299}*THEN:\[A]{255}\[)]{300}/expand,-fullbincode
+Failed: error 186 at offset 1147: regular expression is too complicated
+
+/(?(1)(?1)){8,}+()/debug
+------------------------------------------------------------------
+  0 110 Bra
+  3  97 Once
+  6   8 Cond
+  9   1 Cond ref
+ 11 103 Recurse
+ 14   8 Ket
+ 17   8 Cond
+ 20   1 Cond ref
+ 22 103 Recurse
+ 25   8 Ket
+ 28   8 Cond
+ 31   1 Cond ref
+ 33 103 Recurse
+ 36   8 Ket
+ 39   8 Cond
+ 42   1 Cond ref
+ 44 103 Recurse
+ 47   8 Ket
+ 50   8 Cond
+ 53   1 Cond ref
+ 55 103 Recurse
+ 58   8 Ket
+ 61   8 Cond
+ 64   1 Cond ref
+ 66 103 Recurse
+ 69   8 Ket
+ 72   8 Cond
+ 75   1 Cond ref
+ 77 103 Recurse
+ 80   8 Ket
+ 83  14 SBraPos
+ 86   8 SCond
+ 89   1 Cond ref
+ 91 103 Recurse
+ 94   8 Ket
+ 97  14 KetRpos
+100  97 Ket
+103   4 CBra 1
+107   4 Ket
+110 110 Ket
+113     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcd
+ 0: 
+ 1: 
+
+/(?(1)|a(?1)b){2,}+()/debug
+------------------------------------------------------------------
+  0  58 Bra
+  3  45 Once
+  6   5 Cond
+  9   1 Cond ref
+ 11  10 Alt
+ 14     a
+ 16  51 Recurse
+ 19     b
+ 21  15 Ket
+ 24  21 SBraPos
+ 27   5 SCond
+ 30   1 Cond ref
+ 32  10 Alt
+ 35     a
+ 37  51 Recurse
+ 40     b
+ 42  15 Ket
+ 45  21 KetRpos
+ 48  45 Ket
+ 51   4 CBra 1
+ 55   4 Ket
+ 58  58 Ket
+ 61     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcde
+No match
+
+/((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug
+------------------------------------------------------------------
+  0 194 Bra
+  3  61 CBra 1
+  7   3 Recurse
+ 10 131 Recurse
+ 13 138 Recurse
+ 16 145 Recurse
+ 19 152 Recurse
+ 22 159 Recurse
+ 25 166 Recurse
+ 28 173 Recurse
+ 31 180 Recurse
+ 34 180 Recurse
+ 37 173 Recurse
+ 40 166 Recurse
+ 43 159 Recurse
+ 46 152 Recurse
+ 49 145 Recurse
+ 52 138 Recurse
+ 55 131 Recurse
+ 58   3 Recurse
+ 61   0 Recurse
+ 64  61 Ket
+ 67  61 SCBra 1
+ 71   3 Recurse
+ 74 131 Recurse
+ 77 138 Recurse
+ 80 145 Recurse
+ 83 152 Recurse
+ 86 159 Recurse
+ 89 166 Recurse
+ 92 173 Recurse
+ 95 180 Recurse
+ 98 180 Recurse
+101 173 Recurse
+104 166 Recurse
+107 159 Recurse
+110 152 Recurse
+113 145 Recurse
+116 138 Recurse
+119 131 Recurse
+122   3 Recurse
+125   0 Recurse
+128  61 KetRmax
+131   4 CBra 2
+135   4 Ket
+138   4 CBra 3
+142   4 Ket
+145   4 CBra 4
+149   4 Ket
+152   4 CBra 5
+156   4 Ket
+159   4 CBra 6
+163   4 Ket
+166   4 CBra 7
+170   4 Ket
+173   4 CBra 8
+177   4 Ket
+180   4 CBra 9
+184   4 Ket
+187   4 CBra 10
+191   4 Ket
+194 194 Ket
+197     End
+------------------------------------------------------------------
+Capturing subpattern count = 10
+May match empty string
+Subject length lower bound = 0
+
+# End of testinput8
diff --git a/testdata/testoutput8-32 b/testdata/testoutput8-32
deleted file mode 100644 (file)
index 1b843a5..0000000
+++ /dev/null
@@ -1,851 +0,0 @@
-# These are a few representative patterns whose lengths and offsets are to be
-# shown when the link size is 2. This is just a doublecheck test to ensure the
-# sizes don't go horribly wrong when something is changed. The pattern contents
-# are all themselves checked in other tests. Unicode, including property
-# support, is required for these tests.
-
-#pattern fullbincode,memory
-
-/((?i)b)/
-Memory allocation (code space): 48
-------------------------------------------------------------------
-  0   9 Bra
-  2   5 CBra 1
-  5  /i b
-  7   5 Ket
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/(?s)(.*X|^B)/
-Memory allocation (code space): 76
-------------------------------------------------------------------
-  0  16 Bra
-  2   7 CBra 1
-  5     AllAny*
-  7     X
-  9   5 Alt
- 11     ^
- 12     B
- 14  12 Ket
- 16  16 Ket
- 18     End
-------------------------------------------------------------------
-
-/(?s:.*X|^B)/
-Memory allocation (code space): 72
-------------------------------------------------------------------
-  0  15 Bra
-  2   6 Bra
-  4     AllAny*
-  6     X
-  8   5 Alt
- 10     ^
- 11     B
- 13  11 Ket
- 15  15 Ket
- 17     End
-------------------------------------------------------------------
-
-/^[[:alnum:]]/
-Memory allocation (code space): 60
-------------------------------------------------------------------
-  0  12 Bra
-  2     ^
-  3     [0-9A-Za-z]
- 12  12 Ket
- 14     End
-------------------------------------------------------------------
-
-/#/Ix
-Memory allocation (code space): 20
-------------------------------------------------------------------
-  0   2 Bra
-  2   2 Ket
-  4     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-May match empty string
-Options: extended
-Subject length lower bound = 0
-
-/a#/Ix
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     a
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: extended
-First code unit = 'a'
-Subject length lower bound = 1
-
-/x?+/
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     x?+
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/x++/
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     x++
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/x{1,3}+/
-Memory allocation (code space): 40
-------------------------------------------------------------------
-  0   7 Bra
-  2     x
-  4     x{0,2}+
-  7   7 Ket
-  9     End
-------------------------------------------------------------------
-
-/(x)*+/
-Memory allocation (code space): 52
-------------------------------------------------------------------
-  0  10 Bra
-  2     Braposzero
-  3   5 CBraPos 1
-  6     x
-  8   5 KetRpos
- 10  10 Ket
- 12     End
-------------------------------------------------------------------
-
-/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
-Memory allocation (code space): 220
-------------------------------------------------------------------
-  0  52 Bra
-  2     ^
-  3  47 CBra 1
-  6   5 CBra 2
-  9     a+
- 11   5 Ket
- 13  13 CBra 3
- 16     [ab]+?
- 26  13 Ket
- 28  13 CBra 4
- 31     [bc]+
- 41  13 Ket
- 43   5 CBra 5
- 46     \w*+
- 48   5 Ket
- 50  47 Ket
- 52  52 Ket
- 54     End
-------------------------------------------------------------------
-
-"8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
-Memory allocation (code space): 3296
-------------------------------------------------------------------
-  0 821 Bra
-  2     8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
-820     \b
-821 821 Ket
-823     End
-------------------------------------------------------------------
-
-"\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
-Memory allocation (code space): 3256
-------------------------------------------------------------------
-  0 811 Bra
-  2     $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
-810     \b
-811 811 Ket
-813     End
-------------------------------------------------------------------
-
-/(a(?1)b)/
-Memory allocation (code space): 64
-------------------------------------------------------------------
-  0  13 Bra
-  2   9 CBra 1
-  5     a
-  7   2 Recurse
-  9     b
- 11   9 Ket
- 13  13 Ket
- 15     End
-------------------------------------------------------------------
-
-/(a(?1)+b)/
-Memory allocation (code space): 80
-------------------------------------------------------------------
-  0  17 Bra
-  2  13 CBra 1
-  5     a
-  7   4 Once
-  9   2 Recurse
- 11   4 KetRmax
- 13     b
- 15  13 Ket
- 17  17 Ket
- 19     End
-------------------------------------------------------------------
-
-/a(?P<name1>b|c)d(?P<longername2>e)/
-Memory allocation (code space): 108
-------------------------------------------------------------------
-  0  24 Bra
-  2     a
-  4   5 CBra 1
-  7     b
-  9   4 Alt
- 11     c
- 13   9 Ket
- 15     d
- 17   5 CBra 2
- 20     e
- 22   5 Ket
- 24  24 Ket
- 26     End
-------------------------------------------------------------------
-
-/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
-Memory allocation (code space): 128
-------------------------------------------------------------------
-  0  29 Bra
-  2  18 Bra
-  4     a
-  6  12 CBra 1
-  9     c
- 11   5 CBra 2
- 14     d
- 16   5 Ket
- 18  12 Ket
- 20  18 Ket
- 22   5 CBra 3
- 25     a
- 27   5 Ket
- 29  29 Ket
- 31     End
-------------------------------------------------------------------
-
-/(?P<a>a)...(?P=a)bbb(?P>a)d/
-Memory allocation (code space): 108
-------------------------------------------------------------------
-  0  24 Bra
-  2   5 CBra 1
-  5     a
-  7   5 Ket
-  9     Any
- 10     Any
- 11     Any
- 12     \1
- 14     bbb
- 20   2 Recurse
- 22     d
- 24  24 Ket
- 26     End
-------------------------------------------------------------------
-
-/abc(?C255)de(?C)f/
-Memory allocation (code space): 100
-------------------------------------------------------------------
-  0  22 Bra
-  2     abc
-  8     Callout 255 10 1
- 12     de
- 16     Callout 0 16 1
- 20     f
- 22  22 Ket
- 24     End
-------------------------------------------------------------------
-
-/abcde/auto_callout
-Memory allocation (code space): 156
-------------------------------------------------------------------
-  0  36 Bra
-  2     Callout 255 0 1
-  6     a
-  8     Callout 255 1 1
- 12     b
- 14     Callout 255 2 1
- 18     c
- 20     Callout 255 3 1
- 24     d
- 26     Callout 255 4 1
- 30     e
- 32     Callout 255 5 0
- 36  36 Ket
- 38     End
-------------------------------------------------------------------
-
-/\x{100}/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{100}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\x{1000}/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{1000}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\x{10000}/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{10000}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\x{100000}/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{100000}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\x{10ffff}/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{10ffff}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\x{110000}/utf
-Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
-
-/[\x{ff}]/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{ff}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[\x{100}]/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{100}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\x80/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{80}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\xff/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{ff}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
-Memory allocation (code space): 52
-------------------------------------------------------------------
-  0  10 Bra
-  2     A\x{2262}\x{391}.
- 10  10 Ket
- 12     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: utf
-First code unit = 'A'
-Last code unit = '.'
-Subject length lower bound = 4
-    
-/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
-Memory allocation (code space): 44
-------------------------------------------------------------------
-  0   8 Bra
-  2     \x{d55c}\x{ad6d}\x{c5b4}
-  8   8 Ket
- 10     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: utf
-First code unit = \x{d55c}
-Last code unit = \x{c5b4}
-Subject length lower bound = 3
-
-/\x{65e5}\x{672c}\x{8a9e}/I,utf
-Memory allocation (code space): 44
-------------------------------------------------------------------
-  0   8 Bra
-  2     \x{65e5}\x{672c}\x{8a9e}
-  8   8 Ket
- 10     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: utf
-First code unit = \x{65e5}
-Last code unit = \x{8a9e}
-Subject length lower bound = 3
-
-/[\x{100}]/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{100}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[Z\x{100}]/utf
-Memory allocation (code space): 76
-------------------------------------------------------------------
-  0  16 Bra
-  2     [Z\x{100}]
- 16  16 Ket
- 18     End
-------------------------------------------------------------------
-
-/^[\x{100}\E-\Q\E\x{150}]/utf
-Memory allocation (code space): 52
-------------------------------------------------------------------
-  0  10 Bra
-  2     ^
-  3     [\x{100}-\x{150}]
- 10  10 Ket
- 12     End
-------------------------------------------------------------------
-
-/^[\QĀ\E-\QŐ\E]/utf
-Memory allocation (code space): 52
-------------------------------------------------------------------
-  0  10 Bra
-  2     ^
-  3     [\x{100}-\x{150}]
- 10  10 Ket
- 12     End
-------------------------------------------------------------------
-
-/^[\QĀ\E-\QŐ\E/utf
-Failed: error 106 at offset 13: missing terminating ] for character class
-
-/[\p{L}]/
-Memory allocation (code space): 48
-------------------------------------------------------------------
-  0   9 Bra
-  2     [\p{L}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/[\p{^L}]/
-Memory allocation (code space): 48
-------------------------------------------------------------------
-  0   9 Bra
-  2     [\P{L}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/[\P{L}]/
-Memory allocation (code space): 48
-------------------------------------------------------------------
-  0   9 Bra
-  2     [\P{L}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/[\P{^L}]/
-Memory allocation (code space): 48
-------------------------------------------------------------------
-  0   9 Bra
-  2     [\p{L}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/[abc\p{L}\x{0660}]/utf
-Memory allocation (code space): 88
-------------------------------------------------------------------
-  0  19 Bra
-  2     [a-c\p{L}\x{660}]
- 19  19 Ket
- 21     End
-------------------------------------------------------------------
-
-/[\p{Nd}]/utf
-Memory allocation (code space): 48
-------------------------------------------------------------------
-  0   9 Bra
-  2     [\p{Nd}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/[\p{Nd}+-]+/utf
-Memory allocation (code space): 84
-------------------------------------------------------------------
-  0  18 Bra
-  2     [+\-\p{Nd}]++
- 18  18 Ket
- 20     End
-------------------------------------------------------------------
-
-/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
-Memory allocation (code space): 60
-------------------------------------------------------------------
-  0  12 Bra
-  2  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
- 12  12 Ket
- 14     End
-------------------------------------------------------------------
-
-/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
-Memory allocation (code space): 60
-------------------------------------------------------------------
-  0  12 Bra
-  2     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
- 12  12 Ket
- 14     End
-------------------------------------------------------------------
-
-/[\x{105}-\x{109}]/i,utf
-Memory allocation (code space): 48
-------------------------------------------------------------------
-  0   9 Bra
-  2     [\x{104}-\x{109}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/( ( (?(1)0|) )*   )/x
-Memory allocation (code space): 104
-------------------------------------------------------------------
-  0  23 Bra
-  2  19 CBra 1
-  5     Brazero
-  6  13 SCBra 2
-  9   6 Cond
- 11   1 Cond ref
- 13     0
- 15   2 Alt
- 17   8 Ket
- 19  13 KetRmax
- 21  19 Ket
- 23  23 Ket
- 25     End
-------------------------------------------------------------------
-
-/(  (?(1)0|)*   )/x
-Memory allocation (code space): 84
-------------------------------------------------------------------
-  0  18 Bra
-  2  14 CBra 1
-  5     Brazero
-  6   6 SCond
-  8   1 Cond ref
- 10     0
- 12   2 Alt
- 14   8 KetRmax
- 16  14 Ket
- 18  18 Ket
- 20     End
-------------------------------------------------------------------
-
-/[a]/
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     a
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[a]/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     a
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[\xaa]/
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{aa}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[\xaa]/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     \x{aa}
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[^a]/
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     [^a]
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[^a]/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     [^a]
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[^\xaa]/
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     [^\x{aa}]
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-/[^\xaa]/utf
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0   4 Bra
-  2     [^\x{aa}]
-  4   4 Ket
-  6     End
-------------------------------------------------------------------
-
-#pattern -memory
-
-/[^\d]/utf,ucp
-------------------------------------------------------------------
-  0   9 Bra
-  2     [^\p{Nd}]
-  9   9 Ket
- 11     End
-------------------------------------------------------------------
-
-/[[:^alpha:][:^cntrl:]]+/utf,ucp
-------------------------------------------------------------------
-  0  13 Bra
-  2     [\P{L}\P{Cc}]++
- 13  13 Ket
- 15     End
-------------------------------------------------------------------
-
-/[[:^cntrl:][:^alpha:]]+/utf,ucp
-------------------------------------------------------------------
-  0  13 Bra
-  2     [\P{Cc}\P{L}]++
- 13  13 Ket
- 15     End
-------------------------------------------------------------------
-
-/[[:alpha:]]+/utf,ucp
-------------------------------------------------------------------
-  0  10 Bra
-  2     [\p{L}]++
- 10  10 Ket
- 12     End
-------------------------------------------------------------------
-
-/[[:^alpha:]\S]+/utf,ucp
-------------------------------------------------------------------
-  0  13 Bra
-  2     [\P{L}\P{Xsp}]++
- 13  13 Ket
- 15     End
-------------------------------------------------------------------
-
-/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
-------------------------------------------------------------------
-  0  60 Bra
-  2     abc
-  8   5 CBra 1
- 11     d
- 13   4 Alt
- 15     e
- 17   9 Ket
- 19     *THEN
- 20     x
- 22  12 CBra 2
- 25     123
- 31     *THEN
- 32     4
- 34  24 Alt
- 36     567
- 42   5 CBra 3
- 45     b
- 47   4 Alt
- 49     q
- 51   9 Ket
- 53     *THEN
- 54     xx
- 58  36 Ket
- 60  60 Ket
- 62     End
-------------------------------------------------------------------
-
-/(((a\2)|(a*)\g<-1>))*a?/
-------------------------------------------------------------------
-  0  39 Bra
-  2     Brazero
-  3  32 SCBra 1
-  6  27 Once
-  8  12 CBra 2
- 11   7 CBra 3
- 14     a
- 16     \2
- 18   7 Ket
- 20  11 Alt
- 22   5 CBra 4
- 25     a*
- 27   5 Ket
- 29  22 Recurse
- 31  23 Ket
- 33  27 Ket
- 35  32 KetRmax
- 37     a?+
- 39  39 Ket
- 41     End
-------------------------------------------------------------------
-
-/((?+1)(\1))/
-------------------------------------------------------------------
-  0  20 Bra
-  2  16 Once
-  4  12 CBra 1
-  7   9 Recurse
-  9   5 CBra 2
- 12     \1
- 14   5 Ket
- 16  12 Ket
- 18  16 Ket
- 20  20 Ket
- 22     End
-------------------------------------------------------------------
-
-"(?1)(?#?'){2}(a)"
-------------------------------------------------------------------
-  0  21 Bra
-  2   4 Once
-  4  14 Recurse
-  6   4 Ket
-  8   4 Once
- 10  14 Recurse
- 12   4 Ket
- 14   5 CBra 1
- 17     a
- 19   5 Ket
- 21  21 Ket
- 23     End
-------------------------------------------------------------------
-
-/.((?2)(?R)|\1|$)()/
-------------------------------------------------------------------
-  0  28 Bra
-  2     Any
-  3  18 Once
-  5   7 CBra 1
-  8  23 Recurse
- 10   0 Recurse
- 12   4 Alt
- 14     \1
- 16   3 Alt
- 18     $
- 19  14 Ket
- 21  18 Ket
- 23   3 CBra 2
- 26   3 Ket
- 28  28 Ket
- 30     End
-------------------------------------------------------------------
-
-/.((?3)(?R)()(?2)|\1|$)()/
-------------------------------------------------------------------
-  0  35 Bra
-  2     Any
-  3  25 Once
-  5  14 CBra 1
-  8  30 Recurse
- 10   0 Recurse
- 12   3 CBra 2
- 15   3 Ket
- 17  12 Recurse
- 19   4 Alt
- 21     \1
- 23   3 Alt
- 25     $
- 26  21 Ket
- 28  25 Ket
- 30   3 CBra 3
- 33   3 Ket
- 35  35 Ket
- 37     End
-------------------------------------------------------------------
-
-/(?1)()((((((\1++))\x85)+)|))/
-------------------------------------------------------------------
-  0  50 Bra
-  2   4 Recurse
-  4   3 CBra 1
-  7   3 Ket
-  9  39 CBra 2
- 12  32 CBra 3
- 15  27 CBra 4
- 18  22 CBra 5
- 21  15 CBra 6
- 24  10 CBra 7
- 27   5 Once
- 29     \1+
- 32   5 Ket
- 34  10 Ket
- 36  15 Ket
- 38     \x{85}
- 40  22 KetRmax
- 42  27 Ket
- 44   2 Alt
- 46  34 Ket
- 48  39 Ket
- 50  50 Ket
- 52     End
-------------------------------------------------------------------
-
-# Check the absolute limit on nesting (?| etc. This varies with code unit
-# width because the workspace is a different number of bytes. It will fail
-# in 8-bit and 16-bit but not in 32-bit.
-    
-/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
-)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
-/parens_nest_limit=1000,-fullbincode
-
-# End of testinput8
diff --git a/testdata/testoutput8-32-2 b/testdata/testoutput8-32-2
new file mode 100644 (file)
index 0000000..babd0c7
--- /dev/null
@@ -0,0 +1,1026 @@
+# There are two sorts of patterns in this test. A number of them are
+# representative patterns whose lengths and offsets are checked. This is just a
+# doublecheck test to ensure the sizes don't go horribly wrong when something
+# is changed. The operation of these patterns is checked in other tests.
+#
+# This file also contains tests whose output varies with code unit size and/or
+# link size. Unicode support is required for these tests. There are separate
+# output files for each code unit size and link size.
+
+#pattern fullbincode,memory
+
+/((?i)b)/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2   5 CBra 1
+  5  /i b
+  7   5 Ket
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/(?s)(.*X|^B)/
+Memory allocation (code space): 76
+------------------------------------------------------------------
+  0  16 Bra
+  2   7 CBra 1
+  5     AllAny*
+  7     X
+  9   5 Alt
+ 11     ^
+ 12     B
+ 14  12 Ket
+ 16  16 Ket
+ 18     End
+------------------------------------------------------------------
+
+/(?s:.*X|^B)/
+Memory allocation (code space): 72
+------------------------------------------------------------------
+  0  15 Bra
+  2   6 Bra
+  4     AllAny*
+  6     X
+  8   5 Alt
+ 10     ^
+ 11     B
+ 13  11 Ket
+ 15  15 Ket
+ 17     End
+------------------------------------------------------------------
+
+/^[[:alnum:]]/
+Memory allocation (code space): 60
+------------------------------------------------------------------
+  0  12 Bra
+  2     ^
+  3     [0-9A-Za-z]
+ 12  12 Ket
+ 14     End
+------------------------------------------------------------------
+
+/#/Ix
+Memory allocation (code space): 20
+------------------------------------------------------------------
+  0   2 Bra
+  2   2 Ket
+  4     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+May match empty string
+Options: extended
+Subject length lower bound = 0
+
+/a#/Ix
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     a
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: extended
+First code unit = 'a'
+Subject length lower bound = 1
+
+/x?+/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     x?+
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/x++/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     x++
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/x{1,3}+/
+Memory allocation (code space): 40
+------------------------------------------------------------------
+  0   7 Bra
+  2     x
+  4     x{0,2}+
+  7   7 Ket
+  9     End
+------------------------------------------------------------------
+
+/(x)*+/
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  10 Bra
+  2     Braposzero
+  3   5 CBraPos 1
+  6     x
+  8   5 KetRpos
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
+Memory allocation (code space): 220
+------------------------------------------------------------------
+  0  52 Bra
+  2     ^
+  3  47 CBra 1
+  6   5 CBra 2
+  9     a+
+ 11   5 Ket
+ 13  13 CBra 3
+ 16     [ab]+?
+ 26  13 Ket
+ 28  13 CBra 4
+ 31     [bc]+
+ 41  13 Ket
+ 43   5 CBra 5
+ 46     \w*+
+ 48   5 Ket
+ 50  47 Ket
+ 52  52 Ket
+ 54     End
+------------------------------------------------------------------
+
+"8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 3296
+------------------------------------------------------------------
+  0 821 Bra
+  2     8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+820     \b
+821 821 Ket
+823     End
+------------------------------------------------------------------
+
+"\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 3256
+------------------------------------------------------------------
+  0 811 Bra
+  2     $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+810     \b
+811 811 Ket
+813     End
+------------------------------------------------------------------
+
+/(a(?1)b)/
+Memory allocation (code space): 64
+------------------------------------------------------------------
+  0  13 Bra
+  2   9 CBra 1
+  5     a
+  7   2 Recurse
+  9     b
+ 11   9 Ket
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/(a(?1)+b)/
+Memory allocation (code space): 80
+------------------------------------------------------------------
+  0  17 Bra
+  2  13 CBra 1
+  5     a
+  7   4 Once
+  9   2 Recurse
+ 11   4 KetRmax
+ 13     b
+ 15  13 Ket
+ 17  17 Ket
+ 19     End
+------------------------------------------------------------------
+
+/a(?P<name1>b|c)d(?P<longername2>e)/
+Memory allocation (code space): 108
+------------------------------------------------------------------
+  0  24 Bra
+  2     a
+  4   5 CBra 1
+  7     b
+  9   4 Alt
+ 11     c
+ 13   9 Ket
+ 15     d
+ 17   5 CBra 2
+ 20     e
+ 22   5 Ket
+ 24  24 Ket
+ 26     End
+------------------------------------------------------------------
+
+/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
+Memory allocation (code space): 128
+------------------------------------------------------------------
+  0  29 Bra
+  2  18 Bra
+  4     a
+  6  12 CBra 1
+  9     c
+ 11   5 CBra 2
+ 14     d
+ 16   5 Ket
+ 18  12 Ket
+ 20  18 Ket
+ 22   5 CBra 3
+ 25     a
+ 27   5 Ket
+ 29  29 Ket
+ 31     End
+------------------------------------------------------------------
+
+/(?P<a>a)...(?P=a)bbb(?P>a)d/
+Memory allocation (code space): 108
+------------------------------------------------------------------
+  0  24 Bra
+  2   5 CBra 1
+  5     a
+  7   5 Ket
+  9     Any
+ 10     Any
+ 11     Any
+ 12     \1
+ 14     bbb
+ 20   2 Recurse
+ 22     d
+ 24  24 Ket
+ 26     End
+------------------------------------------------------------------
+
+/abc(?C255)de(?C)f/
+Memory allocation (code space): 100
+------------------------------------------------------------------
+  0  22 Bra
+  2     abc
+  8     Callout 255 10 1
+ 12     de
+ 16     Callout 0 16 1
+ 20     f
+ 22  22 Ket
+ 24     End
+------------------------------------------------------------------
+
+/abcde/auto_callout
+Memory allocation (code space): 156
+------------------------------------------------------------------
+  0  36 Bra
+  2     Callout 255 0 1
+  6     a
+  8     Callout 255 1 1
+ 12     b
+ 14     Callout 255 2 1
+ 18     c
+ 20     Callout 255 3 1
+ 24     d
+ 26     Callout 255 4 1
+ 30     e
+ 32     Callout 255 5 0
+ 36  36 Ket
+ 38     End
+------------------------------------------------------------------
+
+/\x{100}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{1000}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{1000}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{10000}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{10000}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{100000}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100000}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{10ffff}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{10ffff}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{110000}/utf
+Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
+
+/[\x{ff}]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{ff}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[\x{100}]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x80/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{80}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\xff/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{ff}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  10 Bra
+  2     A\x{2262}\x{391}.
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = 'A'
+Last code unit = '.'
+Subject length lower bound = 4
+
+/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
+Memory allocation (code space): 44
+------------------------------------------------------------------
+  0   8 Bra
+  2     \x{d55c}\x{ad6d}\x{c5b4}
+  8   8 Ket
+ 10     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \x{d55c}
+Last code unit = \x{c5b4}
+Subject length lower bound = 3
+
+/\x{65e5}\x{672c}\x{8a9e}/I,utf
+Memory allocation (code space): 44
+------------------------------------------------------------------
+  0   8 Bra
+  2     \x{65e5}\x{672c}\x{8a9e}
+  8   8 Ket
+ 10     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \x{65e5}
+Last code unit = \x{8a9e}
+Subject length lower bound = 3
+
+/[\x{100}]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[Z\x{100}]/utf
+Memory allocation (code space): 76
+------------------------------------------------------------------
+  0  16 Bra
+  2     [Z\x{100}]
+ 16  16 Ket
+ 18     End
+------------------------------------------------------------------
+
+/^[\x{100}\E-\Q\E\x{150}]/utf
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  10 Bra
+  2     ^
+  3     [\x{100}-\x{150}]
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E]/utf
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  10 Bra
+  2     ^
+  3     [\x{100}-\x{150}]
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E/utf
+Failed: error 106 at offset 13: missing terminating ] for character class
+
+/[\p{L}]/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\p{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\p{^L}]/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\P{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\P{L}]/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\P{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\P{^L}]/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\p{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[abc\p{L}\x{0660}]/utf
+Memory allocation (code space): 88
+------------------------------------------------------------------
+  0  19 Bra
+  2     [a-c\p{L}\x{660}]
+ 19  19 Ket
+ 21     End
+------------------------------------------------------------------
+
+/[\p{Nd}]/utf
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\p{Nd}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\p{Nd}+-]+/utf
+Memory allocation (code space): 84
+------------------------------------------------------------------
+  0  18 Bra
+  2     [+\-\p{Nd}]++
+ 18  18 Ket
+ 20     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
+Memory allocation (code space): 60
+------------------------------------------------------------------
+  0  12 Bra
+  2  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 12  12 Ket
+ 14     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
+Memory allocation (code space): 60
+------------------------------------------------------------------
+  0  12 Bra
+  2     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 12  12 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[\x{105}-\x{109}]/i,utf
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\x{104}-\x{109}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/( ( (?(1)0|) )*   )/x
+Memory allocation (code space): 104
+------------------------------------------------------------------
+  0  23 Bra
+  2  19 CBra 1
+  5     Brazero
+  6  13 SCBra 2
+  9   6 Cond
+ 11   1 Cond ref
+ 13     0
+ 15   2 Alt
+ 17   8 Ket
+ 19  13 KetRmax
+ 21  19 Ket
+ 23  23 Ket
+ 25     End
+------------------------------------------------------------------
+
+/(  (?(1)0|)*   )/x
+Memory allocation (code space): 84
+------------------------------------------------------------------
+  0  18 Bra
+  2  14 CBra 1
+  5     Brazero
+  6   6 SCond
+  8   1 Cond ref
+ 10     0
+ 12   2 Alt
+ 14   8 KetRmax
+ 16  14 Ket
+ 18  18 Ket
+ 20     End
+------------------------------------------------------------------
+
+/[a]/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     a
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[a]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     a
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[\xaa]/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{aa}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[\xaa]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{aa}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^a]/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^a]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^a]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^a]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^\xaa]/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^\x{aa}]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^\xaa]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^\x{aa}]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+#pattern -memory
+
+/[^\d]/utf,ucp
+------------------------------------------------------------------
+  0   9 Bra
+  2     [^\p{Nd}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[[:^alpha:][:^cntrl:]]+/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  2     [\P{L}\P{Cc}]++
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/[[:^cntrl:][:^alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  2     [\P{Cc}\P{L}]++
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/[[:alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  10 Bra
+  2     [\p{L}]++
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/[[:^alpha:]\S]+/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  2     [\P{L}\P{Xsp}]++
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
+------------------------------------------------------------------
+  0  60 Bra
+  2     abc
+  8   5 CBra 1
+ 11     d
+ 13   4 Alt
+ 15     e
+ 17   9 Ket
+ 19     *THEN
+ 20     x
+ 22  12 CBra 2
+ 25     123
+ 31     *THEN
+ 32     4
+ 34  24 Alt
+ 36     567
+ 42   5 CBra 3
+ 45     b
+ 47   4 Alt
+ 49     q
+ 51   9 Ket
+ 53     *THEN
+ 54     xx
+ 58  36 Ket
+ 60  60 Ket
+ 62     End
+------------------------------------------------------------------
+
+/(((a\2)|(a*)\g<-1>))*a?/
+------------------------------------------------------------------
+  0  39 Bra
+  2     Brazero
+  3  32 SCBra 1
+  6  27 Once
+  8  12 CBra 2
+ 11   7 CBra 3
+ 14     a
+ 16     \2
+ 18   7 Ket
+ 20  11 Alt
+ 22   5 CBra 4
+ 25     a*
+ 27   5 Ket
+ 29  22 Recurse
+ 31  23 Ket
+ 33  27 Ket
+ 35  32 KetRmax
+ 37     a?+
+ 39  39 Ket
+ 41     End
+------------------------------------------------------------------
+
+/((?+1)(\1))/
+------------------------------------------------------------------
+  0  20 Bra
+  2  16 Once
+  4  12 CBra 1
+  7   9 Recurse
+  9   5 CBra 2
+ 12     \1
+ 14   5 Ket
+ 16  12 Ket
+ 18  16 Ket
+ 20  20 Ket
+ 22     End
+------------------------------------------------------------------
+
+"(?1)(?#?'){2}(a)"
+------------------------------------------------------------------
+  0  21 Bra
+  2   4 Once
+  4  14 Recurse
+  6   4 Ket
+  8   4 Once
+ 10  14 Recurse
+ 12   4 Ket
+ 14   5 CBra 1
+ 17     a
+ 19   5 Ket
+ 21  21 Ket
+ 23     End
+------------------------------------------------------------------
+
+/.((?2)(?R)|\1|$)()/
+------------------------------------------------------------------
+  0  28 Bra
+  2     Any
+  3  18 Once
+  5   7 CBra 1
+  8  23 Recurse
+ 10   0 Recurse
+ 12   4 Alt
+ 14     \1
+ 16   3 Alt
+ 18     $
+ 19  14 Ket
+ 21  18 Ket
+ 23   3 CBra 2
+ 26   3 Ket
+ 28  28 Ket
+ 30     End
+------------------------------------------------------------------
+
+/.((?3)(?R)()(?2)|\1|$)()/
+------------------------------------------------------------------
+  0  35 Bra
+  2     Any
+  3  25 Once
+  5  14 CBra 1
+  8  30 Recurse
+ 10   0 Recurse
+ 12   3 CBra 2
+ 15   3 Ket
+ 17  12 Recurse
+ 19   4 Alt
+ 21     \1
+ 23   3 Alt
+ 25     $
+ 26  21 Ket
+ 28  25 Ket
+ 30   3 CBra 3
+ 33   3 Ket
+ 35  35 Ket
+ 37     End
+------------------------------------------------------------------
+
+/(?1)()((((((\1++))\x85)+)|))/
+------------------------------------------------------------------
+  0  50 Bra
+  2   4 Recurse
+  4   3 CBra 1
+  7   3 Ket
+  9  39 CBra 2
+ 12  32 CBra 3
+ 15  27 CBra 4
+ 18  22 CBra 5
+ 21  15 CBra 6
+ 24  10 CBra 7
+ 27   5 Once
+ 29     \1+
+ 32   5 Ket
+ 34  10 Ket
+ 36  15 Ket
+ 38     \x{85}
+ 40  22 KetRmax
+ 42  27 Ket
+ 44   2 Alt
+ 46  34 Ket
+ 48  39 Ket
+ 50  50 Ket
+ 52     End
+------------------------------------------------------------------
+
+# Check the absolute limit on nesting (?| etc. This varies with code unit
+# width because the workspace is a different number of bytes. It will fail
+# with link size 2 in 8-bit and 16-bit but not in 32-bit.
+
+/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
+)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+/parens_nest_limit=1000,-fullbincode
+
+# Use "expand" to create some very long patterns with nested parentheses, in
+# order to test workspace overflow. Again, this varies with code unit width,
+# and even with it fails in two modes, the error offset differs. It also varies
+# with link size - hence multiple tests with different values.
+
+/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{159}*THEN:\[A]{255}\[)]{160}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{199}*THEN:\[A]{255}\[)]{200}/expand,-fullbincode
+Failed: error 186 at offset 979: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{299}*THEN:\[A]{255}\[)]{300}/expand,-fullbincode
+Failed: error 186 at offset 979: regular expression is too complicated
+
+/(?(1)(?1)){8,}+()/debug
+------------------------------------------------------------------
+  0  79 Bra
+  2  70 Once
+  4   6 Cond
+  6   1 Cond ref
+  8  74 Recurse
+ 10   6 Ket
+ 12   6 Cond
+ 14   1 Cond ref
+ 16  74 Recurse
+ 18   6 Ket
+ 20   6 Cond
+ 22   1 Cond ref
+ 24  74 Recurse
+ 26   6 Ket
+ 28   6 Cond
+ 30   1 Cond ref
+ 32  74 Recurse
+ 34   6 Ket
+ 36   6 Cond
+ 38   1 Cond ref
+ 40  74 Recurse
+ 42   6 Ket
+ 44   6 Cond
+ 46   1 Cond ref
+ 48  74 Recurse
+ 50   6 Ket
+ 52   6 Cond
+ 54   1 Cond ref
+ 56  74 Recurse
+ 58   6 Ket
+ 60  10 SBraPos
+ 62   6 SCond
+ 64   1 Cond ref
+ 66  74 Recurse
+ 68   6 Ket
+ 70  10 KetRpos
+ 72  70 Ket
+ 74   3 CBra 1
+ 77   3 Ket
+ 79  79 Ket
+ 81     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcd
+ 0: 
+ 1: 
+
+/(?(1)|a(?1)b){2,}+()/debug
+------------------------------------------------------------------
+  0  43 Bra
+  2  34 Once
+  4   4 Cond
+  6   1 Cond ref
+  8   8 Alt
+ 10     a
+ 12  38 Recurse
+ 14     b
+ 16  12 Ket
+ 18  16 SBraPos
+ 20   4 SCond
+ 22   1 Cond ref
+ 24   8 Alt
+ 26     a
+ 28  38 Recurse
+ 30     b
+ 32  12 Ket
+ 34  16 KetRpos
+ 36  34 Ket
+ 38   3 CBra 1
+ 41   3 Ket
+ 43  43 Ket
+ 45     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcde
+No match
+
+/((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug
+------------------------------------------------------------------
+  0 133 Bra
+  2  41 CBra 1
+  5   2 Recurse
+  7  88 Recurse
+  9  93 Recurse
+ 11  98 Recurse
+ 13 103 Recurse
+ 15 108 Recurse
+ 17 113 Recurse
+ 19 118 Recurse
+ 21 123 Recurse
+ 23 123 Recurse
+ 25 118 Recurse
+ 27 113 Recurse
+ 29 108 Recurse
+ 31 103 Recurse
+ 33  98 Recurse
+ 35  93 Recurse
+ 37  88 Recurse
+ 39   2 Recurse
+ 41   0 Recurse
+ 43  41 Ket
+ 45  41 SCBra 1
+ 48   2 Recurse
+ 50  88 Recurse
+ 52  93 Recurse
+ 54  98 Recurse
+ 56 103 Recurse
+ 58 108 Recurse
+ 60 113 Recurse
+ 62 118 Recurse
+ 64 123 Recurse
+ 66 123 Recurse
+ 68 118 Recurse
+ 70 113 Recurse
+ 72 108 Recurse
+ 74 103 Recurse
+ 76  98 Recurse
+ 78  93 Recurse
+ 80  88 Recurse
+ 82   2 Recurse
+ 84   0 Recurse
+ 86  41 KetRmax
+ 88   3 CBra 2
+ 91   3 Ket
+ 93   3 CBra 3
+ 96   3 Ket
+ 98   3 CBra 4
+101   3 Ket
+103   3 CBra 5
+106   3 Ket
+108   3 CBra 6
+111   3 Ket
+113   3 CBra 7
+116   3 Ket
+118   3 CBra 8
+121   3 Ket
+123   3 CBra 9
+126   3 Ket
+128   3 CBra 10
+131   3 Ket
+133 133 Ket
+135     End
+------------------------------------------------------------------
+Capturing subpattern count = 10
+May match empty string
+Subject length lower bound = 0
+
+# End of testinput8
diff --git a/testdata/testoutput8-32-3 b/testdata/testoutput8-32-3
new file mode 100644 (file)
index 0000000..babd0c7
--- /dev/null
@@ -0,0 +1,1026 @@
+# There are two sorts of patterns in this test. A number of them are
+# representative patterns whose lengths and offsets are checked. This is just a
+# doublecheck test to ensure the sizes don't go horribly wrong when something
+# is changed. The operation of these patterns is checked in other tests.
+#
+# This file also contains tests whose output varies with code unit size and/or
+# link size. Unicode support is required for these tests. There are separate
+# output files for each code unit size and link size.
+
+#pattern fullbincode,memory
+
+/((?i)b)/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2   5 CBra 1
+  5  /i b
+  7   5 Ket
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/(?s)(.*X|^B)/
+Memory allocation (code space): 76
+------------------------------------------------------------------
+  0  16 Bra
+  2   7 CBra 1
+  5     AllAny*
+  7     X
+  9   5 Alt
+ 11     ^
+ 12     B
+ 14  12 Ket
+ 16  16 Ket
+ 18     End
+------------------------------------------------------------------
+
+/(?s:.*X|^B)/
+Memory allocation (code space): 72
+------------------------------------------------------------------
+  0  15 Bra
+  2   6 Bra
+  4     AllAny*
+  6     X
+  8   5 Alt
+ 10     ^
+ 11     B
+ 13  11 Ket
+ 15  15 Ket
+ 17     End
+------------------------------------------------------------------
+
+/^[[:alnum:]]/
+Memory allocation (code space): 60
+------------------------------------------------------------------
+  0  12 Bra
+  2     ^
+  3     [0-9A-Za-z]
+ 12  12 Ket
+ 14     End
+------------------------------------------------------------------
+
+/#/Ix
+Memory allocation (code space): 20
+------------------------------------------------------------------
+  0   2 Bra
+  2   2 Ket
+  4     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+May match empty string
+Options: extended
+Subject length lower bound = 0
+
+/a#/Ix
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     a
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: extended
+First code unit = 'a'
+Subject length lower bound = 1
+
+/x?+/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     x?+
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/x++/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     x++
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/x{1,3}+/
+Memory allocation (code space): 40
+------------------------------------------------------------------
+  0   7 Bra
+  2     x
+  4     x{0,2}+
+  7   7 Ket
+  9     End
+------------------------------------------------------------------
+
+/(x)*+/
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  10 Bra
+  2     Braposzero
+  3   5 CBraPos 1
+  6     x
+  8   5 KetRpos
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
+Memory allocation (code space): 220
+------------------------------------------------------------------
+  0  52 Bra
+  2     ^
+  3  47 CBra 1
+  6   5 CBra 2
+  9     a+
+ 11   5 Ket
+ 13  13 CBra 3
+ 16     [ab]+?
+ 26  13 Ket
+ 28  13 CBra 4
+ 31     [bc]+
+ 41  13 Ket
+ 43   5 CBra 5
+ 46     \w*+
+ 48   5 Ket
+ 50  47 Ket
+ 52  52 Ket
+ 54     End
+------------------------------------------------------------------
+
+"8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 3296
+------------------------------------------------------------------
+  0 821 Bra
+  2     8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+820     \b
+821 821 Ket
+823     End
+------------------------------------------------------------------
+
+"\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 3256
+------------------------------------------------------------------
+  0 811 Bra
+  2     $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+810     \b
+811 811 Ket
+813     End
+------------------------------------------------------------------
+
+/(a(?1)b)/
+Memory allocation (code space): 64
+------------------------------------------------------------------
+  0  13 Bra
+  2   9 CBra 1
+  5     a
+  7   2 Recurse
+  9     b
+ 11   9 Ket
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/(a(?1)+b)/
+Memory allocation (code space): 80
+------------------------------------------------------------------
+  0  17 Bra
+  2  13 CBra 1
+  5     a
+  7   4 Once
+  9   2 Recurse
+ 11   4 KetRmax
+ 13     b
+ 15  13 Ket
+ 17  17 Ket
+ 19     End
+------------------------------------------------------------------
+
+/a(?P<name1>b|c)d(?P<longername2>e)/
+Memory allocation (code space): 108
+------------------------------------------------------------------
+  0  24 Bra
+  2     a
+  4   5 CBra 1
+  7     b
+  9   4 Alt
+ 11     c
+ 13   9 Ket
+ 15     d
+ 17   5 CBra 2
+ 20     e
+ 22   5 Ket
+ 24  24 Ket
+ 26     End
+------------------------------------------------------------------
+
+/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
+Memory allocation (code space): 128
+------------------------------------------------------------------
+  0  29 Bra
+  2  18 Bra
+  4     a
+  6  12 CBra 1
+  9     c
+ 11   5 CBra 2
+ 14     d
+ 16   5 Ket
+ 18  12 Ket
+ 20  18 Ket
+ 22   5 CBra 3
+ 25     a
+ 27   5 Ket
+ 29  29 Ket
+ 31     End
+------------------------------------------------------------------
+
+/(?P<a>a)...(?P=a)bbb(?P>a)d/
+Memory allocation (code space): 108
+------------------------------------------------------------------
+  0  24 Bra
+  2   5 CBra 1
+  5     a
+  7   5 Ket
+  9     Any
+ 10     Any
+ 11     Any
+ 12     \1
+ 14     bbb
+ 20   2 Recurse
+ 22     d
+ 24  24 Ket
+ 26     End
+------------------------------------------------------------------
+
+/abc(?C255)de(?C)f/
+Memory allocation (code space): 100
+------------------------------------------------------------------
+  0  22 Bra
+  2     abc
+  8     Callout 255 10 1
+ 12     de
+ 16     Callout 0 16 1
+ 20     f
+ 22  22 Ket
+ 24     End
+------------------------------------------------------------------
+
+/abcde/auto_callout
+Memory allocation (code space): 156
+------------------------------------------------------------------
+  0  36 Bra
+  2     Callout 255 0 1
+  6     a
+  8     Callout 255 1 1
+ 12     b
+ 14     Callout 255 2 1
+ 18     c
+ 20     Callout 255 3 1
+ 24     d
+ 26     Callout 255 4 1
+ 30     e
+ 32     Callout 255 5 0
+ 36  36 Ket
+ 38     End
+------------------------------------------------------------------
+
+/\x{100}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{1000}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{1000}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{10000}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{10000}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{100000}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100000}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{10ffff}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{10ffff}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{110000}/utf
+Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
+
+/[\x{ff}]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{ff}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[\x{100}]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x80/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{80}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\xff/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{ff}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  10 Bra
+  2     A\x{2262}\x{391}.
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = 'A'
+Last code unit = '.'
+Subject length lower bound = 4
+
+/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
+Memory allocation (code space): 44
+------------------------------------------------------------------
+  0   8 Bra
+  2     \x{d55c}\x{ad6d}\x{c5b4}
+  8   8 Ket
+ 10     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \x{d55c}
+Last code unit = \x{c5b4}
+Subject length lower bound = 3
+
+/\x{65e5}\x{672c}\x{8a9e}/I,utf
+Memory allocation (code space): 44
+------------------------------------------------------------------
+  0   8 Bra
+  2     \x{65e5}\x{672c}\x{8a9e}
+  8   8 Ket
+ 10     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \x{65e5}
+Last code unit = \x{8a9e}
+Subject length lower bound = 3
+
+/[\x{100}]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[Z\x{100}]/utf
+Memory allocation (code space): 76
+------------------------------------------------------------------
+  0  16 Bra
+  2     [Z\x{100}]
+ 16  16 Ket
+ 18     End
+------------------------------------------------------------------
+
+/^[\x{100}\E-\Q\E\x{150}]/utf
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  10 Bra
+  2     ^
+  3     [\x{100}-\x{150}]
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E]/utf
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  10 Bra
+  2     ^
+  3     [\x{100}-\x{150}]
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E/utf
+Failed: error 106 at offset 13: missing terminating ] for character class
+
+/[\p{L}]/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\p{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\p{^L}]/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\P{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\P{L}]/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\P{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\P{^L}]/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\p{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[abc\p{L}\x{0660}]/utf
+Memory allocation (code space): 88
+------------------------------------------------------------------
+  0  19 Bra
+  2     [a-c\p{L}\x{660}]
+ 19  19 Ket
+ 21     End
+------------------------------------------------------------------
+
+/[\p{Nd}]/utf
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\p{Nd}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\p{Nd}+-]+/utf
+Memory allocation (code space): 84
+------------------------------------------------------------------
+  0  18 Bra
+  2     [+\-\p{Nd}]++
+ 18  18 Ket
+ 20     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
+Memory allocation (code space): 60
+------------------------------------------------------------------
+  0  12 Bra
+  2  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 12  12 Ket
+ 14     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
+Memory allocation (code space): 60
+------------------------------------------------------------------
+  0  12 Bra
+  2     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 12  12 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[\x{105}-\x{109}]/i,utf
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\x{104}-\x{109}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/( ( (?(1)0|) )*   )/x
+Memory allocation (code space): 104
+------------------------------------------------------------------
+  0  23 Bra
+  2  19 CBra 1
+  5     Brazero
+  6  13 SCBra 2
+  9   6 Cond
+ 11   1 Cond ref
+ 13     0
+ 15   2 Alt
+ 17   8 Ket
+ 19  13 KetRmax
+ 21  19 Ket
+ 23  23 Ket
+ 25     End
+------------------------------------------------------------------
+
+/(  (?(1)0|)*   )/x
+Memory allocation (code space): 84
+------------------------------------------------------------------
+  0  18 Bra
+  2  14 CBra 1
+  5     Brazero
+  6   6 SCond
+  8   1 Cond ref
+ 10     0
+ 12   2 Alt
+ 14   8 KetRmax
+ 16  14 Ket
+ 18  18 Ket
+ 20     End
+------------------------------------------------------------------
+
+/[a]/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     a
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[a]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     a
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[\xaa]/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{aa}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[\xaa]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{aa}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^a]/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^a]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^a]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^a]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^\xaa]/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^\x{aa}]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^\xaa]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^\x{aa}]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+#pattern -memory
+
+/[^\d]/utf,ucp
+------------------------------------------------------------------
+  0   9 Bra
+  2     [^\p{Nd}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[[:^alpha:][:^cntrl:]]+/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  2     [\P{L}\P{Cc}]++
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/[[:^cntrl:][:^alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  2     [\P{Cc}\P{L}]++
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/[[:alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  10 Bra
+  2     [\p{L}]++
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/[[:^alpha:]\S]+/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  2     [\P{L}\P{Xsp}]++
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
+------------------------------------------------------------------
+  0  60 Bra
+  2     abc
+  8   5 CBra 1
+ 11     d
+ 13   4 Alt
+ 15     e
+ 17   9 Ket
+ 19     *THEN
+ 20     x
+ 22  12 CBra 2
+ 25     123
+ 31     *THEN
+ 32     4
+ 34  24 Alt
+ 36     567
+ 42   5 CBra 3
+ 45     b
+ 47   4 Alt
+ 49     q
+ 51   9 Ket
+ 53     *THEN
+ 54     xx
+ 58  36 Ket
+ 60  60 Ket
+ 62     End
+------------------------------------------------------------------
+
+/(((a\2)|(a*)\g<-1>))*a?/
+------------------------------------------------------------------
+  0  39 Bra
+  2     Brazero
+  3  32 SCBra 1
+  6  27 Once
+  8  12 CBra 2
+ 11   7 CBra 3
+ 14     a
+ 16     \2
+ 18   7 Ket
+ 20  11 Alt
+ 22   5 CBra 4
+ 25     a*
+ 27   5 Ket
+ 29  22 Recurse
+ 31  23 Ket
+ 33  27 Ket
+ 35  32 KetRmax
+ 37     a?+
+ 39  39 Ket
+ 41     End
+------------------------------------------------------------------
+
+/((?+1)(\1))/
+------------------------------------------------------------------
+  0  20 Bra
+  2  16 Once
+  4  12 CBra 1
+  7   9 Recurse
+  9   5 CBra 2
+ 12     \1
+ 14   5 Ket
+ 16  12 Ket
+ 18  16 Ket
+ 20  20 Ket
+ 22     End
+------------------------------------------------------------------
+
+"(?1)(?#?'){2}(a)"
+------------------------------------------------------------------
+  0  21 Bra
+  2   4 Once
+  4  14 Recurse
+  6   4 Ket
+  8   4 Once
+ 10  14 Recurse
+ 12   4 Ket
+ 14   5 CBra 1
+ 17     a
+ 19   5 Ket
+ 21  21 Ket
+ 23     End
+------------------------------------------------------------------
+
+/.((?2)(?R)|\1|$)()/
+------------------------------------------------------------------
+  0  28 Bra
+  2     Any
+  3  18 Once
+  5   7 CBra 1
+  8  23 Recurse
+ 10   0 Recurse
+ 12   4 Alt
+ 14     \1
+ 16   3 Alt
+ 18     $
+ 19  14 Ket
+ 21  18 Ket
+ 23   3 CBra 2
+ 26   3 Ket
+ 28  28 Ket
+ 30     End
+------------------------------------------------------------------
+
+/.((?3)(?R)()(?2)|\1|$)()/
+------------------------------------------------------------------
+  0  35 Bra
+  2     Any
+  3  25 Once
+  5  14 CBra 1
+  8  30 Recurse
+ 10   0 Recurse
+ 12   3 CBra 2
+ 15   3 Ket
+ 17  12 Recurse
+ 19   4 Alt
+ 21     \1
+ 23   3 Alt
+ 25     $
+ 26  21 Ket
+ 28  25 Ket
+ 30   3 CBra 3
+ 33   3 Ket
+ 35  35 Ket
+ 37     End
+------------------------------------------------------------------
+
+/(?1)()((((((\1++))\x85)+)|))/
+------------------------------------------------------------------
+  0  50 Bra
+  2   4 Recurse
+  4   3 CBra 1
+  7   3 Ket
+  9  39 CBra 2
+ 12  32 CBra 3
+ 15  27 CBra 4
+ 18  22 CBra 5
+ 21  15 CBra 6
+ 24  10 CBra 7
+ 27   5 Once
+ 29     \1+
+ 32   5 Ket
+ 34  10 Ket
+ 36  15 Ket
+ 38     \x{85}
+ 40  22 KetRmax
+ 42  27 Ket
+ 44   2 Alt
+ 46  34 Ket
+ 48  39 Ket
+ 50  50 Ket
+ 52     End
+------------------------------------------------------------------
+
+# Check the absolute limit on nesting (?| etc. This varies with code unit
+# width because the workspace is a different number of bytes. It will fail
+# with link size 2 in 8-bit and 16-bit but not in 32-bit.
+
+/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
+)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+/parens_nest_limit=1000,-fullbincode
+
+# Use "expand" to create some very long patterns with nested parentheses, in
+# order to test workspace overflow. Again, this varies with code unit width,
+# and even with it fails in two modes, the error offset differs. It also varies
+# with link size - hence multiple tests with different values.
+
+/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{159}*THEN:\[A]{255}\[)]{160}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{199}*THEN:\[A]{255}\[)]{200}/expand,-fullbincode
+Failed: error 186 at offset 979: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{299}*THEN:\[A]{255}\[)]{300}/expand,-fullbincode
+Failed: error 186 at offset 979: regular expression is too complicated
+
+/(?(1)(?1)){8,}+()/debug
+------------------------------------------------------------------
+  0  79 Bra
+  2  70 Once
+  4   6 Cond
+  6   1 Cond ref
+  8  74 Recurse
+ 10   6 Ket
+ 12   6 Cond
+ 14   1 Cond ref
+ 16  74 Recurse
+ 18   6 Ket
+ 20   6 Cond
+ 22   1 Cond ref
+ 24  74 Recurse
+ 26   6 Ket
+ 28   6 Cond
+ 30   1 Cond ref
+ 32  74 Recurse
+ 34   6 Ket
+ 36   6 Cond
+ 38   1 Cond ref
+ 40  74 Recurse
+ 42   6 Ket
+ 44   6 Cond
+ 46   1 Cond ref
+ 48  74 Recurse
+ 50   6 Ket
+ 52   6 Cond
+ 54   1 Cond ref
+ 56  74 Recurse
+ 58   6 Ket
+ 60  10 SBraPos
+ 62   6 SCond
+ 64   1 Cond ref
+ 66  74 Recurse
+ 68   6 Ket
+ 70  10 KetRpos
+ 72  70 Ket
+ 74   3 CBra 1
+ 77   3 Ket
+ 79  79 Ket
+ 81     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcd
+ 0: 
+ 1: 
+
+/(?(1)|a(?1)b){2,}+()/debug
+------------------------------------------------------------------
+  0  43 Bra
+  2  34 Once
+  4   4 Cond
+  6   1 Cond ref
+  8   8 Alt
+ 10     a
+ 12  38 Recurse
+ 14     b
+ 16  12 Ket
+ 18  16 SBraPos
+ 20   4 SCond
+ 22   1 Cond ref
+ 24   8 Alt
+ 26     a
+ 28  38 Recurse
+ 30     b
+ 32  12 Ket
+ 34  16 KetRpos
+ 36  34 Ket
+ 38   3 CBra 1
+ 41   3 Ket
+ 43  43 Ket
+ 45     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcde
+No match
+
+/((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug
+------------------------------------------------------------------
+  0 133 Bra
+  2  41 CBra 1
+  5   2 Recurse
+  7  88 Recurse
+  9  93 Recurse
+ 11  98 Recurse
+ 13 103 Recurse
+ 15 108 Recurse
+ 17 113 Recurse
+ 19 118 Recurse
+ 21 123 Recurse
+ 23 123 Recurse
+ 25 118 Recurse
+ 27 113 Recurse
+ 29 108 Recurse
+ 31 103 Recurse
+ 33  98 Recurse
+ 35  93 Recurse
+ 37  88 Recurse
+ 39   2 Recurse
+ 41   0 Recurse
+ 43  41 Ket
+ 45  41 SCBra 1
+ 48   2 Recurse
+ 50  88 Recurse
+ 52  93 Recurse
+ 54  98 Recurse
+ 56 103 Recurse
+ 58 108 Recurse
+ 60 113 Recurse
+ 62 118 Recurse
+ 64 123 Recurse
+ 66 123 Recurse
+ 68 118 Recurse
+ 70 113 Recurse
+ 72 108 Recurse
+ 74 103 Recurse
+ 76  98 Recurse
+ 78  93 Recurse
+ 80  88 Recurse
+ 82   2 Recurse
+ 84   0 Recurse
+ 86  41 KetRmax
+ 88   3 CBra 2
+ 91   3 Ket
+ 93   3 CBra 3
+ 96   3 Ket
+ 98   3 CBra 4
+101   3 Ket
+103   3 CBra 5
+106   3 Ket
+108   3 CBra 6
+111   3 Ket
+113   3 CBra 7
+116   3 Ket
+118   3 CBra 8
+121   3 Ket
+123   3 CBra 9
+126   3 Ket
+128   3 CBra 10
+131   3 Ket
+133 133 Ket
+135     End
+------------------------------------------------------------------
+Capturing subpattern count = 10
+May match empty string
+Subject length lower bound = 0
+
+# End of testinput8
diff --git a/testdata/testoutput8-32-4 b/testdata/testoutput8-32-4
new file mode 100644 (file)
index 0000000..babd0c7
--- /dev/null
@@ -0,0 +1,1026 @@
+# There are two sorts of patterns in this test. A number of them are
+# representative patterns whose lengths and offsets are checked. This is just a
+# doublecheck test to ensure the sizes don't go horribly wrong when something
+# is changed. The operation of these patterns is checked in other tests.
+#
+# This file also contains tests whose output varies with code unit size and/or
+# link size. Unicode support is required for these tests. There are separate
+# output files for each code unit size and link size.
+
+#pattern fullbincode,memory
+
+/((?i)b)/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2   5 CBra 1
+  5  /i b
+  7   5 Ket
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/(?s)(.*X|^B)/
+Memory allocation (code space): 76
+------------------------------------------------------------------
+  0  16 Bra
+  2   7 CBra 1
+  5     AllAny*
+  7     X
+  9   5 Alt
+ 11     ^
+ 12     B
+ 14  12 Ket
+ 16  16 Ket
+ 18     End
+------------------------------------------------------------------
+
+/(?s:.*X|^B)/
+Memory allocation (code space): 72
+------------------------------------------------------------------
+  0  15 Bra
+  2   6 Bra
+  4     AllAny*
+  6     X
+  8   5 Alt
+ 10     ^
+ 11     B
+ 13  11 Ket
+ 15  15 Ket
+ 17     End
+------------------------------------------------------------------
+
+/^[[:alnum:]]/
+Memory allocation (code space): 60
+------------------------------------------------------------------
+  0  12 Bra
+  2     ^
+  3     [0-9A-Za-z]
+ 12  12 Ket
+ 14     End
+------------------------------------------------------------------
+
+/#/Ix
+Memory allocation (code space): 20
+------------------------------------------------------------------
+  0   2 Bra
+  2   2 Ket
+  4     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+May match empty string
+Options: extended
+Subject length lower bound = 0
+
+/a#/Ix
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     a
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: extended
+First code unit = 'a'
+Subject length lower bound = 1
+
+/x?+/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     x?+
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/x++/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     x++
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/x{1,3}+/
+Memory allocation (code space): 40
+------------------------------------------------------------------
+  0   7 Bra
+  2     x
+  4     x{0,2}+
+  7   7 Ket
+  9     End
+------------------------------------------------------------------
+
+/(x)*+/
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  10 Bra
+  2     Braposzero
+  3   5 CBraPos 1
+  6     x
+  8   5 KetRpos
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
+Memory allocation (code space): 220
+------------------------------------------------------------------
+  0  52 Bra
+  2     ^
+  3  47 CBra 1
+  6   5 CBra 2
+  9     a+
+ 11   5 Ket
+ 13  13 CBra 3
+ 16     [ab]+?
+ 26  13 Ket
+ 28  13 CBra 4
+ 31     [bc]+
+ 41  13 Ket
+ 43   5 CBra 5
+ 46     \w*+
+ 48   5 Ket
+ 50  47 Ket
+ 52  52 Ket
+ 54     End
+------------------------------------------------------------------
+
+"8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 3296
+------------------------------------------------------------------
+  0 821 Bra
+  2     8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+820     \b
+821 821 Ket
+823     End
+------------------------------------------------------------------
+
+"\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 3256
+------------------------------------------------------------------
+  0 811 Bra
+  2     $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+810     \b
+811 811 Ket
+813     End
+------------------------------------------------------------------
+
+/(a(?1)b)/
+Memory allocation (code space): 64
+------------------------------------------------------------------
+  0  13 Bra
+  2   9 CBra 1
+  5     a
+  7   2 Recurse
+  9     b
+ 11   9 Ket
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/(a(?1)+b)/
+Memory allocation (code space): 80
+------------------------------------------------------------------
+  0  17 Bra
+  2  13 CBra 1
+  5     a
+  7   4 Once
+  9   2 Recurse
+ 11   4 KetRmax
+ 13     b
+ 15  13 Ket
+ 17  17 Ket
+ 19     End
+------------------------------------------------------------------
+
+/a(?P<name1>b|c)d(?P<longername2>e)/
+Memory allocation (code space): 108
+------------------------------------------------------------------
+  0  24 Bra
+  2     a
+  4   5 CBra 1
+  7     b
+  9   4 Alt
+ 11     c
+ 13   9 Ket
+ 15     d
+ 17   5 CBra 2
+ 20     e
+ 22   5 Ket
+ 24  24 Ket
+ 26     End
+------------------------------------------------------------------
+
+/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
+Memory allocation (code space): 128
+------------------------------------------------------------------
+  0  29 Bra
+  2  18 Bra
+  4     a
+  6  12 CBra 1
+  9     c
+ 11   5 CBra 2
+ 14     d
+ 16   5 Ket
+ 18  12 Ket
+ 20  18 Ket
+ 22   5 CBra 3
+ 25     a
+ 27   5 Ket
+ 29  29 Ket
+ 31     End
+------------------------------------------------------------------
+
+/(?P<a>a)...(?P=a)bbb(?P>a)d/
+Memory allocation (code space): 108
+------------------------------------------------------------------
+  0  24 Bra
+  2   5 CBra 1
+  5     a
+  7   5 Ket
+  9     Any
+ 10     Any
+ 11     Any
+ 12     \1
+ 14     bbb
+ 20   2 Recurse
+ 22     d
+ 24  24 Ket
+ 26     End
+------------------------------------------------------------------
+
+/abc(?C255)de(?C)f/
+Memory allocation (code space): 100
+------------------------------------------------------------------
+  0  22 Bra
+  2     abc
+  8     Callout 255 10 1
+ 12     de
+ 16     Callout 0 16 1
+ 20     f
+ 22  22 Ket
+ 24     End
+------------------------------------------------------------------
+
+/abcde/auto_callout
+Memory allocation (code space): 156
+------------------------------------------------------------------
+  0  36 Bra
+  2     Callout 255 0 1
+  6     a
+  8     Callout 255 1 1
+ 12     b
+ 14     Callout 255 2 1
+ 18     c
+ 20     Callout 255 3 1
+ 24     d
+ 26     Callout 255 4 1
+ 30     e
+ 32     Callout 255 5 0
+ 36  36 Ket
+ 38     End
+------------------------------------------------------------------
+
+/\x{100}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{1000}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{1000}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{10000}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{10000}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{100000}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100000}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{10ffff}/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{10ffff}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{110000}/utf
+Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
+
+/[\x{ff}]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{ff}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[\x{100}]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x80/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{80}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\xff/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{ff}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  10 Bra
+  2     A\x{2262}\x{391}.
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = 'A'
+Last code unit = '.'
+Subject length lower bound = 4
+
+/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
+Memory allocation (code space): 44
+------------------------------------------------------------------
+  0   8 Bra
+  2     \x{d55c}\x{ad6d}\x{c5b4}
+  8   8 Ket
+ 10     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \x{d55c}
+Last code unit = \x{c5b4}
+Subject length lower bound = 3
+
+/\x{65e5}\x{672c}\x{8a9e}/I,utf
+Memory allocation (code space): 44
+------------------------------------------------------------------
+  0   8 Bra
+  2     \x{65e5}\x{672c}\x{8a9e}
+  8   8 Ket
+ 10     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \x{65e5}
+Last code unit = \x{8a9e}
+Subject length lower bound = 3
+
+/[\x{100}]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{100}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[Z\x{100}]/utf
+Memory allocation (code space): 76
+------------------------------------------------------------------
+  0  16 Bra
+  2     [Z\x{100}]
+ 16  16 Ket
+ 18     End
+------------------------------------------------------------------
+
+/^[\x{100}\E-\Q\E\x{150}]/utf
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  10 Bra
+  2     ^
+  3     [\x{100}-\x{150}]
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E]/utf
+Memory allocation (code space): 52
+------------------------------------------------------------------
+  0  10 Bra
+  2     ^
+  3     [\x{100}-\x{150}]
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E/utf
+Failed: error 106 at offset 13: missing terminating ] for character class
+
+/[\p{L}]/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\p{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\p{^L}]/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\P{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\P{L}]/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\P{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\P{^L}]/
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\p{L}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[abc\p{L}\x{0660}]/utf
+Memory allocation (code space): 88
+------------------------------------------------------------------
+  0  19 Bra
+  2     [a-c\p{L}\x{660}]
+ 19  19 Ket
+ 21     End
+------------------------------------------------------------------
+
+/[\p{Nd}]/utf
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\p{Nd}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\p{Nd}+-]+/utf
+Memory allocation (code space): 84
+------------------------------------------------------------------
+  0  18 Bra
+  2     [+\-\p{Nd}]++
+ 18  18 Ket
+ 20     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
+Memory allocation (code space): 60
+------------------------------------------------------------------
+  0  12 Bra
+  2  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 12  12 Ket
+ 14     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
+Memory allocation (code space): 60
+------------------------------------------------------------------
+  0  12 Bra
+  2     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 12  12 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[\x{105}-\x{109}]/i,utf
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0   9 Bra
+  2     [\x{104}-\x{109}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/( ( (?(1)0|) )*   )/x
+Memory allocation (code space): 104
+------------------------------------------------------------------
+  0  23 Bra
+  2  19 CBra 1
+  5     Brazero
+  6  13 SCBra 2
+  9   6 Cond
+ 11   1 Cond ref
+ 13     0
+ 15   2 Alt
+ 17   8 Ket
+ 19  13 KetRmax
+ 21  19 Ket
+ 23  23 Ket
+ 25     End
+------------------------------------------------------------------
+
+/(  (?(1)0|)*   )/x
+Memory allocation (code space): 84
+------------------------------------------------------------------
+  0  18 Bra
+  2  14 CBra 1
+  5     Brazero
+  6   6 SCond
+  8   1 Cond ref
+ 10     0
+ 12   2 Alt
+ 14   8 KetRmax
+ 16  14 Ket
+ 18  18 Ket
+ 20     End
+------------------------------------------------------------------
+
+/[a]/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     a
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[a]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     a
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[\xaa]/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{aa}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[\xaa]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     \x{aa}
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^a]/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^a]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^a]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^a]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^\xaa]/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^\x{aa}]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+/[^\xaa]/utf
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0   4 Bra
+  2     [^\x{aa}]
+  4   4 Ket
+  6     End
+------------------------------------------------------------------
+
+#pattern -memory
+
+/[^\d]/utf,ucp
+------------------------------------------------------------------
+  0   9 Bra
+  2     [^\p{Nd}]
+  9   9 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[[:^alpha:][:^cntrl:]]+/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  2     [\P{L}\P{Cc}]++
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/[[:^cntrl:][:^alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  2     [\P{Cc}\P{L}]++
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/[[:alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  10 Bra
+  2     [\p{L}]++
+ 10  10 Ket
+ 12     End
+------------------------------------------------------------------
+
+/[[:^alpha:]\S]+/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  2     [\P{L}\P{Xsp}]++
+ 13  13 Ket
+ 15     End
+------------------------------------------------------------------
+
+/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
+------------------------------------------------------------------
+  0  60 Bra
+  2     abc
+  8   5 CBra 1
+ 11     d
+ 13   4 Alt
+ 15     e
+ 17   9 Ket
+ 19     *THEN
+ 20     x
+ 22  12 CBra 2
+ 25     123
+ 31     *THEN
+ 32     4
+ 34  24 Alt
+ 36     567
+ 42   5 CBra 3
+ 45     b
+ 47   4 Alt
+ 49     q
+ 51   9 Ket
+ 53     *THEN
+ 54     xx
+ 58  36 Ket
+ 60  60 Ket
+ 62     End
+------------------------------------------------------------------
+
+/(((a\2)|(a*)\g<-1>))*a?/
+------------------------------------------------------------------
+  0  39 Bra
+  2     Brazero
+  3  32 SCBra 1
+  6  27 Once
+  8  12 CBra 2
+ 11   7 CBra 3
+ 14     a
+ 16     \2
+ 18   7 Ket
+ 20  11 Alt
+ 22   5 CBra 4
+ 25     a*
+ 27   5 Ket
+ 29  22 Recurse
+ 31  23 Ket
+ 33  27 Ket
+ 35  32 KetRmax
+ 37     a?+
+ 39  39 Ket
+ 41     End
+------------------------------------------------------------------
+
+/((?+1)(\1))/
+------------------------------------------------------------------
+  0  20 Bra
+  2  16 Once
+  4  12 CBra 1
+  7   9 Recurse
+  9   5 CBra 2
+ 12     \1
+ 14   5 Ket
+ 16  12 Ket
+ 18  16 Ket
+ 20  20 Ket
+ 22     End
+------------------------------------------------------------------
+
+"(?1)(?#?'){2}(a)"
+------------------------------------------------------------------
+  0  21 Bra
+  2   4 Once
+  4  14 Recurse
+  6   4 Ket
+  8   4 Once
+ 10  14 Recurse
+ 12   4 Ket
+ 14   5 CBra 1
+ 17     a
+ 19   5 Ket
+ 21  21 Ket
+ 23     End
+------------------------------------------------------------------
+
+/.((?2)(?R)|\1|$)()/
+------------------------------------------------------------------
+  0  28 Bra
+  2     Any
+  3  18 Once
+  5   7 CBra 1
+  8  23 Recurse
+ 10   0 Recurse
+ 12   4 Alt
+ 14     \1
+ 16   3 Alt
+ 18     $
+ 19  14 Ket
+ 21  18 Ket
+ 23   3 CBra 2
+ 26   3 Ket
+ 28  28 Ket
+ 30     End
+------------------------------------------------------------------
+
+/.((?3)(?R)()(?2)|\1|$)()/
+------------------------------------------------------------------
+  0  35 Bra
+  2     Any
+  3  25 Once
+  5  14 CBra 1
+  8  30 Recurse
+ 10   0 Recurse
+ 12   3 CBra 2
+ 15   3 Ket
+ 17  12 Recurse
+ 19   4 Alt
+ 21     \1
+ 23   3 Alt
+ 25     $
+ 26  21 Ket
+ 28  25 Ket
+ 30   3 CBra 3
+ 33   3 Ket
+ 35  35 Ket
+ 37     End
+------------------------------------------------------------------
+
+/(?1)()((((((\1++))\x85)+)|))/
+------------------------------------------------------------------
+  0  50 Bra
+  2   4 Recurse
+  4   3 CBra 1
+  7   3 Ket
+  9  39 CBra 2
+ 12  32 CBra 3
+ 15  27 CBra 4
+ 18  22 CBra 5
+ 21  15 CBra 6
+ 24  10 CBra 7
+ 27   5 Once
+ 29     \1+
+ 32   5 Ket
+ 34  10 Ket
+ 36  15 Ket
+ 38     \x{85}
+ 40  22 KetRmax
+ 42  27 Ket
+ 44   2 Alt
+ 46  34 Ket
+ 48  39 Ket
+ 50  50 Ket
+ 52     End
+------------------------------------------------------------------
+
+# Check the absolute limit on nesting (?| etc. This varies with code unit
+# width because the workspace is a different number of bytes. It will fail
+# with link size 2 in 8-bit and 16-bit but not in 32-bit.
+
+/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
+)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+/parens_nest_limit=1000,-fullbincode
+
+# Use "expand" to create some very long patterns with nested parentheses, in
+# order to test workspace overflow. Again, this varies with code unit width,
+# and even with it fails in two modes, the error offset differs. It also varies
+# with link size - hence multiple tests with different values.
+
+/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{159}*THEN:\[A]{255}\[)]{160}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{199}*THEN:\[A]{255}\[)]{200}/expand,-fullbincode
+Failed: error 186 at offset 979: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{299}*THEN:\[A]{255}\[)]{300}/expand,-fullbincode
+Failed: error 186 at offset 979: regular expression is too complicated
+
+/(?(1)(?1)){8,}+()/debug
+------------------------------------------------------------------
+  0  79 Bra
+  2  70 Once
+  4   6 Cond
+  6   1 Cond ref
+  8  74 Recurse
+ 10   6 Ket
+ 12   6 Cond
+ 14   1 Cond ref
+ 16  74 Recurse
+ 18   6 Ket
+ 20   6 Cond
+ 22   1 Cond ref
+ 24  74 Recurse
+ 26   6 Ket
+ 28   6 Cond
+ 30   1 Cond ref
+ 32  74 Recurse
+ 34   6 Ket
+ 36   6 Cond
+ 38   1 Cond ref
+ 40  74 Recurse
+ 42   6 Ket
+ 44   6 Cond
+ 46   1 Cond ref
+ 48  74 Recurse
+ 50   6 Ket
+ 52   6 Cond
+ 54   1 Cond ref
+ 56  74 Recurse
+ 58   6 Ket
+ 60  10 SBraPos
+ 62   6 SCond
+ 64   1 Cond ref
+ 66  74 Recurse
+ 68   6 Ket
+ 70  10 KetRpos
+ 72  70 Ket
+ 74   3 CBra 1
+ 77   3 Ket
+ 79  79 Ket
+ 81     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcd
+ 0: 
+ 1: 
+
+/(?(1)|a(?1)b){2,}+()/debug
+------------------------------------------------------------------
+  0  43 Bra
+  2  34 Once
+  4   4 Cond
+  6   1 Cond ref
+  8   8 Alt
+ 10     a
+ 12  38 Recurse
+ 14     b
+ 16  12 Ket
+ 18  16 SBraPos
+ 20   4 SCond
+ 22   1 Cond ref
+ 24   8 Alt
+ 26     a
+ 28  38 Recurse
+ 30     b
+ 32  12 Ket
+ 34  16 KetRpos
+ 36  34 Ket
+ 38   3 CBra 1
+ 41   3 Ket
+ 43  43 Ket
+ 45     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcde
+No match
+
+/((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug
+------------------------------------------------------------------
+  0 133 Bra
+  2  41 CBra 1
+  5   2 Recurse
+  7  88 Recurse
+  9  93 Recurse
+ 11  98 Recurse
+ 13 103 Recurse
+ 15 108 Recurse
+ 17 113 Recurse
+ 19 118 Recurse
+ 21 123 Recurse
+ 23 123 Recurse
+ 25 118 Recurse
+ 27 113 Recurse
+ 29 108 Recurse
+ 31 103 Recurse
+ 33  98 Recurse
+ 35  93 Recurse
+ 37  88 Recurse
+ 39   2 Recurse
+ 41   0 Recurse
+ 43  41 Ket
+ 45  41 SCBra 1
+ 48   2 Recurse
+ 50  88 Recurse
+ 52  93 Recurse
+ 54  98 Recurse
+ 56 103 Recurse
+ 58 108 Recurse
+ 60 113 Recurse
+ 62 118 Recurse
+ 64 123 Recurse
+ 66 123 Recurse
+ 68 118 Recurse
+ 70 113 Recurse
+ 72 108 Recurse
+ 74 103 Recurse
+ 76  98 Recurse
+ 78  93 Recurse
+ 80  88 Recurse
+ 82   2 Recurse
+ 84   0 Recurse
+ 86  41 KetRmax
+ 88   3 CBra 2
+ 91   3 Ket
+ 93   3 CBra 3
+ 96   3 Ket
+ 98   3 CBra 4
+101   3 Ket
+103   3 CBra 5
+106   3 Ket
+108   3 CBra 6
+111   3 Ket
+113   3 CBra 7
+116   3 Ket
+118   3 CBra 8
+121   3 Ket
+123   3 CBra 9
+126   3 Ket
+128   3 CBra 10
+131   3 Ket
+133 133 Ket
+135     End
+------------------------------------------------------------------
+Capturing subpattern count = 10
+May match empty string
+Subject length lower bound = 0
+
+# End of testinput8
diff --git a/testdata/testoutput8-8 b/testdata/testoutput8-8
deleted file mode 100644 (file)
index a12cc71..0000000
+++ /dev/null
@@ -1,852 +0,0 @@
-# These are a few representative patterns whose lengths and offsets are to be
-# shown when the link size is 2. This is just a doublecheck test to ensure the
-# sizes don't go horribly wrong when something is changed. The pattern contents
-# are all themselves checked in other tests. Unicode, including property
-# support, is required for these tests.
-
-#pattern fullbincode,memory
-
-/((?i)b)/
-Memory allocation (code space): 17
-------------------------------------------------------------------
-  0  13 Bra
-  3   7 CBra 1
-  8  /i b
- 10   7 Ket
- 13  13 Ket
- 16     End
-------------------------------------------------------------------
-
-/(?s)(.*X|^B)/
-Memory allocation (code space): 25
-------------------------------------------------------------------
-  0  21 Bra
-  3   9 CBra 1
-  8     AllAny*
- 10     X
- 12   6 Alt
- 15     ^
- 16     B
- 18  15 Ket
- 21  21 Ket
- 24     End
-------------------------------------------------------------------
-
-/(?s:.*X|^B)/
-Memory allocation (code space): 23
-------------------------------------------------------------------
-  0  19 Bra
-  3   7 Bra
-  6     AllAny*
-  8     X
- 10   6 Alt
- 13     ^
- 14     B
- 16  13 Ket
- 19  19 Ket
- 22     End
-------------------------------------------------------------------
-
-/^[[:alnum:]]/
-Memory allocation (code space): 41
-------------------------------------------------------------------
-  0  37 Bra
-  3     ^
-  4     [0-9A-Za-z]
- 37  37 Ket
- 40     End
-------------------------------------------------------------------
-
-/#/Ix
-Memory allocation (code space): 7
-------------------------------------------------------------------
-  0   3 Bra
-  3   3 Ket
-  6     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-May match empty string
-Options: extended
-Subject length lower bound = 0
-
-/a#/Ix
-Memory allocation (code space): 9
-------------------------------------------------------------------
-  0   5 Bra
-  3     a
-  5   5 Ket
-  8     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: extended
-First code unit = 'a'
-Subject length lower bound = 1
-
-/x?+/
-Memory allocation (code space): 9
-------------------------------------------------------------------
-  0   5 Bra
-  3     x?+
-  5   5 Ket
-  8     End
-------------------------------------------------------------------
-
-/x++/
-Memory allocation (code space): 9
-------------------------------------------------------------------
-  0   5 Bra
-  3     x++
-  5   5 Ket
-  8     End
-------------------------------------------------------------------
-
-/x{1,3}+/
-Memory allocation (code space): 13
-------------------------------------------------------------------
-  0   9 Bra
-  3     x
-  5     x{0,2}+
-  9   9 Ket
- 12     End
-------------------------------------------------------------------
-
-/(x)*+/
-Memory allocation (code space): 18
-------------------------------------------------------------------
-  0  14 Bra
-  3     Braposzero
-  4   7 CBraPos 1
-  9     x
- 11   7 KetRpos
- 14  14 Ket
- 17     End
-------------------------------------------------------------------
-
-/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
-Memory allocation (code space): 120
-------------------------------------------------------------------
-  0 116 Bra
-  3     ^
-  4 109 CBra 1
-  9   7 CBra 2
- 14     a+
- 16   7 Ket
- 19  39 CBra 3
- 24     [ab]+?
- 58  39 Ket
- 61  39 CBra 4
- 66     [bc]+
-100  39 Ket
-103   7 CBra 5
-108     \w*+
-110   7 Ket
-113 109 Ket
-116 116 Ket
-119     End
-------------------------------------------------------------------
-
-"8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
-Memory allocation (code space): 826
-------------------------------------------------------------------
-  0 822 Bra
-  3     8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
-821     \b
-822 822 Ket
-825     End
-------------------------------------------------------------------
-
-"\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
-Memory allocation (code space): 816
-------------------------------------------------------------------
-  0 812 Bra
-  3     $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
-811     \b
-812 812 Ket
-815     End
-------------------------------------------------------------------
-
-/(a(?1)b)/
-Memory allocation (code space): 22
-------------------------------------------------------------------
-  0  18 Bra
-  3  12 CBra 1
-  8     a
- 10   3 Recurse
- 13     b
- 15  12 Ket
- 18  18 Ket
- 21     End
-------------------------------------------------------------------
-
-/(a(?1)+b)/
-Memory allocation (code space): 28
-------------------------------------------------------------------
-  0  24 Bra
-  3  18 CBra 1
-  8     a
- 10   6 Once
- 13   3 Recurse
- 16   6 KetRmax
- 19     b
- 21  18 Ket
- 24  24 Ket
- 27     End
-------------------------------------------------------------------
-
-/a(?P<name1>b|c)d(?P<longername2>e)/
-Memory allocation (code space): 36
-------------------------------------------------------------------
-  0  32 Bra
-  3     a
-  5   7 CBra 1
- 10     b
- 12   5 Alt
- 15     c
- 17  12 Ket
- 20     d
- 22   7 CBra 2
- 27     e
- 29   7 Ket
- 32  32 Ket
- 35     End
-------------------------------------------------------------------
-
-/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
-Memory allocation (code space): 45
-------------------------------------------------------------------
-  0  41 Bra
-  3  25 Bra
-  6     a
-  8  17 CBra 1
- 13     c
- 15   7 CBra 2
- 20     d
- 22   7 Ket
- 25  17 Ket
- 28  25 Ket
- 31   7 CBra 3
- 36     a
- 38   7 Ket
- 41  41 Ket
- 44     End
-------------------------------------------------------------------
-
-/(?P<a>a)...(?P=a)bbb(?P>a)d/
-Memory allocation (code space): 34
-------------------------------------------------------------------
-  0  30 Bra
-  3   7 CBra 1
-  8     a
- 10   7 Ket
- 13     Any
- 14     Any
- 15     Any
- 16     \1
- 19     bbb
- 25   3 Recurse
- 28     d
- 30  30 Ket
- 33     End
-------------------------------------------------------------------
-
-/abc(?C255)de(?C)f/
-Memory allocation (code space): 31
-------------------------------------------------------------------
-  0  27 Bra
-  3     abc
-  9     Callout 255 10 1
- 15     de
- 19     Callout 0 16 1
- 25     f
- 27  27 Ket
- 30     End
-------------------------------------------------------------------
-
-/abcde/auto_callout
-Memory allocation (code space): 53
-------------------------------------------------------------------
-  0  49 Bra
-  3     Callout 255 0 1
-  9     a
- 11     Callout 255 1 1
- 17     b
- 19     Callout 255 2 1
- 25     c
- 27     Callout 255 3 1
- 33     d
- 35     Callout 255 4 1
- 41     e
- 43     Callout 255 5 0
- 49  49 Ket
- 52     End
-------------------------------------------------------------------
-
-/\x{100}/utf
-Memory allocation (code space): 10
-------------------------------------------------------------------
-  0   6 Bra
-  3     \x{100}
-  6   6 Ket
-  9     End
-------------------------------------------------------------------
-
-/\x{1000}/utf
-Memory allocation (code space): 11
-------------------------------------------------------------------
-  0   7 Bra
-  3     \x{1000}
-  7   7 Ket
- 10     End
-------------------------------------------------------------------
-
-/\x{10000}/utf
-Memory allocation (code space): 12
-------------------------------------------------------------------
-  0   8 Bra
-  3     \x{10000}
-  8   8 Ket
- 11     End
-------------------------------------------------------------------
-
-/\x{100000}/utf
-Memory allocation (code space): 12
-------------------------------------------------------------------
-  0   8 Bra
-  3     \x{100000}
-  8   8 Ket
- 11     End
-------------------------------------------------------------------
-
-/\x{10ffff}/utf
-Memory allocation (code space): 12
-------------------------------------------------------------------
-  0   8 Bra
-  3     \x{10ffff}
-  8   8 Ket
- 11     End
-------------------------------------------------------------------
-
-/\x{110000}/utf
-Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
-
-/[\x{ff}]/utf
-Memory allocation (code space): 10
-------------------------------------------------------------------
-  0   6 Bra
-  3     \x{ff}
-  6   6 Ket
-  9     End
-------------------------------------------------------------------
-
-/[\x{100}]/utf
-Memory allocation (code space): 10
-------------------------------------------------------------------
-  0   6 Bra
-  3     \x{100}
-  6   6 Ket
-  9     End
-------------------------------------------------------------------
-
-/\x80/utf
-Memory allocation (code space): 10
-------------------------------------------------------------------
-  0   6 Bra
-  3     \x{80}
-  6   6 Ket
-  9     End
-------------------------------------------------------------------
-
-/\xff/utf
-Memory allocation (code space): 10
-------------------------------------------------------------------
-  0   6 Bra
-  3     \x{ff}
-  6   6 Ket
-  9     End
-------------------------------------------------------------------
-
-/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
-Memory allocation (code space): 18
-------------------------------------------------------------------
-  0  14 Bra
-  3     A\x{2262}\x{391}.
- 14  14 Ket
- 17     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: utf
-First code unit = 'A'
-Last code unit = '.'
-Subject length lower bound = 4
-    
-/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
-Memory allocation (code space): 19
-------------------------------------------------------------------
-  0  15 Bra
-  3     \x{d55c}\x{ad6d}\x{c5b4}
- 15  15 Ket
- 18     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: utf
-First code unit = \xed
-Last code unit = \xb4
-Subject length lower bound = 3
-
-/\x{65e5}\x{672c}\x{8a9e}/I,utf
-Memory allocation (code space): 19
-------------------------------------------------------------------
-  0  15 Bra
-  3     \x{65e5}\x{672c}\x{8a9e}
- 15  15 Ket
- 18     End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: utf
-First code unit = \xe6
-Last code unit = \x9e
-Subject length lower bound = 3
-
-/[\x{100}]/utf
-Memory allocation (code space): 10
-------------------------------------------------------------------
-  0   6 Bra
-  3     \x{100}
-  6   6 Ket
-  9     End
-------------------------------------------------------------------
-
-/[Z\x{100}]/utf
-Memory allocation (code space): 47
-------------------------------------------------------------------
-  0  43 Bra
-  3     [Z\x{100}]
- 43  43 Ket
- 46     End
-------------------------------------------------------------------
-
-/^[\x{100}\E-\Q\E\x{150}]/utf
-Memory allocation (code space): 18
-------------------------------------------------------------------
-  0  14 Bra
-  3     ^
-  4     [\x{100}-\x{150}]
- 14  14 Ket
- 17     End
-------------------------------------------------------------------
-
-/^[\QĀ\E-\QŐ\E]/utf
-Memory allocation (code space): 18
-------------------------------------------------------------------
-  0  14 Bra
-  3     ^
-  4     [\x{100}-\x{150}]
- 14  14 Ket
- 17     End
-------------------------------------------------------------------
-
-/^[\QĀ\E-\QŐ\E/utf
-Failed: error 106 at offset 15: missing terminating ] for character class
-
-/[\p{L}]/
-Memory allocation (code space): 15
-------------------------------------------------------------------
-  0  11 Bra
-  3     [\p{L}]
- 11  11 Ket
- 14     End
-------------------------------------------------------------------
-
-/[\p{^L}]/
-Memory allocation (code space): 15
-------------------------------------------------------------------
-  0  11 Bra
-  3     [\P{L}]
- 11  11 Ket
- 14     End
-------------------------------------------------------------------
-
-/[\P{L}]/
-Memory allocation (code space): 15
-------------------------------------------------------------------
-  0  11 Bra
-  3     [\P{L}]
- 11  11 Ket
- 14     End
-------------------------------------------------------------------
-
-/[\P{^L}]/
-Memory allocation (code space): 15
-------------------------------------------------------------------
-  0  11 Bra
-  3     [\p{L}]
- 11  11 Ket
- 14     End
-------------------------------------------------------------------
-
-/[abc\p{L}\x{0660}]/utf
-Memory allocation (code space): 50
-------------------------------------------------------------------
-  0  46 Bra
-  3     [a-c\p{L}\x{660}]
- 46  46 Ket
- 49     End
-------------------------------------------------------------------
-
-/[\p{Nd}]/utf
-Memory allocation (code space): 15
-------------------------------------------------------------------
-  0  11 Bra
-  3     [\p{Nd}]
- 11  11 Ket
- 14     End
-------------------------------------------------------------------
-
-/[\p{Nd}+-]+/utf
-Memory allocation (code space): 48
-------------------------------------------------------------------
-  0  44 Bra
-  3     [+\-\p{Nd}]++
- 44  44 Ket
- 47     End
-------------------------------------------------------------------
-
-/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
-Memory allocation (code space): 25
-------------------------------------------------------------------
-  0  21 Bra
-  3  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
- 21  21 Ket
- 24     End
-------------------------------------------------------------------
-
-/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
-Memory allocation (code space): 25
-------------------------------------------------------------------
-  0  21 Bra
-  3     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
- 21  21 Ket
- 24     End
-------------------------------------------------------------------
-
-/[\x{105}-\x{109}]/i,utf
-Memory allocation (code space): 17
-------------------------------------------------------------------
-  0  13 Bra
-  3     [\x{104}-\x{109}]
- 13  13 Ket
- 16     End
-------------------------------------------------------------------
-
-/( ( (?(1)0|) )*   )/x
-Memory allocation (code space): 38
-------------------------------------------------------------------
-  0  34 Bra
-  3  28 CBra 1
-  8     Brazero
-  9  19 SCBra 2
- 14   8 Cond
- 17   1 Cond ref
- 20     0
- 22   3 Alt
- 25  11 Ket
- 28  19 KetRmax
- 31  28 Ket
- 34  34 Ket
- 37     End
-------------------------------------------------------------------
-
-/(  (?(1)0|)*   )/x
-Memory allocation (code space): 30
-------------------------------------------------------------------
-  0  26 Bra
-  3  20 CBra 1
-  8     Brazero
-  9   8 SCond
- 12   1 Cond ref
- 15     0
- 17   3 Alt
- 20  11 KetRmax
- 23  20 Ket
- 26  26 Ket
- 29     End
-------------------------------------------------------------------
-
-/[a]/
-Memory allocation (code space): 9
-------------------------------------------------------------------
-  0   5 Bra
-  3     a
-  5   5 Ket
-  8     End
-------------------------------------------------------------------
-
-/[a]/utf
-Memory allocation (code space): 9
-------------------------------------------------------------------
-  0   5 Bra
-  3     a
-  5   5 Ket
-  8     End
-------------------------------------------------------------------
-
-/[\xaa]/
-Memory allocation (code space): 9
-------------------------------------------------------------------
-  0   5 Bra
-  3     \x{aa}
-  5   5 Ket
-  8     End
-------------------------------------------------------------------
-
-/[\xaa]/utf
-Memory allocation (code space): 10
-------------------------------------------------------------------
-  0   6 Bra
-  3     \x{aa}
-  6   6 Ket
-  9     End
-------------------------------------------------------------------
-
-/[^a]/
-Memory allocation (code space): 9
-------------------------------------------------------------------
-  0   5 Bra
-  3     [^a]
-  5   5 Ket
-  8     End
-------------------------------------------------------------------
-
-/[^a]/utf
-Memory allocation (code space): 9
-------------------------------------------------------------------
-  0   5 Bra
-  3     [^a]
-  5   5 Ket
-  8     End
-------------------------------------------------------------------
-
-/[^\xaa]/
-Memory allocation (code space): 9
-------------------------------------------------------------------
-  0   5 Bra
-  3     [^\x{aa}]
-  5   5 Ket
-  8     End
-------------------------------------------------------------------
-
-/[^\xaa]/utf
-Memory allocation (code space): 10
-------------------------------------------------------------------
-  0   6 Bra
-  3     [^\x{aa}]
-  6   6 Ket
-  9     End
-------------------------------------------------------------------
-
-#pattern -memory
-
-/[^\d]/utf,ucp
-------------------------------------------------------------------
-  0  11 Bra
-  3     [^\p{Nd}]
- 11  11 Ket
- 14     End
-------------------------------------------------------------------
-
-/[[:^alpha:][:^cntrl:]]+/utf,ucp
-------------------------------------------------------------------
-  0  15 Bra
-  3     [\P{L}\P{Cc}]++
- 15  15 Ket
- 18     End
-------------------------------------------------------------------
-
-/[[:^cntrl:][:^alpha:]]+/utf,ucp
-------------------------------------------------------------------
-  0  15 Bra
-  3     [\P{Cc}\P{L}]++
- 15  15 Ket
- 18     End
-------------------------------------------------------------------
-
-/[[:alpha:]]+/utf,ucp
-------------------------------------------------------------------
-  0  12 Bra
-  3     [\p{L}]++
- 12  12 Ket
- 15     End
-------------------------------------------------------------------
-
-/[[:^alpha:]\S]+/utf,ucp
-------------------------------------------------------------------
-  0  15 Bra
-  3     [\P{L}\P{Xsp}]++
- 15  15 Ket
- 18     End
-------------------------------------------------------------------
-
-/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
-------------------------------------------------------------------
-  0  73 Bra
-  3     abc
-  9   7 CBra 1
- 14     d
- 16   5 Alt
- 19     e
- 21  12 Ket
- 24     *THEN
- 25     x
- 27  14 CBra 2
- 32     123
- 38     *THEN
- 39     4
- 41  29 Alt
- 44     567
- 50   7 CBra 3
- 55     b
- 57   5 Alt
- 60     q
- 62  12 Ket
- 65     *THEN
- 66     xx
- 70  43 Ket
- 73  73 Ket
- 76     End
-------------------------------------------------------------------
-
-/(((a\2)|(a*)\g<-1>))*a?/
-------------------------------------------------------------------
-  0  57 Bra
-  3     Brazero
-  4  48 SCBra 1
-  9  40 Once
- 12  18 CBra 2
- 17  10 CBra 3
- 22     a
- 24     \2
- 27  10 Ket
- 30  16 Alt
- 33   7 CBra 4
- 38     a*
- 40   7 Ket
- 43  33 Recurse
- 46  34 Ket
- 49  40 Ket
- 52  48 KetRmax
- 55     a?+
- 57  57 Ket
- 60     End
-------------------------------------------------------------------
-
-/((?+1)(\1))/
-------------------------------------------------------------------
-  0  31 Bra
-  3  25 Once
-  6  19 CBra 1
- 11  14 Recurse
- 14   8 CBra 2
- 19     \1
- 22   8 Ket
- 25  19 Ket
- 28  25 Ket
- 31  31 Ket
- 34     End
-------------------------------------------------------------------
-
-"(?1)(?#?'){2}(a)"
-------------------------------------------------------------------
-  0  31 Bra
-  3   6 Once
-  6  21 Recurse
-  9   6 Ket
- 12   6 Once
- 15  21 Recurse
- 18   6 Ket
- 21   7 CBra 1
- 26     a
- 28   7 Ket
- 31  31 Ket
- 34     End
-------------------------------------------------------------------
-
-/.((?2)(?R)|\1|$)()/
-------------------------------------------------------------------
-  0  42 Bra
-  3     Any
-  4  27 Once
-  7  11 CBra 1
- 12  34 Recurse
- 15   0 Recurse
- 18   6 Alt
- 21     \1
- 24   4 Alt
- 27     $
- 28  21 Ket
- 31  27 Ket
- 34   5 CBra 2
- 39   5 Ket
- 42  42 Ket
- 45     End
-------------------------------------------------------------------
-
-/.((?3)(?R)()(?2)|\1|$)()/
-------------------------------------------------------------------
-  0  53 Bra
-  3     Any
-  4  38 Once
-  7  22 CBra 1
- 12  45 Recurse
- 15   0 Recurse
- 18   5 CBra 2
- 23   5 Ket
- 26  18 Recurse
- 29   6 Alt
- 32     \1
- 35   4 Alt
- 38     $
- 39  32 Ket
- 42  38 Ket
- 45   5 CBra 3
- 50   5 Ket
- 53  53 Ket
- 56     End
-------------------------------------------------------------------
-
-/(?1)()((((((\1++))\x85)+)|))/
-------------------------------------------------------------------
-  0  77 Bra
-  3   6 Recurse
-  6   5 CBra 1
- 11   5 Ket
- 14  60 CBra 2
- 19  49 CBra 3
- 24  41 CBra 4
- 29  33 CBra 5
- 34  23 CBra 6
- 39  15 CBra 7
- 44   7 Once
- 47     \1+
- 51   7 Ket
- 54  15 Ket
- 57  23 Ket
- 60     \x{85}
- 62  33 KetRmax
- 65  41 Ket
- 68   3 Alt
- 71  52 Ket
- 74  60 Ket
- 77  77 Ket
- 80     End
-------------------------------------------------------------------
-
-# Check the absolute limit on nesting (?| etc. This varies with code unit
-# width because the workspace is a different number of bytes. It will fail
-# in 8-bit and 16-bit but not in 32-bit.
-    
-/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
-)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
-/parens_nest_limit=1000,-fullbincode
-Failed: error 184 at offset 1540: (?| and/or (?J: or (?x: parentheses are too deeply nested
-
-# End of testinput8
diff --git a/testdata/testoutput8-8-2 b/testdata/testoutput8-8-2
new file mode 100644 (file)
index 0000000..6a9aa0a
--- /dev/null
@@ -0,0 +1,1029 @@
+# There are two sorts of patterns in this test. A number of them are
+# representative patterns whose lengths and offsets are checked. This is just a
+# doublecheck test to ensure the sizes don't go horribly wrong when something
+# is changed. The operation of these patterns is checked in other tests.
+#
+# This file also contains tests whose output varies with code unit size and/or
+# link size. Unicode support is required for these tests. There are separate
+# output files for each code unit size and link size.
+
+#pattern fullbincode,memory
+
+/((?i)b)/
+Memory allocation (code space): 17
+------------------------------------------------------------------
+  0  13 Bra
+  3   7 CBra 1
+  8  /i b
+ 10   7 Ket
+ 13  13 Ket
+ 16     End
+------------------------------------------------------------------
+
+/(?s)(.*X|^B)/
+Memory allocation (code space): 25
+------------------------------------------------------------------
+  0  21 Bra
+  3   9 CBra 1
+  8     AllAny*
+ 10     X
+ 12   6 Alt
+ 15     ^
+ 16     B
+ 18  15 Ket
+ 21  21 Ket
+ 24     End
+------------------------------------------------------------------
+
+/(?s:.*X|^B)/
+Memory allocation (code space): 23
+------------------------------------------------------------------
+  0  19 Bra
+  3   7 Bra
+  6     AllAny*
+  8     X
+ 10   6 Alt
+ 13     ^
+ 14     B
+ 16  13 Ket
+ 19  19 Ket
+ 22     End
+------------------------------------------------------------------
+
+/^[[:alnum:]]/
+Memory allocation (code space): 41
+------------------------------------------------------------------
+  0  37 Bra
+  3     ^
+  4     [0-9A-Za-z]
+ 37  37 Ket
+ 40     End
+------------------------------------------------------------------
+
+/#/Ix
+Memory allocation (code space): 7
+------------------------------------------------------------------
+  0   3 Bra
+  3   3 Ket
+  6     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+May match empty string
+Options: extended
+Subject length lower bound = 0
+
+/a#/Ix
+Memory allocation (code space): 9
+------------------------------------------------------------------
+  0   5 Bra
+  3     a
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: extended
+First code unit = 'a'
+Subject length lower bound = 1
+
+/x?+/
+Memory allocation (code space): 9
+------------------------------------------------------------------
+  0   5 Bra
+  3     x?+
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/x++/
+Memory allocation (code space): 9
+------------------------------------------------------------------
+  0   5 Bra
+  3     x++
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/x{1,3}+/
+Memory allocation (code space): 13
+------------------------------------------------------------------
+  0   9 Bra
+  3     x
+  5     x{0,2}+
+  9   9 Ket
+ 12     End
+------------------------------------------------------------------
+
+/(x)*+/
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0  14 Bra
+  3     Braposzero
+  4   7 CBraPos 1
+  9     x
+ 11   7 KetRpos
+ 14  14 Ket
+ 17     End
+------------------------------------------------------------------
+
+/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
+Memory allocation (code space): 120
+------------------------------------------------------------------
+  0 116 Bra
+  3     ^
+  4 109 CBra 1
+  9   7 CBra 2
+ 14     a+
+ 16   7 Ket
+ 19  39 CBra 3
+ 24     [ab]+?
+ 58  39 Ket
+ 61  39 CBra 4
+ 66     [bc]+
+100  39 Ket
+103   7 CBra 5
+108     \w*+
+110   7 Ket
+113 109 Ket
+116 116 Ket
+119     End
+------------------------------------------------------------------
+
+"8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 826
+------------------------------------------------------------------
+  0 822 Bra
+  3     8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+821     \b
+822 822 Ket
+825     End
+------------------------------------------------------------------
+
+"\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 816
+------------------------------------------------------------------
+  0 812 Bra
+  3     $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+811     \b
+812 812 Ket
+815     End
+------------------------------------------------------------------
+
+/(a(?1)b)/
+Memory allocation (code space): 22
+------------------------------------------------------------------
+  0  18 Bra
+  3  12 CBra 1
+  8     a
+ 10   3 Recurse
+ 13     b
+ 15  12 Ket
+ 18  18 Ket
+ 21     End
+------------------------------------------------------------------
+
+/(a(?1)+b)/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0  24 Bra
+  3  18 CBra 1
+  8     a
+ 10   6 Once
+ 13   3 Recurse
+ 16   6 KetRmax
+ 19     b
+ 21  18 Ket
+ 24  24 Ket
+ 27     End
+------------------------------------------------------------------
+
+/a(?P<name1>b|c)d(?P<longername2>e)/
+Memory allocation (code space): 36
+------------------------------------------------------------------
+  0  32 Bra
+  3     a
+  5   7 CBra 1
+ 10     b
+ 12   5 Alt
+ 15     c
+ 17  12 Ket
+ 20     d
+ 22   7 CBra 2
+ 27     e
+ 29   7 Ket
+ 32  32 Ket
+ 35     End
+------------------------------------------------------------------
+
+/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
+Memory allocation (code space): 45
+------------------------------------------------------------------
+  0  41 Bra
+  3  25 Bra
+  6     a
+  8  17 CBra 1
+ 13     c
+ 15   7 CBra 2
+ 20     d
+ 22   7 Ket
+ 25  17 Ket
+ 28  25 Ket
+ 31   7 CBra 3
+ 36     a
+ 38   7 Ket
+ 41  41 Ket
+ 44     End
+------------------------------------------------------------------
+
+/(?P<a>a)...(?P=a)bbb(?P>a)d/
+Memory allocation (code space): 34
+------------------------------------------------------------------
+  0  30 Bra
+  3   7 CBra 1
+  8     a
+ 10   7 Ket
+ 13     Any
+ 14     Any
+ 15     Any
+ 16     \1
+ 19     bbb
+ 25   3 Recurse
+ 28     d
+ 30  30 Ket
+ 33     End
+------------------------------------------------------------------
+
+/abc(?C255)de(?C)f/
+Memory allocation (code space): 31
+------------------------------------------------------------------
+  0  27 Bra
+  3     abc
+  9     Callout 255 10 1
+ 15     de
+ 19     Callout 0 16 1
+ 25     f
+ 27  27 Ket
+ 30     End
+------------------------------------------------------------------
+
+/abcde/auto_callout
+Memory allocation (code space): 53
+------------------------------------------------------------------
+  0  49 Bra
+  3     Callout 255 0 1
+  9     a
+ 11     Callout 255 1 1
+ 17     b
+ 19     Callout 255 2 1
+ 25     c
+ 27     Callout 255 3 1
+ 33     d
+ 35     Callout 255 4 1
+ 41     e
+ 43     Callout 255 5 0
+ 49  49 Ket
+ 52     End
+------------------------------------------------------------------
+
+/\x{100}/utf
+Memory allocation (code space): 10
+------------------------------------------------------------------
+  0   6 Bra
+  3     \x{100}
+  6   6 Ket
+  9     End
+------------------------------------------------------------------
+
+/\x{1000}/utf
+Memory allocation (code space): 11
+------------------------------------------------------------------
+  0   7 Bra
+  3     \x{1000}
+  7   7 Ket
+ 10     End
+------------------------------------------------------------------
+
+/\x{10000}/utf
+Memory allocation (code space): 12
+------------------------------------------------------------------
+  0   8 Bra
+  3     \x{10000}
+  8   8 Ket
+ 11     End
+------------------------------------------------------------------
+
+/\x{100000}/utf
+Memory allocation (code space): 12
+------------------------------------------------------------------
+  0   8 Bra
+  3     \x{100000}
+  8   8 Ket
+ 11     End
+------------------------------------------------------------------
+
+/\x{10ffff}/utf
+Memory allocation (code space): 12
+------------------------------------------------------------------
+  0   8 Bra
+  3     \x{10ffff}
+  8   8 Ket
+ 11     End
+------------------------------------------------------------------
+
+/\x{110000}/utf
+Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
+
+/[\x{ff}]/utf
+Memory allocation (code space): 10
+------------------------------------------------------------------
+  0   6 Bra
+  3     \x{ff}
+  6   6 Ket
+  9     End
+------------------------------------------------------------------
+
+/[\x{100}]/utf
+Memory allocation (code space): 10
+------------------------------------------------------------------
+  0   6 Bra
+  3     \x{100}
+  6   6 Ket
+  9     End
+------------------------------------------------------------------
+
+/\x80/utf
+Memory allocation (code space): 10
+------------------------------------------------------------------
+  0   6 Bra
+  3     \x{80}
+  6   6 Ket
+  9     End
+------------------------------------------------------------------
+
+/\xff/utf
+Memory allocation (code space): 10
+------------------------------------------------------------------
+  0   6 Bra
+  3     \x{ff}
+  6   6 Ket
+  9     End
+------------------------------------------------------------------
+
+/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0  14 Bra
+  3     A\x{2262}\x{391}.
+ 14  14 Ket
+ 17     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = 'A'
+Last code unit = '.'
+Subject length lower bound = 4
+
+/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
+Memory allocation (code space): 19
+------------------------------------------------------------------
+  0  15 Bra
+  3     \x{d55c}\x{ad6d}\x{c5b4}
+ 15  15 Ket
+ 18     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \xed
+Last code unit = \xb4
+Subject length lower bound = 3
+
+/\x{65e5}\x{672c}\x{8a9e}/I,utf
+Memory allocation (code space): 19
+------------------------------------------------------------------
+  0  15 Bra
+  3     \x{65e5}\x{672c}\x{8a9e}
+ 15  15 Ket
+ 18     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \xe6
+Last code unit = \x9e
+Subject length lower bound = 3
+
+/[\x{100}]/utf
+Memory allocation (code space): 10
+------------------------------------------------------------------
+  0   6 Bra
+  3     \x{100}
+  6   6 Ket
+  9     End
+------------------------------------------------------------------
+
+/[Z\x{100}]/utf
+Memory allocation (code space): 47
+------------------------------------------------------------------
+  0  43 Bra
+  3     [Z\x{100}]
+ 43  43 Ket
+ 46     End
+------------------------------------------------------------------
+
+/^[\x{100}\E-\Q\E\x{150}]/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0  14 Bra
+  3     ^
+  4     [\x{100}-\x{150}]
+ 14  14 Ket
+ 17     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E]/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0  14 Bra
+  3     ^
+  4     [\x{100}-\x{150}]
+ 14  14 Ket
+ 17     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E/utf
+Failed: error 106 at offset 15: missing terminating ] for character class
+
+/[\p{L}]/
+Memory allocation (code space): 15
+------------------------------------------------------------------
+  0  11 Bra
+  3     [\p{L}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[\p{^L}]/
+Memory allocation (code space): 15
+------------------------------------------------------------------
+  0  11 Bra
+  3     [\P{L}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[\P{L}]/
+Memory allocation (code space): 15
+------------------------------------------------------------------
+  0  11 Bra
+  3     [\P{L}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[\P{^L}]/
+Memory allocation (code space): 15
+------------------------------------------------------------------
+  0  11 Bra
+  3     [\p{L}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[abc\p{L}\x{0660}]/utf
+Memory allocation (code space): 50
+------------------------------------------------------------------
+  0  46 Bra
+  3     [a-c\p{L}\x{660}]
+ 46  46 Ket
+ 49     End
+------------------------------------------------------------------
+
+/[\p{Nd}]/utf
+Memory allocation (code space): 15
+------------------------------------------------------------------
+  0  11 Bra
+  3     [\p{Nd}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[\p{Nd}+-]+/utf
+Memory allocation (code space): 48
+------------------------------------------------------------------
+  0  44 Bra
+  3     [+\-\p{Nd}]++
+ 44  44 Ket
+ 47     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
+Memory allocation (code space): 25
+------------------------------------------------------------------
+  0  21 Bra
+  3  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 21  21 Ket
+ 24     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
+Memory allocation (code space): 25
+------------------------------------------------------------------
+  0  21 Bra
+  3     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 21  21 Ket
+ 24     End
+------------------------------------------------------------------
+
+/[\x{105}-\x{109}]/i,utf
+Memory allocation (code space): 17
+------------------------------------------------------------------
+  0  13 Bra
+  3     [\x{104}-\x{109}]
+ 13  13 Ket
+ 16     End
+------------------------------------------------------------------
+
+/( ( (?(1)0|) )*   )/x
+Memory allocation (code space): 38
+------------------------------------------------------------------
+  0  34 Bra
+  3  28 CBra 1
+  8     Brazero
+  9  19 SCBra 2
+ 14   8 Cond
+ 17   1 Cond ref
+ 20     0
+ 22   3 Alt
+ 25  11 Ket
+ 28  19 KetRmax
+ 31  28 Ket
+ 34  34 Ket
+ 37     End
+------------------------------------------------------------------
+
+/(  (?(1)0|)*   )/x
+Memory allocation (code space): 30
+------------------------------------------------------------------
+  0  26 Bra
+  3  20 CBra 1
+  8     Brazero
+  9   8 SCond
+ 12   1 Cond ref
+ 15     0
+ 17   3 Alt
+ 20  11 KetRmax
+ 23  20 Ket
+ 26  26 Ket
+ 29     End
+------------------------------------------------------------------
+
+/[a]/
+Memory allocation (code space): 9
+------------------------------------------------------------------
+  0   5 Bra
+  3     a
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[a]/utf
+Memory allocation (code space): 9
+------------------------------------------------------------------
+  0   5 Bra
+  3     a
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[\xaa]/
+Memory allocation (code space): 9
+------------------------------------------------------------------
+  0   5 Bra
+  3     \x{aa}
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[\xaa]/utf
+Memory allocation (code space): 10
+------------------------------------------------------------------
+  0   6 Bra
+  3     \x{aa}
+  6   6 Ket
+  9     End
+------------------------------------------------------------------
+
+/[^a]/
+Memory allocation (code space): 9
+------------------------------------------------------------------
+  0   5 Bra
+  3     [^a]
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[^a]/utf
+Memory allocation (code space): 9
+------------------------------------------------------------------
+  0   5 Bra
+  3     [^a]
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[^\xaa]/
+Memory allocation (code space): 9
+------------------------------------------------------------------
+  0   5 Bra
+  3     [^\x{aa}]
+  5   5 Ket
+  8     End
+------------------------------------------------------------------
+
+/[^\xaa]/utf
+Memory allocation (code space): 10
+------------------------------------------------------------------
+  0   6 Bra
+  3     [^\x{aa}]
+  6   6 Ket
+  9     End
+------------------------------------------------------------------
+
+#pattern -memory
+
+/[^\d]/utf,ucp
+------------------------------------------------------------------
+  0  11 Bra
+  3     [^\p{Nd}]
+ 11  11 Ket
+ 14     End
+------------------------------------------------------------------
+
+/[[:^alpha:][:^cntrl:]]+/utf,ucp
+------------------------------------------------------------------
+  0  15 Bra
+  3     [\P{L}\P{Cc}]++
+ 15  15 Ket
+ 18     End
+------------------------------------------------------------------
+
+/[[:^cntrl:][:^alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  15 Bra
+  3     [\P{Cc}\P{L}]++
+ 15  15 Ket
+ 18     End
+------------------------------------------------------------------
+
+/[[:alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  12 Bra
+  3     [\p{L}]++
+ 12  12 Ket
+ 15     End
+------------------------------------------------------------------
+
+/[[:^alpha:]\S]+/utf,ucp
+------------------------------------------------------------------
+  0  15 Bra
+  3     [\P{L}\P{Xsp}]++
+ 15  15 Ket
+ 18     End
+------------------------------------------------------------------
+
+/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
+------------------------------------------------------------------
+  0  73 Bra
+  3     abc
+  9   7 CBra 1
+ 14     d
+ 16   5 Alt
+ 19     e
+ 21  12 Ket
+ 24     *THEN
+ 25     x
+ 27  14 CBra 2
+ 32     123
+ 38     *THEN
+ 39     4
+ 41  29 Alt
+ 44     567
+ 50   7 CBra 3
+ 55     b
+ 57   5 Alt
+ 60     q
+ 62  12 Ket
+ 65     *THEN
+ 66     xx
+ 70  43 Ket
+ 73  73 Ket
+ 76     End
+------------------------------------------------------------------
+
+/(((a\2)|(a*)\g<-1>))*a?/
+------------------------------------------------------------------
+  0  57 Bra
+  3     Brazero
+  4  48 SCBra 1
+  9  40 Once
+ 12  18 CBra 2
+ 17  10 CBra 3
+ 22     a
+ 24     \2
+ 27  10 Ket
+ 30  16 Alt
+ 33   7 CBra 4
+ 38     a*
+ 40   7 Ket
+ 43  33 Recurse
+ 46  34 Ket
+ 49  40 Ket
+ 52  48 KetRmax
+ 55     a?+
+ 57  57 Ket
+ 60     End
+------------------------------------------------------------------
+
+/((?+1)(\1))/
+------------------------------------------------------------------
+  0  31 Bra
+  3  25 Once
+  6  19 CBra 1
+ 11  14 Recurse
+ 14   8 CBra 2
+ 19     \1
+ 22   8 Ket
+ 25  19 Ket
+ 28  25 Ket
+ 31  31 Ket
+ 34     End
+------------------------------------------------------------------
+
+"(?1)(?#?'){2}(a)"
+------------------------------------------------------------------
+  0  31 Bra
+  3   6 Once
+  6  21 Recurse
+  9   6 Ket
+ 12   6 Once
+ 15  21 Recurse
+ 18   6 Ket
+ 21   7 CBra 1
+ 26     a
+ 28   7 Ket
+ 31  31 Ket
+ 34     End
+------------------------------------------------------------------
+
+/.((?2)(?R)|\1|$)()/
+------------------------------------------------------------------
+  0  42 Bra
+  3     Any
+  4  27 Once
+  7  11 CBra 1
+ 12  34 Recurse
+ 15   0 Recurse
+ 18   6 Alt
+ 21     \1
+ 24   4 Alt
+ 27     $
+ 28  21 Ket
+ 31  27 Ket
+ 34   5 CBra 2
+ 39   5 Ket
+ 42  42 Ket
+ 45     End
+------------------------------------------------------------------
+
+/.((?3)(?R)()(?2)|\1|$)()/
+------------------------------------------------------------------
+  0  53 Bra
+  3     Any
+  4  38 Once
+  7  22 CBra 1
+ 12  45 Recurse
+ 15   0 Recurse
+ 18   5 CBra 2
+ 23   5 Ket
+ 26  18 Recurse
+ 29   6 Alt
+ 32     \1
+ 35   4 Alt
+ 38     $
+ 39  32 Ket
+ 42  38 Ket
+ 45   5 CBra 3
+ 50   5 Ket
+ 53  53 Ket
+ 56     End
+------------------------------------------------------------------
+
+/(?1)()((((((\1++))\x85)+)|))/
+------------------------------------------------------------------
+  0  77 Bra
+  3   6 Recurse
+  6   5 CBra 1
+ 11   5 Ket
+ 14  60 CBra 2
+ 19  49 CBra 3
+ 24  41 CBra 4
+ 29  33 CBra 5
+ 34  23 CBra 6
+ 39  15 CBra 7
+ 44   7 Once
+ 47     \1+
+ 51   7 Ket
+ 54  15 Ket
+ 57  23 Ket
+ 60     \x{85}
+ 62  33 KetRmax
+ 65  41 Ket
+ 68   3 Alt
+ 71  52 Ket
+ 74  60 Ket
+ 77  77 Ket
+ 80     End
+------------------------------------------------------------------
+
+# Check the absolute limit on nesting (?| etc. This varies with code unit
+# width because the workspace is a different number of bytes. It will fail
+# with link size 2 in 8-bit and 16-bit but not in 32-bit.
+
+/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
+)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+/parens_nest_limit=1000,-fullbincode
+Failed: error 184 at offset 1540: (?| and/or (?J: or (?x: parentheses are too deeply nested
+
+# Use "expand" to create some very long patterns with nested parentheses, in
+# order to test workspace overflow. Again, this varies with code unit width,
+# and even with it fails in two modes, the error offset differs. It also varies
+# with link size - hence multiple tests with different values.
+
+/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
+Failed: error 186 at offset 637: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{159}*THEN:\[A]{255}\[)]{160}/expand,-fullbincode
+Failed: error 186 at offset 637: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{199}*THEN:\[A]{255}\[)]{200}/expand,-fullbincode
+Failed: error 186 at offset 637: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{299}*THEN:\[A]{255}\[)]{300}/expand,-fullbincode
+Failed: error 186 at offset 637: regular expression is too complicated
+
+/(?(1)(?1)){8,}+()/debug
+------------------------------------------------------------------
+  0 119 Bra
+  3 105 Once
+  6   9 Cond
+  9   1 Cond ref
+ 12 111 Recurse
+ 15   9 Ket
+ 18   9 Cond
+ 21   1 Cond ref
+ 24 111 Recurse
+ 27   9 Ket
+ 30   9 Cond
+ 33   1 Cond ref
+ 36 111 Recurse
+ 39   9 Ket
+ 42   9 Cond
+ 45   1 Cond ref
+ 48 111 Recurse
+ 51   9 Ket
+ 54   9 Cond
+ 57   1 Cond ref
+ 60 111 Recurse
+ 63   9 Ket
+ 66   9 Cond
+ 69   1 Cond ref
+ 72 111 Recurse
+ 75   9 Ket
+ 78   9 Cond
+ 81   1 Cond ref
+ 84 111 Recurse
+ 87   9 Ket
+ 90  15 SBraPos
+ 93   9 SCond
+ 96   1 Cond ref
+ 99 111 Recurse
+102   9 Ket
+105  15 KetRpos
+108 105 Ket
+111   5 CBra 1
+116   5 Ket
+119 119 Ket
+122     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcd
+ 0: 
+ 1: 
+
+/(?(1)|a(?1)b){2,}+()/debug
+------------------------------------------------------------------
+  0  61 Bra
+  3  47 Once
+  6   6 Cond
+  9   1 Cond ref
+ 12  10 Alt
+ 15     a
+ 17  53 Recurse
+ 20     b
+ 22  16 Ket
+ 25  22 SBraPos
+ 28   6 SCond
+ 31   1 Cond ref
+ 34  10 Alt
+ 37     a
+ 39  53 Recurse
+ 42     b
+ 44  16 Ket
+ 47  22 KetRpos
+ 50  47 Ket
+ 53   5 CBra 1
+ 58   5 Ket
+ 61  61 Ket
+ 64     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcde
+No match
+
+/((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug
+------------------------------------------------------------------
+  0 205 Bra
+  3  62 CBra 1
+  8   3 Recurse
+ 11 133 Recurse
+ 14 141 Recurse
+ 17 149 Recurse
+ 20 157 Recurse
+ 23 165 Recurse
+ 26 173 Recurse
+ 29 181 Recurse
+ 32 189 Recurse
+ 35 189 Recurse
+ 38 181 Recurse
+ 41 173 Recurse
+ 44 165 Recurse
+ 47 157 Recurse
+ 50 149 Recurse
+ 53 141 Recurse
+ 56 133 Recurse
+ 59   3 Recurse
+ 62   0 Recurse
+ 65  62 Ket
+ 68  62 SCBra 1
+ 73   3 Recurse
+ 76 133 Recurse
+ 79 141 Recurse
+ 82 149 Recurse
+ 85 157 Recurse
+ 88 165 Recurse
+ 91 173 Recurse
+ 94 181 Recurse
+ 97 189 Recurse
+100 189 Recurse
+103 181 Recurse
+106 173 Recurse
+109 165 Recurse
+112 157 Recurse
+115 149 Recurse
+118 141 Recurse
+121 133 Recurse
+124   3 Recurse
+127   0 Recurse
+130  62 KetRmax
+133   5 CBra 2
+138   5 Ket
+141   5 CBra 3
+146   5 Ket
+149   5 CBra 4
+154   5 Ket
+157   5 CBra 5
+162   5 Ket
+165   5 CBra 6
+170   5 Ket
+173   5 CBra 7
+178   5 Ket
+181   5 CBra 8
+186   5 Ket
+189   5 CBra 9
+194   5 Ket
+197   5 CBra 10
+202   5 Ket
+205 205 Ket
+208     End
+------------------------------------------------------------------
+Capturing subpattern count = 10
+May match empty string
+Subject length lower bound = 0
+
+# End of testinput8
diff --git a/testdata/testoutput8-8-3 b/testdata/testoutput8-8-3
new file mode 100644 (file)
index 0000000..2fe1168
--- /dev/null
@@ -0,0 +1,1027 @@
+# There are two sorts of patterns in this test. A number of them are
+# representative patterns whose lengths and offsets are checked. This is just a
+# doublecheck test to ensure the sizes don't go horribly wrong when something
+# is changed. The operation of these patterns is checked in other tests.
+#
+# This file also contains tests whose output varies with code unit size and/or
+# link size. Unicode support is required for these tests. There are separate
+# output files for each code unit size and link size.
+
+#pattern fullbincode,memory
+
+/((?i)b)/
+Memory allocation (code space): 21
+------------------------------------------------------------------
+  0  16 Bra
+  4   8 CBra 1
+ 10  /i b
+ 12   8 Ket
+ 16  16 Ket
+ 20     End
+------------------------------------------------------------------
+
+/(?s)(.*X|^B)/
+Memory allocation (code space): 30
+------------------------------------------------------------------
+  0  25 Bra
+  4  10 CBra 1
+ 10     AllAny*
+ 12     X
+ 14   7 Alt
+ 18     ^
+ 19     B
+ 21  17 Ket
+ 25  25 Ket
+ 29     End
+------------------------------------------------------------------
+
+/(?s:.*X|^B)/
+Memory allocation (code space): 28
+------------------------------------------------------------------
+  0  23 Bra
+  4   8 Bra
+  8     AllAny*
+ 10     X
+ 12   7 Alt
+ 16     ^
+ 17     B
+ 19  15 Ket
+ 23  23 Ket
+ 27     End
+------------------------------------------------------------------
+
+/^[[:alnum:]]/
+Memory allocation (code space): 43
+------------------------------------------------------------------
+  0  38 Bra
+  4     ^
+  5     [0-9A-Za-z]
+ 38  38 Ket
+ 42     End
+------------------------------------------------------------------
+
+/#/Ix
+Memory allocation (code space): 9
+------------------------------------------------------------------
+  0   4 Bra
+  4   4 Ket
+  8     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+May match empty string
+Options: extended
+Subject length lower bound = 0
+
+/a#/Ix
+Memory allocation (code space): 11
+------------------------------------------------------------------
+  0   6 Bra
+  4     a
+  6   6 Ket
+ 10     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: extended
+First code unit = 'a'
+Subject length lower bound = 1
+
+/x?+/
+Memory allocation (code space): 11
+------------------------------------------------------------------
+  0   6 Bra
+  4     x?+
+  6   6 Ket
+ 10     End
+------------------------------------------------------------------
+
+/x++/
+Memory allocation (code space): 11
+------------------------------------------------------------------
+  0   6 Bra
+  4     x++
+  6   6 Ket
+ 10     End
+------------------------------------------------------------------
+
+/x{1,3}+/
+Memory allocation (code space): 15
+------------------------------------------------------------------
+  0  10 Bra
+  4     x
+  6     x{0,2}+
+ 10  10 Ket
+ 14     End
+------------------------------------------------------------------
+
+/(x)*+/
+Memory allocation (code space): 22
+------------------------------------------------------------------
+  0  17 Bra
+  4     Braposzero
+  5   8 CBraPos 1
+ 11     x
+ 13   8 KetRpos
+ 17  17 Ket
+ 21     End
+------------------------------------------------------------------
+
+/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
+Memory allocation (code space): 132
+------------------------------------------------------------------
+  0 127 Bra
+  4     ^
+  5 118 CBra 1
+ 11   8 CBra 2
+ 17     a+
+ 19   8 Ket
+ 23  40 CBra 3
+ 29     [ab]+?
+ 63  40 Ket
+ 67  40 CBra 4
+ 73     [bc]+
+107  40 Ket
+111   8 CBra 5
+117     \w*+
+119   8 Ket
+123 118 Ket
+127 127 Ket
+131     End
+------------------------------------------------------------------
+
+"8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 828
+------------------------------------------------------------------
+  0 823 Bra
+  4     8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+822     \b
+823 823 Ket
+827     End
+------------------------------------------------------------------
+
+"\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 818
+------------------------------------------------------------------
+  0 813 Bra
+  4     $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+812     \b
+813 813 Ket
+817     End
+------------------------------------------------------------------
+
+/(a(?1)b)/
+Memory allocation (code space): 27
+------------------------------------------------------------------
+  0  22 Bra
+  4  14 CBra 1
+ 10     a
+ 12   4 Recurse
+ 16     b
+ 18  14 Ket
+ 22  22 Ket
+ 26     End
+------------------------------------------------------------------
+
+/(a(?1)+b)/
+Memory allocation (code space): 35
+------------------------------------------------------------------
+  0  30 Bra
+  4  22 CBra 1
+ 10     a
+ 12   8 Once
+ 16   4 Recurse
+ 20   8 KetRmax
+ 24     b
+ 26  22 Ket
+ 30  30 Ket
+ 34     End
+------------------------------------------------------------------
+
+/a(?P<name1>b|c)d(?P<longername2>e)/
+Memory allocation (code space): 43
+------------------------------------------------------------------
+  0  38 Bra
+  4     a
+  6   8 CBra 1
+ 12     b
+ 14   6 Alt
+ 18     c
+ 20  14 Ket
+ 24     d
+ 26   8 CBra 2
+ 32     e
+ 34   8 Ket
+ 38  38 Ket
+ 42     End
+------------------------------------------------------------------
+
+/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
+Memory allocation (code space): 55
+------------------------------------------------------------------
+  0  50 Bra
+  4  30 Bra
+  8     a
+ 10  20 CBra 1
+ 16     c
+ 18   8 CBra 2
+ 24     d
+ 26   8 Ket
+ 30  20 Ket
+ 34  30 Ket
+ 38   8 CBra 3
+ 44     a
+ 46   8 Ket
+ 50  50 Ket
+ 54     End
+------------------------------------------------------------------
+
+/(?P<a>a)...(?P=a)bbb(?P>a)d/
+Memory allocation (code space): 39
+------------------------------------------------------------------
+  0  34 Bra
+  4   8 CBra 1
+ 10     a
+ 12   8 Ket
+ 16     Any
+ 17     Any
+ 18     Any
+ 19     \1
+ 22     bbb
+ 28   4 Recurse
+ 32     d
+ 34  34 Ket
+ 38     End
+------------------------------------------------------------------
+
+/abc(?C255)de(?C)f/
+Memory allocation (code space): 37
+------------------------------------------------------------------
+  0  32 Bra
+  4     abc
+ 10     Callout 255 10 1
+ 18     de
+ 22     Callout 0 16 1
+ 30     f
+ 32  32 Ket
+ 36     End
+------------------------------------------------------------------
+
+/abcde/auto_callout
+Memory allocation (code space): 67
+------------------------------------------------------------------
+  0  62 Bra
+  4     Callout 255 0 1
+ 12     a
+ 14     Callout 255 1 1
+ 22     b
+ 24     Callout 255 2 1
+ 32     c
+ 34     Callout 255 3 1
+ 42     d
+ 44     Callout 255 4 1
+ 52     e
+ 54     Callout 255 5 0
+ 62  62 Ket
+ 66     End
+------------------------------------------------------------------
+
+/\x{100}/utf
+Memory allocation (code space): 12
+------------------------------------------------------------------
+  0   7 Bra
+  4     \x{100}
+  7   7 Ket
+ 11     End
+------------------------------------------------------------------
+
+/\x{1000}/utf
+Memory allocation (code space): 13
+------------------------------------------------------------------
+  0   8 Bra
+  4     \x{1000}
+  8   8 Ket
+ 12     End
+------------------------------------------------------------------
+
+/\x{10000}/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   9 Bra
+  4     \x{10000}
+  9   9 Ket
+ 13     End
+------------------------------------------------------------------
+
+/\x{100000}/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   9 Bra
+  4     \x{100000}
+  9   9 Ket
+ 13     End
+------------------------------------------------------------------
+
+/\x{10ffff}/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   9 Bra
+  4     \x{10ffff}
+  9   9 Ket
+ 13     End
+------------------------------------------------------------------
+
+/\x{110000}/utf
+Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
+
+/[\x{ff}]/utf
+Memory allocation (code space): 12
+------------------------------------------------------------------
+  0   7 Bra
+  4     \x{ff}
+  7   7 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[\x{100}]/utf
+Memory allocation (code space): 12
+------------------------------------------------------------------
+  0   7 Bra
+  4     \x{100}
+  7   7 Ket
+ 11     End
+------------------------------------------------------------------
+
+/\x80/utf
+Memory allocation (code space): 12
+------------------------------------------------------------------
+  0   7 Bra
+  4     \x{80}
+  7   7 Ket
+ 11     End
+------------------------------------------------------------------
+
+/\xff/utf
+Memory allocation (code space): 12
+------------------------------------------------------------------
+  0   7 Bra
+  4     \x{ff}
+  7   7 Ket
+ 11     End
+------------------------------------------------------------------
+
+/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
+Memory allocation (code space): 20
+------------------------------------------------------------------
+  0  15 Bra
+  4     A\x{2262}\x{391}.
+ 15  15 Ket
+ 19     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = 'A'
+Last code unit = '.'
+Subject length lower bound = 4
+
+/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
+Memory allocation (code space): 21
+------------------------------------------------------------------
+  0  16 Bra
+  4     \x{d55c}\x{ad6d}\x{c5b4}
+ 16  16 Ket
+ 20     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \xed
+Last code unit = \xb4
+Subject length lower bound = 3
+
+/\x{65e5}\x{672c}\x{8a9e}/I,utf
+Memory allocation (code space): 21
+------------------------------------------------------------------
+  0  16 Bra
+  4     \x{65e5}\x{672c}\x{8a9e}
+ 16  16 Ket
+ 20     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \xe6
+Last code unit = \x9e
+Subject length lower bound = 3
+
+/[\x{100}]/utf
+Memory allocation (code space): 12
+------------------------------------------------------------------
+  0   7 Bra
+  4     \x{100}
+  7   7 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[Z\x{100}]/utf
+Memory allocation (code space): 50
+------------------------------------------------------------------
+  0  45 Bra
+  4     [Z\x{100}]
+ 45  45 Ket
+ 49     End
+------------------------------------------------------------------
+
+/^[\x{100}\E-\Q\E\x{150}]/utf
+Memory allocation (code space): 21
+------------------------------------------------------------------
+  0  16 Bra
+  4     ^
+  5     [\x{100}-\x{150}]
+ 16  16 Ket
+ 20     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E]/utf
+Memory allocation (code space): 21
+------------------------------------------------------------------
+  0  16 Bra
+  4     ^
+  5     [\x{100}-\x{150}]
+ 16  16 Ket
+ 20     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E/utf
+Failed: error 106 at offset 15: missing terminating ] for character class
+
+/[\p{L}]/
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0  13 Bra
+  4     [\p{L}]
+ 13  13 Ket
+ 17     End
+------------------------------------------------------------------
+
+/[\p{^L}]/
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0  13 Bra
+  4     [\P{L}]
+ 13  13 Ket
+ 17     End
+------------------------------------------------------------------
+
+/[\P{L}]/
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0  13 Bra
+  4     [\P{L}]
+ 13  13 Ket
+ 17     End
+------------------------------------------------------------------
+
+/[\P{^L}]/
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0  13 Bra
+  4     [\p{L}]
+ 13  13 Ket
+ 17     End
+------------------------------------------------------------------
+
+/[abc\p{L}\x{0660}]/utf
+Memory allocation (code space): 53
+------------------------------------------------------------------
+  0  48 Bra
+  4     [a-c\p{L}\x{660}]
+ 48  48 Ket
+ 52     End
+------------------------------------------------------------------
+
+/[\p{Nd}]/utf
+Memory allocation (code space): 18
+------------------------------------------------------------------
+  0  13 Bra
+  4     [\p{Nd}]
+ 13  13 Ket
+ 17     End
+------------------------------------------------------------------
+
+/[\p{Nd}+-]+/utf
+Memory allocation (code space): 51
+------------------------------------------------------------------
+  0  46 Bra
+  4     [+\-\p{Nd}]++
+ 46  46 Ket
+ 50     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
+Memory allocation (code space): 27
+------------------------------------------------------------------
+  0  22 Bra
+  4  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 22  22 Ket
+ 26     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
+Memory allocation (code space): 27
+------------------------------------------------------------------
+  0  22 Bra
+  4     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 22  22 Ket
+ 26     End
+------------------------------------------------------------------
+
+/[\x{105}-\x{109}]/i,utf
+Memory allocation (code space): 20
+------------------------------------------------------------------
+  0  15 Bra
+  4     [\x{104}-\x{109}]
+ 15  15 Ket
+ 19     End
+------------------------------------------------------------------
+
+/( ( (?(1)0|) )*   )/x
+Memory allocation (code space): 47
+------------------------------------------------------------------
+  0  42 Bra
+  4  34 CBra 1
+ 10     Brazero
+ 11  23 SCBra 2
+ 17   9 Cond
+ 21   1 Cond ref
+ 24     0
+ 26   4 Alt
+ 30  13 Ket
+ 34  23 KetRmax
+ 38  34 Ket
+ 42  42 Ket
+ 46     End
+------------------------------------------------------------------
+
+/(  (?(1)0|)*   )/x
+Memory allocation (code space): 37
+------------------------------------------------------------------
+  0  32 Bra
+  4  24 CBra 1
+ 10     Brazero
+ 11   9 SCond
+ 15   1 Cond ref
+ 18     0
+ 20   4 Alt
+ 24  13 KetRmax
+ 28  24 Ket
+ 32  32 Ket
+ 36     End
+------------------------------------------------------------------
+
+/[a]/
+Memory allocation (code space): 11
+------------------------------------------------------------------
+  0   6 Bra
+  4     a
+  6   6 Ket
+ 10     End
+------------------------------------------------------------------
+
+/[a]/utf
+Memory allocation (code space): 11
+------------------------------------------------------------------
+  0   6 Bra
+  4     a
+  6   6 Ket
+ 10     End
+------------------------------------------------------------------
+
+/[\xaa]/
+Memory allocation (code space): 11
+------------------------------------------------------------------
+  0   6 Bra
+  4     \x{aa}
+  6   6 Ket
+ 10     End
+------------------------------------------------------------------
+
+/[\xaa]/utf
+Memory allocation (code space): 12
+------------------------------------------------------------------
+  0   7 Bra
+  4     \x{aa}
+  7   7 Ket
+ 11     End
+------------------------------------------------------------------
+
+/[^a]/
+Memory allocation (code space): 11
+------------------------------------------------------------------
+  0   6 Bra
+  4     [^a]
+  6   6 Ket
+ 10     End
+------------------------------------------------------------------
+
+/[^a]/utf
+Memory allocation (code space): 11
+------------------------------------------------------------------
+  0   6 Bra
+  4     [^a]
+  6   6 Ket
+ 10     End
+------------------------------------------------------------------
+
+/[^\xaa]/
+Memory allocation (code space): 11
+------------------------------------------------------------------
+  0   6 Bra
+  4     [^\x{aa}]
+  6   6 Ket
+ 10     End
+------------------------------------------------------------------
+
+/[^\xaa]/utf
+Memory allocation (code space): 12
+------------------------------------------------------------------
+  0   7 Bra
+  4     [^\x{aa}]
+  7   7 Ket
+ 11     End
+------------------------------------------------------------------
+
+#pattern -memory
+
+/[^\d]/utf,ucp
+------------------------------------------------------------------
+  0  13 Bra
+  4     [^\p{Nd}]
+ 13  13 Ket
+ 17     End
+------------------------------------------------------------------
+
+/[[:^alpha:][:^cntrl:]]+/utf,ucp
+------------------------------------------------------------------
+  0  17 Bra
+  4     [\P{L}\P{Cc}]++
+ 17  17 Ket
+ 21     End
+------------------------------------------------------------------
+
+/[[:^cntrl:][:^alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  17 Bra
+  4     [\P{Cc}\P{L}]++
+ 17  17 Ket
+ 21     End
+------------------------------------------------------------------
+
+/[[:alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  14 Bra
+  4     [\p{L}]++
+ 14  14 Ket
+ 18     End
+------------------------------------------------------------------
+
+/[[:^alpha:]\S]+/utf,ucp
+------------------------------------------------------------------
+  0  17 Bra
+  4     [\P{L}\P{Xsp}]++
+ 17  17 Ket
+ 21     End
+------------------------------------------------------------------
+
+/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
+------------------------------------------------------------------
+  0  83 Bra
+  4     abc
+ 10   8 CBra 1
+ 16     d
+ 18   6 Alt
+ 22     e
+ 24  14 Ket
+ 28     *THEN
+ 29     x
+ 31  15 CBra 2
+ 37     123
+ 43     *THEN
+ 44     4
+ 46  33 Alt
+ 50     567
+ 56   8 CBra 3
+ 62     b
+ 64   6 Alt
+ 68     q
+ 70  14 Ket
+ 74     *THEN
+ 75     xx
+ 79  48 Ket
+ 83  83 Ket
+ 87     End
+------------------------------------------------------------------
+
+/(((a\2)|(a*)\g<-1>))*a?/
+------------------------------------------------------------------
+  0  70 Bra
+  4     Brazero
+  5  59 SCBra 1
+ 11  49 Once
+ 15  21 CBra 2
+ 21  11 CBra 3
+ 27     a
+ 29     \2
+ 32  11 Ket
+ 36  20 Alt
+ 40   8 CBra 4
+ 46     a*
+ 48   8 Ket
+ 52  40 Recurse
+ 56  41 Ket
+ 60  49 Ket
+ 64  59 KetRmax
+ 68     a?+
+ 70  70 Ket
+ 74     End
+------------------------------------------------------------------
+
+/((?+1)(\1))/
+------------------------------------------------------------------
+  0  39 Bra
+  4  31 Once
+  8  23 CBra 1
+ 14  18 Recurse
+ 18   9 CBra 2
+ 24     \1
+ 27   9 Ket
+ 31  23 Ket
+ 35  31 Ket
+ 39  39 Ket
+ 43     End
+------------------------------------------------------------------
+
+"(?1)(?#?'){2}(a)"
+------------------------------------------------------------------
+  0  40 Bra
+  4   8 Once
+  8  28 Recurse
+ 12   8 Ket
+ 16   8 Once
+ 20  28 Recurse
+ 24   8 Ket
+ 28   8 CBra 1
+ 34     a
+ 36   8 Ket
+ 40  40 Ket
+ 44     End
+------------------------------------------------------------------
+
+/.((?2)(?R)|\1|$)()/
+------------------------------------------------------------------
+  0  53 Bra
+  4     Any
+  5  34 Once
+  9  14 CBra 1
+ 15  43 Recurse
+ 19   0 Recurse
+ 23   7 Alt
+ 27     \1
+ 30   5 Alt
+ 34     $
+ 35  26 Ket
+ 39  34 Ket
+ 43   6 CBra 2
+ 49   6 Ket
+ 53  53 Ket
+ 57     End
+------------------------------------------------------------------
+
+/.((?3)(?R)()(?2)|\1|$)()/
+------------------------------------------------------------------
+  0  67 Bra
+  4     Any
+  5  48 Once
+  9  28 CBra 1
+ 15  57 Recurse
+ 19   0 Recurse
+ 23   6 CBra 2
+ 29   6 Ket
+ 33  23 Recurse
+ 37   7 Alt
+ 41     \1
+ 44   5 Alt
+ 48     $
+ 49  40 Ket
+ 53  48 Ket
+ 57   6 CBra 3
+ 63   6 Ket
+ 67  67 Ket
+ 71     End
+------------------------------------------------------------------
+
+/(?1)()((((((\1++))\x85)+)|))/
+------------------------------------------------------------------
+  0  96 Bra
+  4   8 Recurse
+  8   6 CBra 1
+ 14   6 Ket
+ 18  74 CBra 2
+ 24  60 CBra 3
+ 30  50 CBra 4
+ 36  40 CBra 5
+ 42  28 CBra 6
+ 48  18 CBra 7
+ 54   8 Once
+ 58     \1+
+ 62   8 Ket
+ 66  18 Ket
+ 70  28 Ket
+ 74     \x{85}
+ 76  40 KetRmax
+ 80  50 Ket
+ 84   4 Alt
+ 88  64 Ket
+ 92  74 Ket
+ 96  96 Ket
+100     End
+------------------------------------------------------------------
+
+# Check the absolute limit on nesting (?| etc. This varies with code unit
+# width because the workspace is a different number of bytes. It will fail
+# with link size 2 in 8-bit and 16-bit but not in 32-bit.
+
+/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
+)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+/parens_nest_limit=1000,-fullbincode
+
+# Use "expand" to create some very long patterns with nested parentheses, in
+# order to test workspace overflow. Again, this varies with code unit width,
+# and even with it fails in two modes, the error offset differs. It also varies
+# with link size - hence multiple tests with different values.
+
+/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{159}*THEN:\[A]{255}\[)]{160}/expand,-fullbincode
+Failed: error 186 at offset 936: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{199}*THEN:\[A]{255}\[)]{200}/expand,-fullbincode
+Failed: error 186 at offset 936: regular expression is too complicated
+
+/(?'ABC'\[[bar](]{299}*THEN:\[A]{255}\[)]{300}/expand,-fullbincode
+Failed: error 186 at offset 936: regular expression is too complicated
+
+/(?(1)(?1)){8,}+()/debug
+------------------------------------------------------------------
+  0 150 Bra
+  4 132 Once
+  8  11 Cond
+ 12   1 Cond ref
+ 15 140 Recurse
+ 19  11 Ket
+ 23  11 Cond
+ 27   1 Cond ref
+ 30 140 Recurse
+ 34  11 Ket
+ 38  11 Cond
+ 42   1 Cond ref
+ 45 140 Recurse
+ 49  11 Ket
+ 53  11 Cond
+ 57   1 Cond ref
+ 60 140 Recurse
+ 64  11 Ket
+ 68  11 Cond
+ 72   1 Cond ref
+ 75 140 Recurse
+ 79  11 Ket
+ 83  11 Cond
+ 87   1 Cond ref
+ 90 140 Recurse
+ 94  11 Ket
+ 98  11 Cond
+102   1 Cond ref
+105 140 Recurse
+109  11 Ket
+113  19 SBraPos
+117  11 SCond
+121   1 Cond ref
+124 140 Recurse
+128  11 Ket
+132  19 KetRpos
+136 132 Ket
+140   6 CBra 1
+146   6 Ket
+150 150 Ket
+154     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcd
+ 0: 
+ 1: 
+
+/(?(1)|a(?1)b){2,}+()/debug
+------------------------------------------------------------------
+  0  76 Bra
+  4  58 Once
+  8   7 Cond
+ 12   1 Cond ref
+ 15  12 Alt
+ 19     a
+ 21  66 Recurse
+ 25     b
+ 27  19 Ket
+ 31  27 SBraPos
+ 35   7 SCond
+ 39   1 Cond ref
+ 42  12 Alt
+ 46     a
+ 48  66 Recurse
+ 52     b
+ 54  19 Ket
+ 58  27 KetRpos
+ 62  58 Ket
+ 66   6 CBra 1
+ 72   6 Ket
+ 76  76 Ket
+ 80     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcde
+No match
+
+/((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug
+------------------------------------------------------------------
+  0 266 Bra
+  4  82 CBra 1
+ 10   4 Recurse
+ 14 176 Recurse
+ 18 186 Recurse
+ 22 196 Recurse
+ 26 206 Recurse
+ 30 216 Recurse
+ 34 226 Recurse
+ 38 236 Recurse
+ 42 246 Recurse
+ 46 246 Recurse
+ 50 236 Recurse
+ 54 226 Recurse
+ 58 216 Recurse
+ 62 206 Recurse
+ 66 196 Recurse
+ 70 186 Recurse
+ 74 176 Recurse
+ 78   4 Recurse
+ 82   0 Recurse
+ 86  82 Ket
+ 90  82 SCBra 1
+ 96   4 Recurse
+100 176 Recurse
+104 186 Recurse
+108 196 Recurse
+112 206 Recurse
+116 216 Recurse
+120 226 Recurse
+124 236 Recurse
+128 246 Recurse
+132 246 Recurse
+136 236 Recurse
+140 226 Recurse
+144 216 Recurse
+148 206 Recurse
+152 196 Recurse
+156 186 Recurse
+160 176 Recurse
+164   4 Recurse
+168   0 Recurse
+172  82 KetRmax
+176   6 CBra 2
+182   6 Ket
+186   6 CBra 3
+192   6 Ket
+196   6 CBra 4
+202   6 Ket
+206   6 CBra 5
+212   6 Ket
+216   6 CBra 6
+222   6 Ket
+226   6 CBra 7
+232   6 Ket
+236   6 CBra 8
+242   6 Ket
+246   6 CBra 9
+252   6 Ket
+256   6 CBra 10
+262   6 Ket
+266 266 Ket
+270     End
+------------------------------------------------------------------
+Capturing subpattern count = 10
+May match empty string
+Subject length lower bound = 0
+
+# End of testinput8
diff --git a/testdata/testoutput8-8-4 b/testdata/testoutput8-8-4
new file mode 100644 (file)
index 0000000..91993b2
--- /dev/null
@@ -0,0 +1,1025 @@
+# There are two sorts of patterns in this test. A number of them are
+# representative patterns whose lengths and offsets are checked. This is just a
+# doublecheck test to ensure the sizes don't go horribly wrong when something
+# is changed. The operation of these patterns is checked in other tests.
+#
+# This file also contains tests whose output varies with code unit size and/or
+# link size. Unicode support is required for these tests. There are separate
+# output files for each code unit size and link size.
+
+#pattern fullbincode,memory
+
+/((?i)b)/
+Memory allocation (code space): 25
+------------------------------------------------------------------
+  0  19 Bra
+  5   9 CBra 1
+ 12  /i b
+ 14   9 Ket
+ 19  19 Ket
+ 24     End
+------------------------------------------------------------------
+
+/(?s)(.*X|^B)/
+Memory allocation (code space): 35
+------------------------------------------------------------------
+  0  29 Bra
+  5  11 CBra 1
+ 12     AllAny*
+ 14     X
+ 16   8 Alt
+ 21     ^
+ 22     B
+ 24  19 Ket
+ 29  29 Ket
+ 34     End
+------------------------------------------------------------------
+
+/(?s:.*X|^B)/
+Memory allocation (code space): 33
+------------------------------------------------------------------
+  0  27 Bra
+  5   9 Bra
+ 10     AllAny*
+ 12     X
+ 14   8 Alt
+ 19     ^
+ 20     B
+ 22  17 Ket
+ 27  27 Ket
+ 32     End
+------------------------------------------------------------------
+
+/^[[:alnum:]]/
+Memory allocation (code space): 45
+------------------------------------------------------------------
+  0  39 Bra
+  5     ^
+  6     [0-9A-Za-z]
+ 39  39 Ket
+ 44     End
+------------------------------------------------------------------
+
+/#/Ix
+Memory allocation (code space): 11
+------------------------------------------------------------------
+  0   5 Bra
+  5   5 Ket
+ 10     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+May match empty string
+Options: extended
+Subject length lower bound = 0
+
+/a#/Ix
+Memory allocation (code space): 13
+------------------------------------------------------------------
+  0   7 Bra
+  5     a
+  7   7 Ket
+ 12     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: extended
+First code unit = 'a'
+Subject length lower bound = 1
+
+/x?+/
+Memory allocation (code space): 13
+------------------------------------------------------------------
+  0   7 Bra
+  5     x?+
+  7   7 Ket
+ 12     End
+------------------------------------------------------------------
+
+/x++/
+Memory allocation (code space): 13
+------------------------------------------------------------------
+  0   7 Bra
+  5     x++
+  7   7 Ket
+ 12     End
+------------------------------------------------------------------
+
+/x{1,3}+/
+Memory allocation (code space): 17
+------------------------------------------------------------------
+  0  11 Bra
+  5     x
+  7     x{0,2}+
+ 11  11 Ket
+ 16     End
+------------------------------------------------------------------
+
+/(x)*+/
+Memory allocation (code space): 26
+------------------------------------------------------------------
+  0  20 Bra
+  5     Braposzero
+  6   9 CBraPos 1
+ 13     x
+ 15   9 KetRpos
+ 20  20 Ket
+ 25     End
+------------------------------------------------------------------
+
+/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
+Memory allocation (code space): 144
+------------------------------------------------------------------
+  0 138 Bra
+  5     ^
+  6 127 CBra 1
+ 13   9 CBra 2
+ 20     a+
+ 22   9 Ket
+ 27  41 CBra 3
+ 34     [ab]+?
+ 68  41 Ket
+ 73  41 CBra 4
+ 80     [bc]+
+114  41 Ket
+119   9 CBra 5
+126     \w*+
+128   9 Ket
+133 127 Ket
+138 138 Ket
+143     End
+------------------------------------------------------------------
+
+"8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 830
+------------------------------------------------------------------
+  0 824 Bra
+  5     8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+823     \b
+824 824 Ket
+829     End
+------------------------------------------------------------------
+
+"\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b"
+Memory allocation (code space): 820
+------------------------------------------------------------------
+  0 814 Bra
+  5     $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
+813     \b
+814 814 Ket
+819     End
+------------------------------------------------------------------
+
+/(a(?1)b)/
+Memory allocation (code space): 32
+------------------------------------------------------------------
+  0  26 Bra
+  5  16 CBra 1
+ 12     a
+ 14   5 Recurse
+ 19     b
+ 21  16 Ket
+ 26  26 Ket
+ 31     End
+------------------------------------------------------------------
+
+/(a(?1)+b)/
+Memory allocation (code space): 42
+------------------------------------------------------------------
+  0  36 Bra
+  5  26 CBra 1
+ 12     a
+ 14  10 Once
+ 19   5 Recurse
+ 24  10 KetRmax
+ 29     b
+ 31  26 Ket
+ 36  36 Ket
+ 41     End
+------------------------------------------------------------------
+
+/a(?P<name1>b|c)d(?P<longername2>e)/
+Memory allocation (code space): 50
+------------------------------------------------------------------
+  0  44 Bra
+  5     a
+  7   9 CBra 1
+ 14     b
+ 16   7 Alt
+ 21     c
+ 23  16 Ket
+ 28     d
+ 30   9 CBra 2
+ 37     e
+ 39   9 Ket
+ 44  44 Ket
+ 49     End
+------------------------------------------------------------------
+
+/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
+Memory allocation (code space): 65
+------------------------------------------------------------------
+  0  59 Bra
+  5  35 Bra
+ 10     a
+ 12  23 CBra 1
+ 19     c
+ 21   9 CBra 2
+ 28     d
+ 30   9 Ket
+ 35  23 Ket
+ 40  35 Ket
+ 45   9 CBra 3
+ 52     a
+ 54   9 Ket
+ 59  59 Ket
+ 64     End
+------------------------------------------------------------------
+
+/(?P<a>a)...(?P=a)bbb(?P>a)d/
+Memory allocation (code space): 44
+------------------------------------------------------------------
+  0  38 Bra
+  5   9 CBra 1
+ 12     a
+ 14   9 Ket
+ 19     Any
+ 20     Any
+ 21     Any
+ 22     \1
+ 25     bbb
+ 31   5 Recurse
+ 36     d
+ 38  38 Ket
+ 43     End
+------------------------------------------------------------------
+
+/abc(?C255)de(?C)f/
+Memory allocation (code space): 43
+------------------------------------------------------------------
+  0  37 Bra
+  5     abc
+ 11     Callout 255 10 1
+ 21     de
+ 25     Callout 0 16 1
+ 35     f
+ 37  37 Ket
+ 42     End
+------------------------------------------------------------------
+
+/abcde/auto_callout
+Memory allocation (code space): 81
+------------------------------------------------------------------
+  0  75 Bra
+  5     Callout 255 0 1
+ 15     a
+ 17     Callout 255 1 1
+ 27     b
+ 29     Callout 255 2 1
+ 39     c
+ 41     Callout 255 3 1
+ 51     d
+ 53     Callout 255 4 1
+ 63     e
+ 65     Callout 255 5 0
+ 75  75 Ket
+ 80     End
+------------------------------------------------------------------
+
+/\x{100}/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   8 Bra
+  5     \x{100}
+  8   8 Ket
+ 13     End
+------------------------------------------------------------------
+
+/\x{1000}/utf
+Memory allocation (code space): 15
+------------------------------------------------------------------
+  0   9 Bra
+  5     \x{1000}
+  9   9 Ket
+ 14     End
+------------------------------------------------------------------
+
+/\x{10000}/utf
+Memory allocation (code space): 16
+------------------------------------------------------------------
+  0  10 Bra
+  5     \x{10000}
+ 10  10 Ket
+ 15     End
+------------------------------------------------------------------
+
+/\x{100000}/utf
+Memory allocation (code space): 16
+------------------------------------------------------------------
+  0  10 Bra
+  5     \x{100000}
+ 10  10 Ket
+ 15     End
+------------------------------------------------------------------
+
+/\x{10ffff}/utf
+Memory allocation (code space): 16
+------------------------------------------------------------------
+  0  10 Bra
+  5     \x{10ffff}
+ 10  10 Ket
+ 15     End
+------------------------------------------------------------------
+
+/\x{110000}/utf
+Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
+
+/[\x{ff}]/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   8 Bra
+  5     \x{ff}
+  8   8 Ket
+ 13     End
+------------------------------------------------------------------
+
+/[\x{100}]/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   8 Bra
+  5     \x{100}
+  8   8 Ket
+ 13     End
+------------------------------------------------------------------
+
+/\x80/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   8 Bra
+  5     \x{80}
+  8   8 Ket
+ 13     End
+------------------------------------------------------------------
+
+/\xff/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   8 Bra
+  5     \x{ff}
+  8   8 Ket
+ 13     End
+------------------------------------------------------------------
+
+/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
+Memory allocation (code space): 22
+------------------------------------------------------------------
+  0  16 Bra
+  5     A\x{2262}\x{391}.
+ 16  16 Ket
+ 21     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = 'A'
+Last code unit = '.'
+Subject length lower bound = 4
+
+/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
+Memory allocation (code space): 23
+------------------------------------------------------------------
+  0  17 Bra
+  5     \x{d55c}\x{ad6d}\x{c5b4}
+ 17  17 Ket
+ 22     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \xed
+Last code unit = \xb4
+Subject length lower bound = 3
+
+/\x{65e5}\x{672c}\x{8a9e}/I,utf
+Memory allocation (code space): 23
+------------------------------------------------------------------
+  0  17 Bra
+  5     \x{65e5}\x{672c}\x{8a9e}
+ 17  17 Ket
+ 22     End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: utf
+First code unit = \xe6
+Last code unit = \x9e
+Subject length lower bound = 3
+
+/[\x{100}]/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   8 Bra
+  5     \x{100}
+  8   8 Ket
+ 13     End
+------------------------------------------------------------------
+
+/[Z\x{100}]/utf
+Memory allocation (code space): 53
+------------------------------------------------------------------
+  0  47 Bra
+  5     [Z\x{100}]
+ 47  47 Ket
+ 52     End
+------------------------------------------------------------------
+
+/^[\x{100}\E-\Q\E\x{150}]/utf
+Memory allocation (code space): 24
+------------------------------------------------------------------
+  0  18 Bra
+  5     ^
+  6     [\x{100}-\x{150}]
+ 18  18 Ket
+ 23     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E]/utf
+Memory allocation (code space): 24
+------------------------------------------------------------------
+  0  18 Bra
+  5     ^
+  6     [\x{100}-\x{150}]
+ 18  18 Ket
+ 23     End
+------------------------------------------------------------------
+
+/^[\QĀ\E-\QŐ\E/utf
+Failed: error 106 at offset 15: missing terminating ] for character class
+
+/[\p{L}]/
+Memory allocation (code space): 21
+------------------------------------------------------------------
+  0  15 Bra
+  5     [\p{L}]
+ 15  15 Ket
+ 20     End
+------------------------------------------------------------------
+
+/[\p{^L}]/
+Memory allocation (code space): 21
+------------------------------------------------------------------
+  0  15 Bra
+  5     [\P{L}]
+ 15  15 Ket
+ 20     End
+------------------------------------------------------------------
+
+/[\P{L}]/
+Memory allocation (code space): 21
+------------------------------------------------------------------
+  0  15 Bra
+  5     [\P{L}]
+ 15  15 Ket
+ 20     End
+------------------------------------------------------------------
+
+/[\P{^L}]/
+Memory allocation (code space): 21
+------------------------------------------------------------------
+  0  15 Bra
+  5     [\p{L}]
+ 15  15 Ket
+ 20     End
+------------------------------------------------------------------
+
+/[abc\p{L}\x{0660}]/utf
+Memory allocation (code space): 56
+------------------------------------------------------------------
+  0  50 Bra
+  5     [a-c\p{L}\x{660}]
+ 50  50 Ket
+ 55     End
+------------------------------------------------------------------
+
+/[\p{Nd}]/utf
+Memory allocation (code space): 21
+------------------------------------------------------------------
+  0  15 Bra
+  5     [\p{Nd}]
+ 15  15 Ket
+ 20     End
+------------------------------------------------------------------
+
+/[\p{Nd}+-]+/utf
+Memory allocation (code space): 54
+------------------------------------------------------------------
+  0  48 Bra
+  5     [+\-\p{Nd}]++
+ 48  48 Ket
+ 53     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
+Memory allocation (code space): 29
+------------------------------------------------------------------
+  0  23 Bra
+  5  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 23  23 Ket
+ 28     End
+------------------------------------------------------------------
+
+/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
+Memory allocation (code space): 29
+------------------------------------------------------------------
+  0  23 Bra
+  5     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
+ 23  23 Ket
+ 28     End
+------------------------------------------------------------------
+
+/[\x{105}-\x{109}]/i,utf
+Memory allocation (code space): 23
+------------------------------------------------------------------
+  0  17 Bra
+  5     [\x{104}-\x{109}]
+ 17  17 Ket
+ 22     End
+------------------------------------------------------------------
+
+/( ( (?(1)0|) )*   )/x
+Memory allocation (code space): 56
+------------------------------------------------------------------
+  0  50 Bra
+  5  40 CBra 1
+ 12     Brazero
+ 13  27 SCBra 2
+ 20  10 Cond
+ 25   1 Cond ref
+ 28     0
+ 30   5 Alt
+ 35  15 Ket
+ 40  27 KetRmax
+ 45  40 Ket
+ 50  50 Ket
+ 55     End
+------------------------------------------------------------------
+
+/(  (?(1)0|)*   )/x
+Memory allocation (code space): 44
+------------------------------------------------------------------
+  0  38 Bra
+  5  28 CBra 1
+ 12     Brazero
+ 13  10 SCond
+ 18   1 Cond ref
+ 21     0
+ 23   5 Alt
+ 28  15 KetRmax
+ 33  28 Ket
+ 38  38 Ket
+ 43     End
+------------------------------------------------------------------
+
+/[a]/
+Memory allocation (code space): 13
+------------------------------------------------------------------
+  0   7 Bra
+  5     a
+  7   7 Ket
+ 12     End
+------------------------------------------------------------------
+
+/[a]/utf
+Memory allocation (code space): 13
+------------------------------------------------------------------
+  0   7 Bra
+  5     a
+  7   7 Ket
+ 12     End
+------------------------------------------------------------------
+
+/[\xaa]/
+Memory allocation (code space): 13
+------------------------------------------------------------------
+  0   7 Bra
+  5     \x{aa}
+  7   7 Ket
+ 12     End
+------------------------------------------------------------------
+
+/[\xaa]/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   8 Bra
+  5     \x{aa}
+  8   8 Ket
+ 13     End
+------------------------------------------------------------------
+
+/[^a]/
+Memory allocation (code space): 13
+------------------------------------------------------------------
+  0   7 Bra
+  5     [^a]
+  7   7 Ket
+ 12     End
+------------------------------------------------------------------
+
+/[^a]/utf
+Memory allocation (code space): 13
+------------------------------------------------------------------
+  0   7 Bra
+  5     [^a]
+  7   7 Ket
+ 12     End
+------------------------------------------------------------------
+
+/[^\xaa]/
+Memory allocation (code space): 13
+------------------------------------------------------------------
+  0   7 Bra
+  5     [^\x{aa}]
+  7   7 Ket
+ 12     End
+------------------------------------------------------------------
+
+/[^\xaa]/utf
+Memory allocation (code space): 14
+------------------------------------------------------------------
+  0   8 Bra
+  5     [^\x{aa}]
+  8   8 Ket
+ 13     End
+------------------------------------------------------------------
+
+#pattern -memory
+
+/[^\d]/utf,ucp
+------------------------------------------------------------------
+  0  15 Bra
+  5     [^\p{Nd}]
+ 15  15 Ket
+ 20     End
+------------------------------------------------------------------
+
+/[[:^alpha:][:^cntrl:]]+/utf,ucp
+------------------------------------------------------------------
+  0  19 Bra
+  5     [\P{L}\P{Cc}]++
+ 19  19 Ket
+ 24     End
+------------------------------------------------------------------
+
+/[[:^cntrl:][:^alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  19 Bra
+  5     [\P{Cc}\P{L}]++
+ 19  19 Ket
+ 24     End
+------------------------------------------------------------------
+
+/[[:alpha:]]+/utf,ucp
+------------------------------------------------------------------
+  0  16 Bra
+  5     [\p{L}]++
+ 16  16 Ket
+ 21     End
+------------------------------------------------------------------
+
+/[[:^alpha:]\S]+/utf,ucp
+------------------------------------------------------------------
+  0  19 Bra
+  5     [\P{L}\P{Xsp}]++
+ 19  19 Ket
+ 24     End
+------------------------------------------------------------------
+
+/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
+------------------------------------------------------------------
+  0  93 Bra
+  5     abc
+ 11   9 CBra 1
+ 18     d
+ 20   7 Alt
+ 25     e
+ 27  16 Ket
+ 32     *THEN
+ 33     x
+ 35  16 CBra 2
+ 42     123
+ 48     *THEN
+ 49     4
+ 51  37 Alt
+ 56     567
+ 62   9 CBra 3
+ 69     b
+ 71   7 Alt
+ 76     q
+ 78  16 Ket
+ 83     *THEN
+ 84     xx
+ 88  53 Ket
+ 93  93 Ket
+ 98     End
+------------------------------------------------------------------
+
+/(((a\2)|(a*)\g<-1>))*a?/
+------------------------------------------------------------------
+  0  83 Bra
+  5     Brazero
+  6  70 SCBra 1
+ 13  58 Once
+ 18  24 CBra 2
+ 25  12 CBra 3
+ 32     a
+ 34     \2
+ 37  12 Ket
+ 42  24 Alt
+ 47   9 CBra 4
+ 54     a*
+ 56   9 Ket
+ 61  47 Recurse
+ 66  48 Ket
+ 71  58 Ket
+ 76  70 KetRmax
+ 81     a?+
+ 83  83 Ket
+ 88     End
+------------------------------------------------------------------
+
+/((?+1)(\1))/
+------------------------------------------------------------------
+  0  47 Bra
+  5  37 Once
+ 10  27 CBra 1
+ 17  22 Recurse
+ 22  10 CBra 2
+ 29     \1
+ 32  10 Ket
+ 37  27 Ket
+ 42  37 Ket
+ 47  47 Ket
+ 52     End
+------------------------------------------------------------------
+
+"(?1)(?#?'){2}(a)"
+------------------------------------------------------------------
+  0  49 Bra
+  5  10 Once
+ 10  35 Recurse
+ 15  10 Ket
+ 20  10 Once
+ 25  35 Recurse
+ 30  10 Ket
+ 35   9 CBra 1
+ 42     a
+ 44   9 Ket
+ 49  49 Ket
+ 54     End
+------------------------------------------------------------------
+
+/.((?2)(?R)|\1|$)()/
+------------------------------------------------------------------
+  0  64 Bra
+  5     Any
+  6  41 Once
+ 11  17 CBra 1
+ 18  52 Recurse
+ 23   0 Recurse
+ 28   8 Alt
+ 33     \1
+ 36   6 Alt
+ 41     $
+ 42  31 Ket
+ 47  41 Ket
+ 52   7 CBra 2
+ 59   7 Ket
+ 64  64 Ket
+ 69     End
+------------------------------------------------------------------
+
+/.((?3)(?R)()(?2)|\1|$)()/
+------------------------------------------------------------------
+  0  81 Bra
+  5     Any
+  6  58 Once
+ 11  34 CBra 1
+ 18  69 Recurse
+ 23   0 Recurse
+ 28   7 CBra 2
+ 35   7 Ket
+ 40  28 Recurse
+ 45   8 Alt
+ 50     \1
+ 53   6 Alt
+ 58     $
+ 59  48 Ket
+ 64  58 Ket
+ 69   7 CBra 3
+ 76   7 Ket
+ 81  81 Ket
+ 86     End
+------------------------------------------------------------------
+
+/(?1)()((((((\1++))\x85)+)|))/
+------------------------------------------------------------------
+  0 115 Bra
+  5  10 Recurse
+ 10   7 CBra 1
+ 17   7 Ket
+ 22  88 CBra 2
+ 29  71 CBra 3
+ 36  59 CBra 4
+ 43  47 CBra 5
+ 50  33 CBra 6
+ 57  21 CBra 7
+ 64   9 Once
+ 69     \1+
+ 73   9 Ket
+ 78  21 Ket
+ 83  33 Ket
+ 88     \x{85}
+ 90  47 KetRmax
+ 95  59 Ket
+100   5 Alt
+105  76 Ket
+110  88 Ket
+115 115 Ket
+120     End
+------------------------------------------------------------------
+
+# Check the absolute limit on nesting (?| etc. This varies with code unit
+# width because the workspace is a different number of bytes. It will fail
+# with link size 2 in 8-bit and 16-bit but not in 32-bit.
+
+/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
+)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+/parens_nest_limit=1000,-fullbincode
+
+# Use "expand" to create some very long patterns with nested parentheses, in
+# order to test workspace overflow. Again, this varies with code unit width,
+# and even with it fails in two modes, the error offset differs. It also varies
+# with link size - hence multiple tests with different values.
+
+/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{159}*THEN:\[A]{255}\[)]{160}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{199}*THEN:\[A]{255}\[)]{200}/expand,-fullbincode
+
+/(?'ABC'\[[bar](]{299}*THEN:\[A]{255}\[)]{300}/expand,-fullbincode
+Failed: error 186 at offset 1224: regular expression is too complicated
+
+/(?(1)(?1)){8,}+()/debug
+------------------------------------------------------------------
+  0 181 Bra
+  5 159 Once
+ 10  13 Cond
+ 15   1 Cond ref
+ 18 169 Recurse
+ 23  13 Ket
+ 28  13 Cond
+ 33   1 Cond ref
+ 36 169 Recurse
+ 41  13 Ket
+ 46  13 Cond
+ 51   1 Cond ref
+ 54 169 Recurse
+ 59  13 Ket
+ 64  13 Cond
+ 69   1 Cond ref
+ 72 169 Recurse
+ 77  13 Ket
+ 82  13 Cond
+ 87   1 Cond ref
+ 90 169 Recurse
+ 95  13 Ket
+100  13 Cond
+105   1 Cond ref
+108 169 Recurse
+113  13 Ket
+118  13 Cond
+123   1 Cond ref
+126 169 Recurse
+131  13 Ket
+136  23 SBraPos
+141  13 SCond
+146   1 Cond ref
+149 169 Recurse
+154  13 Ket
+159  23 KetRpos
+164 159 Ket
+169   7 CBra 1
+176   7 Ket
+181 181 Ket
+186     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcd
+ 0: 
+ 1: 
+
+/(?(1)|a(?1)b){2,}+()/debug
+------------------------------------------------------------------
+  0  91 Bra
+  5  69 Once
+ 10   8 Cond
+ 15   1 Cond ref
+ 18  14 Alt
+ 23     a
+ 25  79 Recurse
+ 30     b
+ 32  22 Ket
+ 37  32 SBraPos
+ 42   8 SCond
+ 47   1 Cond ref
+ 50  14 Alt
+ 55     a
+ 57  79 Recurse
+ 62     b
+ 64  22 Ket
+ 69  32 KetRpos
+ 74  69 Ket
+ 79   7 CBra 1
+ 86   7 Ket
+ 91  91 Ket
+ 96     End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Max back reference = 1
+May match empty string
+Subject length lower bound = 0
+    abcde
+No match
+
+/((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug
+------------------------------------------------------------------
+  0 327 Bra
+  5 102 CBra 1
+ 12   5 Recurse
+ 17 219 Recurse
+ 22 231 Recurse
+ 27 243 Recurse
+ 32 255 Recurse
+ 37 267 Recurse
+ 42 279 Recurse
+ 47 291 Recurse
+ 52 303 Recurse
+ 57 303 Recurse
+ 62 291 Recurse
+ 67 279 Recurse
+ 72 267 Recurse
+ 77 255 Recurse
+ 82 243 Recurse
+ 87 231 Recurse
+ 92 219 Recurse
+ 97   5 Recurse
+102   0 Recurse
+107 102 Ket
+112 102 SCBra 1
+119   5 Recurse
+124 219 Recurse
+129 231 Recurse
+134 243 Recurse
+139 255 Recurse
+144 267 Recurse
+149 279 Recurse
+154 291 Recurse
+159 303 Recurse
+164 303 Recurse
+169 291 Recurse
+174 279 Recurse
+179 267 Recurse
+184 255 Recurse
+189 243 Recurse
+194 231 Recurse
+199 219 Recurse
+204   5 Recurse
+209   0 Recurse
+214 102 KetRmax
+219   7 CBra 2
+226   7 Ket
+231   7 CBra 3
+238   7 Ket
+243   7 CBra 4
+250   7 Ket
+255   7 CBra 5
+262   7 Ket
+267   7 CBra 6
+274   7 Ket
+279   7 CBra 7
+286   7 Ket
+291   7 CBra 8
+298   7 Ket
+303   7 CBra 9
+310   7 Ket
+315   7 CBra 10
+322   7 Ket
+327 327 Ket
+332     End
+------------------------------------------------------------------
+Capturing subpattern count = 10
+May match empty string
+Subject length lower bound = 0
+
+# End of testinput8
index 3aa2071f33eb408e8df5b66888a0a6db156998f1..750a7e097fb9c77362d482f07e316dedd4a053d4 100644 (file)
@@ -2,14 +2,10 @@
 # UTF-8 or Unicode property support. */
     
 #forbid_utf
+#newline_default lf any anycrlf
 
-/a\Cb/
-    aXb
- 0: aXb
-    a\nb
- 0: a\x0ab
-    ** Failers (too big char)
-No match
+/ab/
+\= Expect error message (too big char) and no match
     A\x{123}B
 ** Character \x{123} is greater than 255 and UTF-8 mode is not enabled.
 ** Truncation will probably give the wrong result.
@@ -317,11 +313,20 @@ Failed: error 151 at offset 3: octal value is greater than \377 in 8-bit non-UTF
 Failed: error 176 at offset 259: name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)
     XX
      
+/(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF)XX/mark,alt_verbnames
+Failed: error 176 at offset 258: name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)
+    XX
+     
 /(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE)XX/mark
     XX
  0: XX
 MK: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
 
+/(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE)XX/mark,alt_verbnames
+    XX
+ 0: XX
+MK: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+
 /\u0100/alt_bsux,allow_empty_class,match_unset_backref,dupnames
 Failed: error 177 at offset 5: character code point value in \u.... sequence is too large
 
@@ -356,4 +361,7 @@ Failed: error 177 at offset 6: character code point value in \u.... sequence is
         End
 ------------------------------------------------------------------
 
+/(*MARK:a\x{100}b)z/alt_verbnames 
+Failed: error 134 at offset 14: character code point value in \x{} or \o{} is too large
+
 # End of testinput9
diff --git a/testdata/valgrind-jit.supp b/testdata/valgrind-jit.supp
new file mode 100644 (file)
index 0000000..73e87d2
--- /dev/null
@@ -0,0 +1,7 @@
+{
+   name
+   Memcheck:Addr16
+   obj:*
+   obj:*
+   obj:*
+}